There is no firewall on my MAC. I welcome any suggestions.
Error logs:
[2019-04-07T13:37:17,019][ERROR][o.e.x.w.a.e.ExecutableEmailAction] [Cvja-AM] failed to execute action [ inlined /email_1] javax.mail.MessagingException: failed to send email with subject [Test] via account [gmail_account] at org.elasticsearch.xpack.watcher.notification.email.EmailService.send(EmailService.java:154) ~[?:?] at org.elasticsearch.xpack.watcher.notification.email.EmailService.send(EmailService.java:146) ~[?:?] 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.7.0.jar:6.7.0] at org.elasticsearch.xpack.watcher.execution.ExecutionService.executeInner(ExecutionService.java:456) [x-pack-watcher-6.7.0.jar:6.7.0] at org.elasticsearch.xpack.watcher.execution.ExecutionService.execute(ExecutionService.java:295) [x-pack-watcher-6.7.0.jar:6.7.0] at org.elasticsearch.xpack.watcher.transport.actions.execute.TransportExecuteWatchAction$1.doRun(TransportExecuteWatchAction.java:164)
...
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:2209) ~[?:?] at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:740) ~[?:?] at javax.mail.Service.connect(Service.java:366) ~[?:?]
I can access SMTP server using the telnet on my MAC (smtp.gmail.com). I can access it on port 465, meaning that SSL is used.
However I was not able to find the relevant config for elastic.yml for the port 465.
I was not able to get the elastic config working for neither 587 or 465 ports on Ubuntu. The same works from my windows machine but fails from Linux or Mac. There is no firewall on MAC.
Is there a way I can identify the SMTP server issue ?
The couldnt connect error message usually indicates a network issue/firewall. On your mac you might have tools running like little snitch that do this?
What error do you get when running telnet smtp.gmail.com 587? If that one does not work, then there is indeed a component on your MAC running blocking this.
The exception above indicates, that after 2 minutes no connection could be established. One more thing: Can you restart elasticsearch on your mac and retry? This way, the JVM DNS cache is cleared.
Trying 74.125.142.109...
telnet: connect to address 74.125.142.109: Operation timed out
Trying 2607:f8b0:400e:c00::6d...
telnet: connect to address 2607:f8b0:400e:c00::6d: No route to host
telnet: Unable to connect to remote host
On Ubuntu machine:
Trying 74.125.20.108...
Trying 2607:f8b0:400e:c00::6d...
telnet: Unable to connect to remote host: Network is unreachable
I have tried restarting the elasticsearch multiple times.
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.