Error executing Watcher Email Action

I'm having trouble with a watch action that executes an email on a single node cluster that works just fine on other clusters (all version 2.1.2)

The action looks like this

            "to":[  "" ],
            "body": "HELLO"

I know the watch itself is ok because I can create and execute it on a different cluster and it works

On the offending cluster I can see the default account being set

[2017-02-20 21:00:10,366][INFO ][] [master-node-1] default account set to [watcheremail]

my watcher configuration from the elasticsearch.yml looks like this false false
      from: 'Log Watcher <>'
      host: [my smtp hostname]
      port: 25

but when the watch action is triggered I get this in the action result

  "actions" : [ {
    "id" : "send_email_notification",
    "type" : "email",
    "status" : "failure",
    "reason" : "NullPointerException[null]"
  } ]

and this in the trace log. Rebuilding the cluster is not an option anyone would be happy about.

[2017-02-20 21:00:59,886][ERROR][ ] [master-node-1] failed to execute action [filetransferservice_error_status/email_somebody]
at org.elasticsearch.watcher.actions.ActionWrapper.execute(
at org.elasticsearch.watcher.execution.ExecutionService.executeInner(
at org.elasticsearch.watcher.execution.ExecutionService.execute(
at org.elasticsearch.watcher.transport.actions.execute.TransportExecuteWatchAction.masterOperation(
at org.elasticsearch.watcher.transport.actions.execute.TransportExecuteWatchAction.masterOperation(
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$


is it possible that localhost does not resolve properly in your linux setup? Can you try and add a static entry to the /etc/hosts file, if resolving has issues?


The actual value in the elasticsearch.yml file is pointing to a functioning corporate smtp server. It works from another cluster so that's not it.

host: [my smtp hostname]

I did add an entry to the hosts file but no change.


just to be sure on my side: Resolving also works for localhost, independently of your SMTP configuration?

Also, any changes in the hosts file will require a restart of your node.



ping localhost
PING localhost ( 56(84) bytes of data.
64 bytes from localhost ( icmp_seq=1 ttl=255 time=0.014 ms
64 bytes from localhost ( icmp_seq=2 ttl=255 time=0.024 ms


interesting, so far we only found this exception on Linux systems with resolving issues. One last thing you can try out would be to also add localhost.localdomain to the hosts list.

Apart from that, this is fixed in newer versions of watcher, so if you upgrade to the latest, this issue should be gone as well, without requiring/changing any of your setup.

Would love go get to the ground of this anyway to be honest. Will try to think, how to debug this further.


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.