javax.mail.MessagingException: Could not connect to SMTP host: smtp.office365.com, port: 567; nested exception is: java.net.SocketTimeoutException: connect timed out

Jenkins JIRA | sumit chudasama | 3 years ago
  1. 0

    Email was triggered for: Success Sending email for trigger: Success Sending email to: sumit@just.com ERROR: Could not send email as a part of the post-build publishers. javax.mail.MessagingException: Could not connect to SMTP host: smtp.office365.com, port: 567; nested exception is: java.net.SocketTimeoutException: connect timed out at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1934) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638) at javax.mail.Service.connect(Service.java:317) at javax.mail.Service.connect(Service.java:176) at javax.mail.Service.connect(Service.java:125) at javax.mail.Transport.send0(Transport.java:194) at javax.mail.Transport.send(Transport.java:124) at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:305) at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:283) at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:235) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:784) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:756) at hudson.model.Build$BuildExecution.cleanUp(Build.java:192) at hudson.model.Run.execute(Run.java:1715) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:231) 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:286) at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:231) at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1900) ... 17 more Finished: SUCCESS

    Jenkins JIRA | 3 years ago | sumit chudasama
    javax.mail.MessagingException: Could not connect to SMTP host: smtp.office365.com, port: 567; nested exception is: java.net.SocketTimeoutException: connect timed out
  2. 0

    Hi, Office 365 servers are notorious for their slow responses. Recently I get a lot of these: {quote} ERROR: Could not connect to SMTP host: podxxxxx.outlook.com, port: 587 javax.mail.MessagingException: Could not connect to SMTP host: podxxxxx.outlook.com, port: 587; nested exception is: java.net.SocketTimeoutException: connect timed out at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1934) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638) at javax.mail.Service.connect(Service.java:317) at javax.mail.Service.connect(Service.java:176) at javax.mail.Service.connect(Service.java:125) at javax.mail.Transport.send0(Transport.java:194) at javax.mail.Transport.send(Transport.java:124) at hudson.tasks.MailSender.execute(MailSender.java:117) at hudson.tasks.Mailer.perform(Mailer.java:137) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:725) at hudson.model.Run.execute(Run.java:1709) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:231) 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:286) at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:231) at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1900) ... 17 more Finished: FAILURE {quote} So now I'd like to increase the SMTP timeout value but apparently that's not possible as of now. Another ugly problem is that Office 365 uses STARTTLS *without* SMTPS so to make mailer work I gotta hack on {{/etc/default/jenkins}} and add {{-Dmail.smtp.starttls.enable=true}} to {{JAVA_ARGS}} otherwise it won't work. (Hmm, come to think of it, timeout _might_ also be set this way, too...) So all I ask for is to expose the {{mail.smtp.connectiontimeout}}, {{mail.smtp.timeout}} and {{mail.smtp.starttls.enable}} properties under settings instead of always using the Java defaults. Thanks in advance! Viktor

    Jenkins JIRA | 2 years ago | Viktor Berke
    javax.mail.MessagingException: Could not connect to SMTP host: podxxxxx.outlook.com, port: 587; nested exception is: java.net.SocketTimeoutException: connect timed out
  3. 0

    HazelCast with Mule

    Google Groups | 2 years ago | yadav...@gmail.com
    java.lang.IllegalStateException: Unable to connect to any address in the config!
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Version check error

    GitHub | 3 years ago | dennusb
    org.apache.http.conn.ConnectTimeoutException: Connect to versioncheck.torch.sh:80 [versioncheck.torch.sh/54.195.251.6] failed: connect timed out
  6. 0

    Pex timed out but my port 80 is open

    GitHub | 2 years ago | AwaaX
    java.net.SocketTimeoutException: connect timed out

  1. Aria Pahlavan 1 times, last 2 weeks ago
  2. Nikolay Rybak 1 times, last 2 weeks ago
  3. aldrinleal 1 times, last 2 weeks ago
  4. tvrmsmith 2 times, last 3 weeks ago
  5. VeryRedChris 1 times, last 3 weeks ago
13 more registered users
31 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.net.SocketTimeoutException

    connect timed out

    at java.net.PlainSocketImpl.socketConnect()
  2. Java RT
    Socket.connect
    1. java.net.PlainSocketImpl.socketConnect(Native Method)
    2. java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
    3. java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    4. java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    5. java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    6. java.net.Socket.connect(Socket.java:579)
    6 frames
  3. JavaMail API (compat)
    SMTPTransport.protocolConnect
    1. com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:286)
    2. com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:231)
    3. com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1900)
    4. com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)
    4 frames
  4. JavaMail API
    Transport.send
    1. javax.mail.Service.connect(Service.java:317)
    2. javax.mail.Service.connect(Service.java:176)
    3. javax.mail.Service.connect(Service.java:125)
    4. javax.mail.Transport.send0(Transport.java:194)
    5. javax.mail.Transport.send(Transport.java:124)
    5 frames
  5. Hudson Email Extension Plugin
    ExtendedEmailPublisher.perform
    1. hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:305)
    2. hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:283)
    3. hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:235)
    3 frames
  6. Hudson
    Executor.run
    1. hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    2. hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:784)
    3. hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:756)
    4. hudson.model.Build$BuildExecution.cleanUp(Build.java:192)
    5. hudson.model.Run.execute(Run.java:1715)
    6. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    7. hudson.model.ResourceController.execute(ResourceController.java:88)
    8. hudson.model.Executor.run(Executor.java:231)
    8 frames