Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watcher UI: A watch can be marked with an error status despite having executed fine #22209

Closed
spinscale opened this issue Aug 21, 2018 · 6 comments · Fixed by #67952
Closed
Labels
bug Fixes for quality problems that affect the customer experience Feature:Watcher Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more

Comments

@spinscale
Copy link
Contributor

Kibana version: 6.3.2
Elasticsearch version: 6.3.2

Describe the bug:

A watch action that has once failed in the past, can be forever marked as a failure/error in the UI, unless that error goes away. The reason for this is the fields that are being checked to mark sth as a failure.

Steps to reproduce:

Run these in the dev tools console

DELETE .watcher-history-*

DELETE _xpack/watcher/watch/my_watch

POST _xpack/watcher/watch/my_watch
{
  "trigger": {
    "schedule": {
      "interval": "10h"
    }
  },
  "input": {
    "simple": {}
  },
  "actions": {
    "send_email_to_admin": {
      "condition" : {
        "script" : "return ctx.payload.foo == true"
      },
      "email": {
        "to": "[email protected]",
        "from": "[email protected]",
        "subject": "subject",
        "body": {
          "text": "body"
        }
      }
    }
  }
}

GET _xpack/watcher/watch/my_watch

# action condition will execute
POST _xpack/watcher/watch/my_watch/_execute
{
  "record_execution": true,
  "alternative_input": {
    "foo": true
  }
}

# action condition will not execute
POST _xpack/watcher/watch/my_watch/_execute
{
  "record_execution": true,
  "alternative_input": {
    "foo": false
  },
  "action_modes": {
    "_all" : "force_execute"
  }
}

GET _xpack/watcher/watch/my_watch

To understand the issue, check the execute watch API calls. The first one will actually try to send an email, but fails because no email server is listening on the remote port. Thus the action is marked as successful: false.

The second watch execution is just not trying to send an email because the condition was not met. The last execution thus is now older than the last run of the watch, but still has the information that this particular execution has failed - which seems to mark the watch as error in the UI.

Expected behavior:

The watch should not be marked as an error in the UI, because the last run was just as expected. And the entry that seems to be checked seems to be older.

Screenshots (if relevant):

When checking the watcher UI

image

when directly checking the watch history

image

Note: We can also talk about fixing the status data structure if you think there is a better way to solve this. Ping me for any discussion.

@bmcconaghy bmcconaghy added bug Fixes for quality problems that affect the customer experience :Management Feature:Watcher labels Aug 21, 2018
@bmcconaghy
Copy link
Contributor

Thanks for opening @spinscale

@yaronp68 yaronp68 added Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more and removed :Management DO NOT USE labels Dec 5, 2018
@alisonelizabeth
Copy link
Contributor

This seems related to #25134.

@nickofthyme
Copy link
Contributor

@alisonelizabeth Do you know if there is a workaround to show the correct status?

Also is there any update on the status of this issue?

@alisonelizabeth
Copy link
Contributor

@nickofthyme There is no workaround that I am aware of unfortunately.

Also, no updates right now, but myself or someone else on the ES UI team will try to spend some time and look into this.

@alisonelizabeth
Copy link
Contributor

@nickofthyme I have opened a PR with a fix: #67952

@nickofthyme
Copy link
Contributor

Thanks again for fixing this @alisonelizabeth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Watcher Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants