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

NPE from EmailExtTemplateActionFactory.createFor due to MavenModuleSet.getPublishersList being null

    XMLWordPrintable

Details

    Description

      Just updated some plugins and found some Maven projects not loading due to

      java.lang.NullPointerException
      	at hudson.plugins.emailext.EmailExtTemplateActionFactory.createFor(EmailExtTemplateActionFactory.java:27)
      	at hudson.model.AbstractProject.createTransientActions(AbstractProject.java:761)
      	at hudson.maven.AbstractMavenProject.createTransientActions(AbstractMavenProject.java:179)
      	at hudson.maven.MavenModuleSet.createTransientActions(MavenModuleSet.java:465)
      	at hudson.model.AbstractProject.updateTransientActions(AbstractProject.java:751)
      	at hudson.maven.MavenModuleSet.updateTransientActions(MavenModuleSet.java:461)
      	at hudson.model.AbstractProject.onLoad(AbstractProject.java:338)
      	at hudson.maven.MavenModuleSet.onLoad(MavenModuleSet.java:791)
      

      Seems like https://github.com/jenkinsci/email-ext-plugin/commit/6f5dd8ff0f6e665f33e909bc3ac4d75bb2a38fc8 is newly asking for getPublishersList, and in MavenModuleSet.createTransientActions this might temporarily be null, as a comment warns—after the place where this NPE is being thrown.

      It is just not allowed to return null from this method. The implementation in Project in core gets around this (JENKINS-18589) using an atomic field updater.

      A temporary workaround in Email Ext would be to check for null here.

      Attachments

        Issue Links

          Activity

            jglick Jesse Glick added a comment - - edited

            Temporarily reverting to 2.38.1, which avoids the issue until we can get a proper fix in maven-plugin.

            jglick Jesse Glick added a comment - - edited Temporarily reverting to 2.38.1, which avoids the issue until we can get a proper fix in maven-plugin .
            slide_o_mix Alex Earl added a comment -

            I can probably cut a 2.39.1 later tonight with a work around.

            slide_o_mix Alex Earl added a comment - I can probably cut a 2.39.1 later tonight with a work around.
            jglick Jesse Glick added a comment -

            Thanks, that would save some headaches.

            jglick Jesse Glick added a comment - Thanks, that would save some headaches.
            jglick Jesse Glick added a comment -

            JENKINS-22811 means the whole folder can be broken by this currently.

            jglick Jesse Glick added a comment - JENKINS-22811 means the whole folder can be broken by this currently.
            slide_o_mix Alex Earl added a comment -

            2.39.2 is released

            slide_o_mix Alex Earl added a comment - 2.39.2 is released
            jglick Jesse Glick added a comment -

            Thanks, that makes this less urgent.

            jglick Jesse Glick added a comment - Thanks, that makes this less urgent.

            Code changed in jenkins
            User: Alex Earl
            Path:
            pom.xml
            src/main/java/hudson/plugins/emailext/EmailExtTemplateActionFactory.java
            http://jenkins-ci.org/commit/email-ext-plugin/f56bf85320cc1b2f6089b117efc70b595a115593
            Log:
            Workaround for JENKINS-25940

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Alex Earl Path: pom.xml src/main/java/hudson/plugins/emailext/EmailExtTemplateActionFactory.java http://jenkins-ci.org/commit/email-ext-plugin/f56bf85320cc1b2f6089b117efc70b595a115593 Log: Workaround for JENKINS-25940
            slide_o_mix Alex Earl added a comment -

            Is this still an issue?

            slide_o_mix Alex Earl added a comment - Is this still an issue?
            danielbeck Daniel Beck added a comment -

            slide_o_mix It is. The fix is only in 2.39.2 and 2.39.3, and an instance with 2.40.5 (jenkins.ci.cloudbees.com) currently fails to load a bunch of Maven jobs.

            danielbeck Daniel Beck added a comment - slide_o_mix It is. The fix is only in 2.39.2 and 2.39.3, and an instance with 2.40.5 (jenkins.ci.cloudbees.com) currently fails to load a bunch of Maven jobs.

            Code changed in jenkins
            User: Daniel Beck
            Path:
            src/main/java/hudson/plugins/emailext/EmailExtTemplateActionFactory.java
            http://jenkins-ci.org/commit/email-ext-plugin/512a8fc4e217bf5919590ce067cdc10309103594
            Log:
            JENKINS-25940 Add workaround to prevent NPE in Maven projects

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: src/main/java/hudson/plugins/emailext/EmailExtTemplateActionFactory.java http://jenkins-ci.org/commit/email-ext-plugin/512a8fc4e217bf5919590ce067cdc10309103594 Log: JENKINS-25940 Add workaround to prevent NPE in Maven projects

            Code changed in jenkins
            User: Alex Earl
            Path:
            src/main/java/hudson/plugins/emailext/EmailExtTemplateActionFactory.java
            http://jenkins-ci.org/commit/email-ext-plugin/fa8e9e27e6d76f1bb7a57dcb26044d3c7f8ece8c
            Log:
            Merge pull request #106 from daniel-beck/JENKINS-25940

            JENKINS-25940 Add workaround to prevent NPE in Maven projects

            Compare: https://github.com/jenkinsci/email-ext-plugin/compare/08345482dd6f...fa8e9e27e6d7

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Alex Earl Path: src/main/java/hudson/plugins/emailext/EmailExtTemplateActionFactory.java http://jenkins-ci.org/commit/email-ext-plugin/fa8e9e27e6d76f1bb7a57dcb26044d3c7f8ece8c Log: Merge pull request #106 from daniel-beck/ JENKINS-25940 JENKINS-25940 Add workaround to prevent NPE in Maven projects Compare: https://github.com/jenkinsci/email-ext-plugin/compare/08345482dd6f...fa8e9e27e6d7

            People

              Unassigned Unassigned
              jglick Jesse Glick
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: