Reply
Highlighted
Contributor
Posts: 59
Registered: ‎11-24-2017

SMTP configuration for Oozie

Hello everyone

 

I am trying to correctly configure smtp to send notification email through Oozie email action.

In Cloudera Manager I have set the following properties:

 

cm_smtp.pngdf

 

 

When I launch the action in Hue scheduler it fails with the following error

 

JOB[0000000-180130111414032-oozie-oozi-W] ACTION[0000000-180130111414032-oozie-oozi-W@email-e637] Error starting action [email-e637]. ErrorType [ERROR], ErrorCode [EM007], Message [EM007: Encountered an error while sending the email message over SMTP.]
org.apache.oozie.action.ActionExecutorException: EM007: Encountered an error while sending the email message over SMTP.
	at org.apache.oozie.action.email.EmailActionExecutor.email(EmailActionExecutor.java:297)
	at org.apache.oozie.action.email.EmailActionExecutor.validateAndMail(EmailActionExecutor.java:171)
	at org.apache.oozie.action.email.EmailActionExecutor.start(EmailActionExecutor.java:110)
	at org.apache.oozie.command.wf.ActionStartXCommand.execute(ActionStartXCommand.java:232)
	at org.apache.oozie.command.wf.ActionStartXCommand.execute(ActionStartXCommand.java:63)
	at org.apache.oozie.command.XCommand.call(XCommand.java:286)
	at org.apache.oozie.service.CallableQueueService$CompositeCallable.call(CallableQueueService.java:332)
	at org.apache.oozie.service.CallableQueueService$CompositeCallable.call(CallableQueueService.java:261)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at org.apache.oozie.service.CallableQueueService$CallableWrapper.run(CallableQueueService.java:179)
	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)
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.live.com, port: 25;
  nested exception is:
	java.net.SocketTimeoutException: connect timed out
	at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282)
	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
	at javax.mail.Service.connect(Service.java:297)
	at javax.mail.Service.connect(Service.java:156)
	at javax.mail.Service.connect(Service.java:105)
	at javax.mail.Transport.send0(Transport.java:168)
	at javax.mail.Transport.send(Transport.java:98)
	at org.apache.oozie.action.email.EmailActionExecutor.email(EmailActionExecutor.java:293)
	... 12 more
Caused by: java.net.SocketTimeoutException: connect timed out
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:579)
	at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:230)
	at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
	at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1250)
	... 19 more

 

I've tried both with Outlook mails (on port 25 and 465) and Gmail (ports 465 and 587) but all fail.

My cluster is on Azure, thus I've open in the network the ports 25, 465, 587.

 

Does anyone know how to properly configure smtp for Oozie? Do I need SSL/TLS enabled (actually is disabled)? In that case, can I use a self-signed certificate or do I need a certificate from a CA?

 

Thanks for any info!

 

 

 

Posts: 589
Topics: 1
Kudos: 140
Solutions: 74
Registered: ‎04-22-2014

Re: SMTP configuration for Oozie

@ludof,

 

The exception in the stack shows:

 

Caused by: java.net.SocketTimeoutException: connect timed out
	at java.net.PlainSocketImpl.socketConnect(Native Method)

That indicates that a timeout occurred while trying to establish a connection with the server/port combination you specified.  I recommend trying to use "telnet" command to connec to the SMTP server host or port (from the Oozie host) or use tcpdump to help identify the problem.

 

The problem most likely lies between your Oozie host and the mail server.  Could be a firewall or some other reason the host you specified is unreachable from that location. 

 

Here is one page that explains how to use telnet against exchnage servers to test SMTP:

https://technet.microsoft.com/en-us/library/bb123686(v=exchg.160).aspx

Announcements