Originally posted to: https://groups.google.com/forum/#!topic/jenkinsci-users/hrMipbtLjxs

      Hi there,

      We are getting this NPE intermittently at the end of successful maven builds. We are using Jenkins 509.4 LTS and Maven plugin 509.4.

      Any ideas on what the issue might be or how I can squeeze more info out of the logs?

      Thanks,
      Dan

      INFO: ------------------------------------------------------------------------
      Jan 26, 2014 12:42:30 PM org.apache.maven.cli.event.ExecutionEventLogger logReactorSummary
      INFO: Reactor Summary:
      Jan 26, 2014 12:42:30 PM org.apache.maven.cli.event.ExecutionEventLogger logReactorSummary
      INFO: 
      Jan 26, 2014 12:42:30 PM org.apache.maven.cli.event.ExecutionEventLogger logReactorSummary
      INFO: metrix-service-main ............................... SUCCESS [8.813s]
      Jan 26, 2014 12:42:30 PM org.apache.maven.cli.event.ExecutionEventLogger logReactorSummary
      INFO: metrix-service-core ............................... SUCCESS [3:14.939s]
      Jan 26, 2014 12:42:30 PM org.apache.maven.cli.event.ExecutionEventLogger logReactorSummary
      INFO: metrix-service-dist ............................... SUCCESS [10.969s]
      Jan 26, 2014 12:42:30 PM org.apache.maven.cli.event.ExecutionEventLogger logResult
      INFO: ------------------------------------------------------------------------
      Jan 26, 2014 12:42:30 PM org.apache.maven.cli.event.ExecutionEventLogger logResult
      INFO: BUILD SUCCESS
      Jan 26, 2014 12:42:30 PM org.apache.maven.cli.event.ExecutionEventLogger logStats
      INFO: ------------------------------------------------------------------------
      Jan 26, 2014 12:42:30 PM org.apache.maven.cli.event.ExecutionEventLogger logStats
      INFO: Total time: 3:40.847s
      Jan 26, 2014 12:42:30 PM org.apache.maven.cli.event.ExecutionEventLogger logStats
      INFO: Finished at: Sun Jan 26 12:42:30 PST 2014
      Jan 26, 2014 12:42:30 PM org.apache.maven.cli.event.ExecutionEventLogger logStats
      INFO: Final Memory: 31M/686M
      Jan 26, 2014 12:42:30 PM org.apache.maven.cli.event.ExecutionEventLogger sessionEnded
      INFO: ------------------------------------------------------------------------
      [JENKINS] Archiving /jenkins/workspace/metrix-service-main/metrix-service/metrix-service-main/metrix-service-dist/pom.xml to /jenkins/jobs/metrix-service-main/modules/com.vi$metrix-service-dist/builds/2014-01-26_12-38-41/archive/com.vi/metrix-service-dist/1.1-SNAPSHOT/metrix-service-dist-1.1-SNAPSHOT.pom
      [JENKINS] Archiving /jenkins/workspace/metrix-service-main/metrix-service/metrix-service-main/metrix-service-core/pom.xml to /jenkins/jobs/metrix-service-main/modules/com.vi$metrix-service-core/builds/2014-01-26_12-38-41/archive/com.vi/metrix-service-core/1.1-SNAPSHOT/metrix-service-core-1.1-SNAPSHOT.pom
      [JENKINS] Archiving /jenkins/workspace/metrix-service-main/metrix-service/metrix-service-main/metrix-service-core/target/metrix-service-core-1.1-SNAPSHOT.jar to /jenkins/jobs/metrix-service-main/modules/com.vi$metrix-service-core/builds/2014-01-26_12-38-41/archive/com.vi/metrix-service-core/1.1-SNAPSHOT/metrix-service-core-1.1-SNAPSHOT.jar
      [JENKINS] Archiving /jenkins/workspace/metrix-service-main/metrix-service/metrix-service-main/pom.xml to /jenkins/jobs/metrix-service-main/modules/com.vi$metrix-service-main/builds/2014-01-26_12-38-41/archive/com.vi/metrix-service-main/1.1-SNAPSHOT/metrix-service-main-1.1-SNAPSHOT.pom
      Waiting for Jenkins to finish collecting data
      ERROR: Processing failed due to a bug in the code. Please report this to jenkinsci-users@googlegroups.com
      java.lang.NullPointerException
      project=hudson.maven.MavenModuleSet@4b632226[metrix-service-main]
      project.getModules()=[hudson.maven.MavenModule@20460e4f[metrix-service-main/com.vi:metrix-service-core][metrix-service-main/com.vi:metrix-service-core][relativePath:metrix-service/metrix-service-main/metrix-service-core], hudson.maven.MavenModule@57557516[metrix-service-main/com.vi:metrix-service-dist][metrix-service-main/com.vi:metrix-service-dist][relativePath:metrix-service/metrix-service-main/metrix-service-dist], hudson.maven.MavenModule@2b7a2425[metrix-service-main/com.vi:metrix-service-main][metrix-service-main/com.vi:metrix-service-main][relativePath:metrix-service/metrix-service-main]]
      project.getRootModule()=hudson.maven.MavenModule@2b7a2425[metrix-service-main/com.vi:metrix-service-main][metrix-service-main/com.vi:metrix-service-main][relativePath:metrix-service/metrix-service-main]
      FATAL: null
      java.lang.NullPointerException
      

          [JENKINS-21554] NPE if "MavenMailer/recipients" is undefined

          Some more info:

          This seems to be happening on Maven job type builds when the build state goes from Green (all unit tests pass) to Yellow (1 or more unit tests fail). As long as tests are passing we have not seen this issue. As soon as test fail or start to "flap", the job gets into this weird state where builds fail with the NPE.

          We're considering moving away from the Maven job type after reading: http://javaadventure.blogspot.ie/2013/11/jenkins-maven-job-type-considered-evil.html

          Daniel Tehranian added a comment - Some more info: This seems to be happening on Maven job type builds when the build state goes from Green (all unit tests pass) to Yellow (1 or more unit tests fail). As long as tests are passing we have not seen this issue. As soon as test fail or start to "flap", the job gets into this weird state where builds fail with the NPE. We're considering moving away from the Maven job type after reading: http://javaadventure.blogspot.ie/2013/11/jenkins-maven-job-type-considered-evil.html

          jsyrjala added a comment -

          I seem to have same kind of failure with 1.509.4. See discussion https://groups.google.com/forum/#!topic/jenkinsci-users/aF9OFh1WLGg
          I have not yet taken a look if failing unit tests cause this.

          jsyrjala added a comment - I seem to have same kind of failure with 1.509.4. See discussion https://groups.google.com/forum/#!topic/jenkinsci-users/aF9OFh1WLGg I have not yet taken a look if failing unit tests cause this.

          One workaround we found was to manually go and wipe out the workspace in the Jenkins UI. Unfortunately wiping out the workspace as part of the job does not seem to have the same work-around effect.

          Daniel Tehranian added a comment - One workaround we found was to manually go and wipe out the workspace in the Jenkins UI. Unfortunately wiping out the workspace as part of the job does not seem to have the same work-around effect.

          My case also seems to be often but not allways triggered when tests fail.
          Cleaning workspace fixes problem, but still the end of the console log shows nullpointerexception:

          Waiting for Jenkins to finish collecting data
          channel stopped
          [my-app] $ /bin/sh -xe /tmp/hudson4500268711121840097.sh
          + echo 305
          + echo 107213
          Archiving artifacts
          FATAL: null
          java.lang.NullPointerException

          Juha Syrjälä added a comment - My case also seems to be often but not allways triggered when tests fail. Cleaning workspace fixes problem, but still the end of the console log shows nullpointerexception: Waiting for Jenkins to finish collecting data channel stopped [my-app] $ /bin/sh -xe /tmp/hudson4500268711121840097.sh + echo 305 + echo 107213 Archiving artifacts FATAL: null java.lang.NullPointerException

          The bug strikes also with Jenkins 1.532.2

          Juha Syrjälä added a comment - The bug strikes also with Jenkins 1.532.2

          Hi Juha, You're not using the DSL plugin to generate your jobs as well are you?

          Dan

          Daniel Tehranian added a comment - Hi Juha, You're not using the DSL plugin to generate your jobs as well are you? Dan

          ping - Juha? Are you using DSL to generate your jobs?

          Daniel Tehranian added a comment - ping - Juha? Are you using DSL to generate your jobs?

          We figured it out.

          We'd been generating our job configs via the DSL plugin and our "hudson.maven.reporters.MavenMailer" section was missing an XML element for "recipients". By adding in this missing XML element (with no value) we no longer get the NPE.

          Leaving this bug open and updating the summary. Jenkins should handle this better if "recipients" is not defined.

          Daniel Tehranian added a comment - We figured it out. We'd been generating our job configs via the DSL plugin and our "hudson.maven.reporters.MavenMailer" section was missing an XML element for "recipients". By adding in this missing XML element (with no value) we no longer get the NPE. Leaving this bug open and updating the summary. Jenkins should handle this better if "recipients" is not defined.

          jsyrjala added a comment -

          Sorry for delay. We are not using any DSL. Jobs have been configured manually via UI and then copied to create new jobs. I'll check the our xml config next week.

          jsyrjala added a comment - Sorry for delay. We are not using any DSL. Jobs have been configured manually via UI and then copied to create new jobs. I'll check the our xml config next week.

          Juha Syrjälä added a comment - - edited

          We are also missing "recipients" element from "hudson.maven.reporters.MavenMailer".

          It also seems that you can't add recipients value via UI. When adding value to E-mail notification -> Recipients, the value will be blank after saving the configuration.

          We are currently using Maven Project Plugin 2.0 (and Mailer plugin 1.6).

          Juha Syrjälä added a comment - - edited We are also missing "recipients" element from "hudson.maven.reporters.MavenMailer". It also seems that you can't add recipients value via UI. When adding value to E-mail notification -> Recipients, the value will be blank after saving the configuration. We are currently using Maven Project Plugin 2.0 (and Mailer plugin 1.6).

            Unassigned Unassigned
            tehranian Daniel Tehranian
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: