Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-16237

Extended email plugin no longer sends messages on latest

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • email-ext-plugin
    • Jenkins 1.495 and 1.496 (at least)
      CentOS 6.3, Tomcat 6, JavaMail 1.4.4-1.4.6-rc1
      Token Macro 1.5.1

      The email-ext plugin no longer sends messages, instead it hangs after sending DATA:

      10:47:33 Checking for post-build
      10:47:33 Performing post-build step
      10:47:33 Checking if email needs to be generated
      10:47:33 Email was triggered for: Success
      10:47:33 Sending email for trigger: Success
      10:47:33 NOT overriding default server settings, using Mailer to create session
      10:47:33 Changing BUILD_ID variable (job build time) with the date pattern yyyyMMdd.
      10:47:33 Changing BUILD_ID variable (job build time) with the date pattern yyyyMMdd.
      10:47:33 messageContentType = text/plain; charset=UTF-8
      10:47:33 Changing BUILD_ID variable (job build time) with the date pattern yyyyMMdd.
      10:47:33 Adding developers
      10:47:33 Sending to requester
      10:47:33 Changing BUILD_ID variable (job build time) with the date pattern yyyyMMdd.
      10:47:33 Successfully created MimeMessage
      10:47:33 Sending email to: Jamie.Penman-Smithson@example.com
      10:48:34 ERROR: Could not send email as a part of the post-build publishers.
      10:48:34 javax.mail.MessagingException: Exception reading response;
      10:48:34 nested exception is:
      10:48:34 java.net.SocketTimeoutException: Read timed out
      10:48:34 at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:2153)
      10:48:34 at com.sun.mail.smtp.SMTPTransport.close(SMTPTransport.java:1186)
      10:48:34 at javax.mail.Transport.send0(Transport.java:197)
      10:48:34 at javax.mail.Transport.send(Transport.java:124)
      10:48:34 at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:308)
      10:48:34 at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:289)
      10:48:34 at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:249)
      10:48:34 at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
      10:48:34 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
      10:48:34 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:779)
      10:48:34 at hudson.ivy.IvyModuleSetBuild$RunnerImpl.cleanUp(IvyModuleSetBuild.java:606)
      10:48:34 at hudson.model.Run.execute(Run.java:1587)
      10:48:34 at hudson.model.Run.run(Run.java:1489)
      10:48:34 at hudson.ivy.IvyModuleSetBuild.run(IvyModuleSetBuild.java:282)
      10:48:34 at hudson.model.ResourceController.execute(ResourceController.java:88)
      10:48:34 at hudson.model.Executor.run(Executor.java:236)
      10:48:34 Caused by: java.net.SocketTimeoutException: Read timed out
      10:48:34 at java.net.SocketInputStream.socketRead0(Native Method)
      10:48:34 at java.net.SocketInputStream.read(SocketInputStream.java:129)
      10:48:34 at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:110)
      10:48:34 at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
      10:48:34 at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
      10:48:34 at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:89)
      10:48:34 at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:2131)
      10:48:34 ... 15 more
      10:48:34 Some error occured trying to send the email...check the Jenkins log
      10:48:34 Finished: SUCCESS

      Looking at the Postfix log in debug mode, I can see that it sends MAIL FROM and RCPT TO correctly, but after it sends DATA it does not send anything else. Eventually the connection times out and the exception above is reported in the log.

      The standard email functionality continues to work as normal.

      From postfix it only shows that it received 'DATA' but nothing more:

      Jan 2 12:07:59 ukfd-ecat postfix/smtpd[32091]: > ukfd-ecat[192.168.117.125]: 220 ukfd-ecat.eu.example.com ESMTP Postfix
      Jan 2 12:07:59 ukfd-ecat postfix/smtpd[32091]: < ukfd-ecat[192.168.117.125]: EHLO ukfd-ecat
      Jan 2 12:07:59 ukfd-ecat postfix/smtpd[32091]: > ukfd-ecat[192.168.117.125]: 250-ukfd-ecat.eu.example.com
      Jan 2 12:07:59 ukfd-ecat postfix/smtpd[32091]: > ukfd-ecat[192.168.117.125]: 250-PIPELINING
      Jan 2 12:07:59 ukfd-ecat postfix/smtpd[32091]: > ukfd-ecat[192.168.117.125]: 250-SIZE 10240000
      Jan 2 12:07:59 ukfd-ecat postfix/smtpd[32091]: > ukfd-ecat[192.168.117.125]: 250-VRFY
      Jan 2 12:07:59 ukfd-ecat postfix/smtpd[32091]: > ukfd-ecat[192.168.117.125]: 250-ETRN
      Jan 2 12:07:59 ukfd-ecat postfix/smtpd[32091]: > ukfd-ecat[192.168.117.125]: 250-ENHANCEDSTATUSCODES
      Jan 2 12:07:59 ukfd-ecat postfix/smtpd[32091]: > ukfd-ecat[192.168.117.125]: 250-8BITMIME
      Jan 2 12:07:59 ukfd-ecat postfix/smtpd[32091]: > ukfd-ecat[192.168.117.125]: 250 DSN
      Jan 2 12:07:59 ukfd-ecat postfix/smtpd[32091]: < ukfd-ecat[192.168.117.125]: MAIL FROM:<eubuild@example.com>
      Jan 2 12:07:59 ukfd-ecat postfix/smtpd[32091]: > ukfd-ecat[192.168.117.125]: 250 2.1.0 Ok
      Jan 2 12:07:59 ukfd-ecat postfix/smtpd[32091]: < ukfd-ecat[192.168.117.125]: RCPT TO:<Jamie.Penman-Smithson@example.com>
      Jan 2 12:07:59 ukfd-ecat postfix/smtpd[32091]: > ukfd-ecat[192.168.117.125]: 250 2.1.5 Ok
      Jan 2 12:07:59 ukfd-ecat postfix/smtpd[32091]: < ukfd-ecat[192.168.117.125]: DATA
      Jan 2 12:07:59 ukfd-ecat postfix/smtpd[32091]: > ukfd-ecat[192.168.117.125]: 354 End data with <CR><LF>.<CR><LF>

      I've added -Dmail.debug=true to the JVM options and I've also enabled debug mode for email-ext, but I can't seem to get any further information.

      Is there anything else I can do to help diagnose what's going wrong?

      Thanks very much,
      Jamie

          [JENKINS-16237] Extended email plugin no longer sends messages on latest

          Alex Earl added a comment -

          I'm concerned about the difference in the boundary info shown on the working and failing case. I'm not sure how the plugin would cause an issue there since this is just the JavaMail at this point.

          Alex Earl added a comment - I'm concerned about the difference in the boundary info shown on the working and failing case. I'm not sure how the plugin would cause an issue there since this is just the JavaMail at this point.

          I've tried this on the LTS on Tomcat and it fails again - with just the default plugins and extended email enabled.

          I think this is one of those strange classpath problems in Tomcat, I started up Winstone, using the same JENKINS_HOME, re-built the job and the email was sent correctly.

          I'm not sure how to fix it within Tomcat though...

          Jamie Penman-Smithson added a comment - I've tried this on the LTS on Tomcat and it fails again - with just the default plugins and extended email enabled. I think this is one of those strange classpath problems in Tomcat, I started up Winstone, using the same JENKINS_HOME, re-built the job and the email was sent correctly. I'm not sure how to fix it within Tomcat though...

          Alex Earl added a comment -

          I'll try under Tomcat and see if I can find anything.

          Alex Earl added a comment - I'll try under Tomcat and see if I can find anything.

          To test this I ran the exact same Jenkins installation under Winstone - it works perfectly, so I definitely think this is related to Tomcat.

          Jamie Penman-Smithson added a comment - To test this I ran the exact same Jenkins installation under Winstone - it works perfectly, so I definitely think this is related to Tomcat.

          Alex Earl added a comment -

          I'm still not able to replicate this even under Tomcat. The emails get sent just fine for me. Can you send me the test config you used?

          Alex Earl added a comment - I'm still not able to replicate this even under Tomcat. The emails get sent just fine for me. Can you send me the test config you used?

          Alex Earl added a comment -

          Do you have the security manager enabled in Tomcat?

          Alex Earl added a comment - Do you have the security manager enabled in Tomcat?

          Alex Earl added a comment -

          Can you try setting the following property and see if the email goes out? mail.smtp.quitwait=false

          Alex Earl added a comment - Can you try setting the following property and see if the email goes out? mail.smtp.quitwait=false

          I finally figured out the problem, there were some EclipseLink JARs in $TOMCAT_HOME/lib which were apparently causing this. As soon as I removed them JavaMail worked correctly.

          Would it be possible to add something about that to the Ext-Email wiki page, just in case someone else has this issue?

          Many thanks for all of your help!
          Jamie

          Jamie Penman-Smithson added a comment - I finally figured out the problem, there were some EclipseLink JARs in $TOMCAT_HOME/lib which were apparently causing this. As soon as I removed them JavaMail worked correctly. Would it be possible to add something about that to the Ext-Email wiki page, just in case someone else has this issue? Many thanks for all of your help! Jamie

          Alex Earl added a comment -

          Feel free to add something to the wiki page, you should be able to add content.

          Alex Earl added a comment - Feel free to add something to the wiki page, you should be able to add content.

          Alex Earl added a comment -

          Reporter had some jars that were causing issues.

          Alex Earl added a comment - Reporter had some jars that were causing issues.

            slide_o_mix Alex Earl
            jamiep Jamie Penman-Smithson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: