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
"actions":{
"send_email_notification":{
"throttle_period":"1d",
"email":{
"to":[ "myemail@myemail.com" ],
"subject":"{{ctx.metadata.email_subject}}",
"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 ][watcher.actions.email.service] [master-node-1] default account set to [watcheremail]
my watcher configuration from the elasticsearch.yml looks like this
watcher.actions.email.sanitize_html: false
watcher.actions.email.html.sanitization.enabled: false
watcher.actions.email.service.account:
watcheremail:
email_defaults:
from: 'Log Watcher <noreply@mmm.com>'
smtp:
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][watcher.actions.email ] [master-node-1] failed to execute action [filetransferservice_error_status/email_somebody]
java.lang.NullPointerException
at org.elasticsearch.watcher.actions.email.service.Account.send(Account.java:85)
at org.elasticsearch.watcher.actions.email.service.InternalEmailService.send(InternalEmailService.java:83)
at org.elasticsearch.watcher.actions.email.service.InternalEmailService.send(InternalEmailService.java:77)
at org.elasticsearch.watcher.actions.email.ExecutableEmailAction.execute(ExecutableEmailAction.java:67)
at org.elasticsearch.watcher.actions.ActionWrapper.execute(ActionWrapper.java:106)
at org.elasticsearch.watcher.execution.ExecutionService.executeInner(ExecutionService.java:388)
at org.elasticsearch.watcher.execution.ExecutionService.execute(ExecutionService.java:273)
at org.elasticsearch.watcher.transport.actions.execute.TransportExecuteWatchAction.masterOperation(TransportExecuteWatchAction.java:130)
at org.elasticsearch.watcher.transport.actions.execute.TransportExecuteWatchAction.masterOperation(TransportExecuteWatchAction.java:61)
at org.elasticsearch.action.support.master.TransportMasterNodeAction$3.doRun(TransportMasterNodeAction.java:130)
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)