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

Email-ext throws NullPointerException when "attach build log" is checked on 1.480.3

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • email-ext-plugin
    • OS Windows_NT
      PROCESSOR_ARCHITECTURE x86
      PROCESSOR_ARCHITEW6432 AMD64

      java.runtime.version 1.6.0_26-b03
      Jenkins war org.jenkins-ci.main:jenkins-war:1.480.3

      List of plugins used in project:

      multiple-scms
      mercurial
      subversion
      nant
      sonar
      flexible-publish
      email-ext

      I perform a fairly simple build, use the flexible-plugin to only archive on success and then send an email. Without "attach build log" checked everything works, with it checked I get the following error:

      Run condition [Current build status] enabling perform for step [Archive the artifacts]
      Archiving artifacts
      Checking for post-build
      Performing post-build step
      Checking if email needs to be generated
      Email was triggered for: Success
      Sending email for trigger: Success
      NOT overriding default server settings, using Mailer to create session
      messageContentType = text/plain; charset=UTF-8
      Request made to attach build log
      Adding recipients from recipient list
      Successfully created MimeMessage
      Sending email to: MY.USERNAME@MYPLACEOFEMPLOYMENT.com
      ERROR: Could not send email as a part of the post-build publishers.
      java.lang.NullPointerException
      at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:311)
      at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:289)
      at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:249)
      at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:718)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:693)
      at hudson.model.Build$BuildExecution.cleanUp(Build.java:192)
      at hudson.model.Run.execute(Run.java:1546)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:237)
      Some error occured trying to send the email...check the Jenkins log

        1. zip-build-before-attach.diff
          11 kB
          Mark Orchard
        2. email-ext.hpi
          4.99 MB
          Alex Earl
        3. email-ext.hpi
          4.99 MB
          Alex Earl

          [JENKINS-16919] Email-ext throws NullPointerException when "attach build log" is checked on 1.480.3

          Mark Orchard created issue -

          Alex Earl added a comment -

          What version of email-ext?

          Alex Earl added a comment - What version of email-ext?

          Mark Orchard added a comment -

          Oh, Sorry! It's email-ext ver. 2.25

          Mark Orchard added a comment - Oh, Sorry! It's email-ext ver. 2.25

          Alex Earl added a comment -

          Hmmm, interesting. This means it failed sending for some reason, but some of the getters on SendFailedException are returning null.

          Alex Earl added a comment - Hmmm, interesting. This means it failed sending for some reason, but some of the getters on SendFailedException are returning null.

          Mark Orchard added a comment -

          Yeah, I briefly tried looking at the plugin code yesterday, but it didn't look like a simple 10 second fix so I resolved to put in a ticket instead. I just tried eliminating the flexible publish plug-in (in case there was some kind of interference, but that didn't change anything).

          I've enabled the "Debug Mode" for the email-ext plugin in the Jenkins management screen, let me know if there is anything else I can do to provide some more useful logging.

          Mark Orchard added a comment - Yeah, I briefly tried looking at the plugin code yesterday, but it didn't look like a simple 10 second fix so I resolved to put in a ticket instead. I just tried eliminating the flexible publish plug-in (in case there was some kind of interference, but that didn't change anything). I've enabled the "Debug Mode" for the email-ext plugin in the Jenkins management screen, let me know if there is anything else I can do to provide some more useful logging.

          Alex Earl added a comment -

          Can you try with this snapshot build?

          Alex Earl added a comment - Can you try with this snapshot build?
          Alex Earl made changes -
          Attachment New: email-ext.hpi [ 23213 ]

          Mark Orchard added a comment -

          I just tried disabling the "attach build log" option again and instead added the $BUILD_LOG to the body of my email, the message sent fine and the 250 lines of build log appear as expected. Hopefully some of this info will be useful!

          Mark Orchard added a comment - I just tried disabling the "attach build log" option again and instead added the $BUILD_LOG to the body of my email, the message sent fine and the 250 lines of build log appear as expected. Hopefully some of this info will be useful!

          Mark Orchard added a comment -

          Sorry, I just saw your comment regarding the snapshot build. I've installed the snapshot and am running the build again. I'll update you in about an hour when the build completes.

          Mark Orchard added a comment - Sorry, I just saw your comment regarding the snapshot build. I've installed the snapshot and am running the build again. I'll update you in about an hour when the build completes.

          Alex Earl added a comment -

          Can you also try turning in javamail's debug mode? You have to do it via jvm options.

          Alex Earl added a comment - Can you also try turning in javamail's debug mode? You have to do it via jvm options.

            slide_o_mix Alex Earl
            morchard Mark Orchard
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: