I have used the dockerization concept for ELK. And now I'm trying to configure the email account through docker-compose.yml but am getting unknown settings error.
This is not the correct way to configure watcher or any Elasticsearch configuration for that matter. Please refer to our documentation on How to configure Elasticsearch on Docker
But still, am facing some issue in triggering an email from kibana:pensive:
Also, my account was enabled with two-step verification. As mentioned in the document, now am trying to use the App Password to send email from Watcher.
Error message in below.
"ERROR][o.e.x.w.a.e.ExecutableEmailAction] [reizUl3] failed to execute action [inlined/email_1]
javax.mail.MessagingException: failed to send email with subject [Watch [ss] has exceeded the threshold] via account [gmail_account]
at org.elasticsearch.xpack.watcher.notification.email.EmailService.send(EmailService.java:147) ~[?:?]
at org.elasticsearch.xpack.watcher.notification.email.EmailService.send(EmailService.java:139) ~[?:?]
at org.elasticsearch.xpack.watcher.actions.email.ExecutableEmailAction.execute(ExecutableEmailAction.java:72) ~[?:?]
at org.elasticsearch.xpack.core.watcher.actions.ActionWrapper.execute(ActionWrapper.java:144) [x-pack-core-6.3.2.jar:6.3.2]
at org.elasticsearch.xpack.watcher.execution.ExecutionService.executeInner(ExecutionService.java:475) [x-pack-watcher-6.3.2.jar:6.3.2]
at org.elasticsearch.xpack.watcher.execution.ExecutionService.execute(ExecutionService.java:305) [x-pack-watcher-6.3.2.jar:6.3.2]
at org.elasticsearch.xpack.watcher.transport.actions.execute.TransportExecuteWatchAction$1.doRun(TransportExecuteWatchAction.java:154) [x-pack-watcher-6.3.2.jar:6.3.2]
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-6.3.2.jar:6.3.2]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:626) [elasticsearch-6.3.2.jar:6.3.2]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
at java.lang.Thread.run(Thread.java:844) [?:?]
Caused by: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.gmail.com, 587; timeout 120000
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2118) ~[?:?]
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:712) ~[?:?]
at javax.mail.Service.connect(Service.java:366) ~[?:?]
at org.elasticsearch.xpack.watcher.notification.email.Account.lambda$executeConnect$2(Account.java:153) ~[?:?]
at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
at org.elasticsearch.xpack.watcher.notification.email.Account.executeConnect(Account.java:152) ~[?:?]
at org.elasticsearch.xpack.watcher.notification.email.Account.send(Account.java:111) ~[?:?]
at org.elasticsearch.xpack.watcher.notification.email.EmailService.send(EmailService.java:145) ~[?:?]
... 13 more
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:?]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:400) ~[?:?]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:243) ~[?:?]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:225) ~[?:?]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:402) ~[?:?]
at java.net.Socket.connect(Socket.java:591) ~[?:?]
at com.sun.mail.util.WriteTimeoutSocket.connect(WriteTimeoutSocket.java:113) ~[?:?]
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:329) ~[?:?]
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:238) ~[?:?]
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2084) ~[?:?]
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:712) ~[?:?]
at javax.mail.Service.connect(Service.java:366) ~[?:?]
at org.elasticsearch.xpack.watcher.notification.email.Account.lambda$executeConnect$2(Account.java:153) ~[?:?]
at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
at org.elasticsearch.xpack.watcher.notification.email.Account.executeConnect(Account.java:152) ~[?:?]
at org.elasticsearch.xpack.watcher.notification.email.Account.send(Account.java:111) ~[?:?]
at org.elasticsearch.xpack.watcher.notification.email.EmailService.send(EmailService.java:145) ~[?:?]"
Please correct me if am doing anything wrong over here.
Looks like things inside your container cannot connect to smtp.gmail.com. You should look into your architecture and network connectivity, this seems to be a non Elasticsearch specific issue.
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.