{
"id" : "send_email",
"type" : "email",
"status" : "failure",
"reason" : "IllegalStateException[cannot find default email account as no accounts have been configured]"
}
I have tried many different alternatives but nothing seems to work. As far as I can tell the configuration is correct, but yet I keep getting the same error message.
so I took your configuration, copy pasted it into my alpha5 elasticsearch.yml configuration after installing x-pack and started up. Saw this in the logs
[2016-09-12 11:43:01,487][INFO ][xpack.notification.email ] [bfnTYGv] default account set to [standard_account]
Setting up and executing this watch, lead to an email in my test mail server (I used maildev, a neat node.js package you install via npm install -g maildev, start via maildev -v and then you can open http://localhost:1080 for a nice web interface to check the emails you get send to localhost:1025.
Can you verify the default account is shown on start up?
Can you show the full configuration of that node? Maybe something gets overwritten? Just run grep "^[^#]" elasticsearch.yml - this returns all lines that are not comments.
Can you try with a configuration like the above (only the bare needed one) and see if that changes anything?
Below is the output from running the Watch with the standard_account included. It would appear that it is having trouble identifying the standard_account setup. Perhaps there is a disconnect between when the Watch is executed and the file(s) providing default configuration? In particular, the xpack.notification.email.account information and native SMTP in elasticsearch.yml.
The elasticsearch.yml setup is as follows with the critical information stripped and replaced with dummy information:
# ======================== Elasticsearch Configuration =========================
#
# ---------------------------------- Cluster -----------------------------------
#
cluster.name: "ClusterName"
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: "cn#@node#"
node.data: false
node.master: false
node.ingest: true
#
# Add custom attributes to the node:
#
# node.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.home: ${ES_HOME}
path.conf: ${ES_CONF_DIR}
path.data: ${ES_DATA_DIR}
path.logs: ${LOG_DIR}
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
# bootstrap.memory_lock: true
#
# Elasticsearch performs poorly when the system is swapping the memory.
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: <Native Host Address>
#
# Set a custom port for HTTP:
#
http.port: 9205
transport.tcp.port: 9305
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.zen.ping.unicast.hosts: [ "<Master Node>:9305" ]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
#
discovery.zen.minimum_master_nodes: 4
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html>
#
# ---------------------------------- Gateway -----------------------------------
#
# All set to defaults
#
# ---------------------------------- Various -----------------------------------
script.inline: true
script.stored: true
script.engine.groovy.inline.search: on
thread_pool.bulk.queue_size: 1000
# --------------------------------------------------------------------------------
# SMTP Email Server config
# -------------------------------------------------------------------------------
xpack.notification.email.account:
standard_account:
profile: standard
smtp:
auth: false
starttls.enable: false
starttls.required: false
host: localhost
port: 25
are you sure that you put the above configuration on every node and restarted it? Especially on the current master as this is where the watch is being executed?
It appears that some nodes were missing the update in elasticsearch.yml, when I went and applied that exact elasticsearch.yml (Copy/Paste) the results then became as follows:
So, the Error Message from ES is as follows; I am not aware of any other logs I should be checking so if there is anything else let me know. The Watch History doesn't appear to show anything value either.
[ERROR][xpack.watcher.actions.email] [ES@MN] failed to execute action [queue/send_email]
java.lang.NullPointerException
at org.elasticsearch.xpack.notification.email.Account.send(Account.java:111)
at org.elasticsearch.xpack.notification.email.EmailService.send(EmailService.java:70)
at org.elasticsearch.xpack.notification.email.EmailService.send(EmailService.java:64)
at org.elasticsearch.xpack.watcher.actions.email.ExecutableEmailAction.execute(ExecutableEmailAction.java:85)
at org.elasticsearch.xpack.watcher.actions.ActionWrapper.execute(ActionWrapper.java:109)
at org.elasticsearch.xpack.watcher.execution.ExecutionService.executeInner(ExecutionService.java:404)
at org.elasticsearch.xpack.watcher.execution.ExecutionService.execute(ExecutionService.java:280)
at org.elasticsearch.xpack.watcher.execution.ExecutionService$WatchExecutionTask.run(ExecutionService.java:476)
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:450)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.