Skip to content

Watcher UI cannot be opened due to watches without a 'to' field in a slack message #20970

@spinscale

Description

@spinscale

Kibana version: 6.3.1

Elasticsearch version: 6.3.1

If a user has configured a slack account in the YAML configuration that contains a default to field, then the slack message itself does not require to have a to field. However the watcher UI is not accessible at all when such a field is found.

The only way to get out of this is to edit the watch in dev-tools again.

Reproduce

Configure Elasticsearch

YAML configuration

xpack.notification.slack:
  account:
    monitoring:
      message_defaults:
        to: '#watcher-test'

Add slack hook URL to keystore

./elasticsearch-6.3.1/bin/elasticsearch-keystore add xpack.notification.slack.account.monitoring.secure_url

Start Elasticsearch and Kibana

Create this totally valid watch in devtools

PUT _xpack/watcher/watch/my_test_watch
{
  "trigger": {
    "schedule": {
      "interval": "10h"
    }
  },
  "input": {
    "simple": {}
  },
  "actions": {
    "the_slack_action": {
      "slack": {
        "message": {
          "text": "This is a test"
        }
      }
    }
  }
}

# execute to see the text in slack
POST _xpack/watcher/watch/my_test_watch/_execute

Now go to Management -> Watcher and see this error message and also the issue of not being able to use the watcher UI at all anymore.

screen shot 2018-07-19 at 10 18 08

The only workaround right now is to add a to field to the watch.

The offending code seems to be here

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions