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

Naginator plugin throwing Null Pointer Exception

    Details

    • Similar Issues:

      Description

      Jobs which are not configured with Naginator are also failed because of the below error.

      FATAL: null
      java.lang.NullPointerException
      at com.chikli.hudson.plugin.naginator.NaginatorListener.setUpEnvironment(NaginatorListener.java:94)
      at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:587)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:491)
      at hudson.model.Run.execute(Run.java:1759)
      at hudson.maven.MavenBuild.run(MavenBuild.java:269)
      at hudson.model.ResourceController.execute(ResourceController.java:89)
      at hudson.model.Executor.run(Executor.java:240)

      Also Choice Parameter is not working after installing Naginator plugin.

        Attachments

          Activity

          aarige Anil Arige created issue -
          Hide
          ikedam ikedam added a comment -

          Please report more details.

          • versions of Jenkins and plugins (naginator, maven).
          • How you configured the project (it looks a maven project).
          • Is your Jenkuns secured (requires login)
          • How you triggered the build.

          And more about "choice parameter is not working". You may attach screenshots.

          Show
          ikedam ikedam added a comment - Please report more details. versions of Jenkins and plugins (naginator, maven). How you configured the project (it looks a maven project). Is your Jenkuns secured (requires login) How you triggered the build. And more about "choice parameter is not working". You may attach screenshots.
          ikedam ikedam made changes -
          Field Original Value New Value
          Assignee Nicolas De Loof [ ndeloof ] ikedam [ ikedam ]
          Hide
          aarige Anil Arige added a comment -

          Jenkins version - JIRA v6.3.10
          It looks a maven project
          My jenkins requires login .
          As other jobs which are not even configured with Retry after failure are not working, we have uninstalled naginator plugin as of now.

          Show
          aarige Anil Arige added a comment - Jenkins version - JIRA v6.3.10 It looks a maven project My jenkins requires login . As other jobs which are not even configured with Retry after failure are not working, we have uninstalled naginator plugin as of now.
          Hide
          ikedam ikedam added a comment -

          Reproduced.

          1. Install Jenkins 1.651.1
            • Bundles maven-plugin 2.7.1
          2. Install following plugins
            • Naginator (1.17)
            • Git (2.4.4)
          3. Setup a maven in Manage Jenkins > Configure System.
            • I used maven-3.1.1.
          4. Create a maven project "maventest"
          5. Run a build.
            • It fails and is retriggered twice. (This is a correct behavior)
          6. Go to maventest > Modules > dependee, and click "Build Now".
          7. The build fails with the following log.
            FATAL: null
            java.lang.NullPointerException
            	at com.chikli.hudson.plugin.naginator.NaginatorListener.setUpEnvironment(NaginatorListener.java:94)
            	at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:572)
            	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:492)
            	at hudson.model.Run.execute(Run.java:1738)
            	at hudson.maven.MavenBuild.run(MavenBuild.java:265)
            	at hudson.model.ResourceController.execute(ResourceController.java:98)
            	at hudson.model.Executor.run(Executor.java:410)
            Finished: FAILURE
            
          Show
          ikedam ikedam added a comment - Reproduced. Install Jenkins 1.651.1 Bundles maven-plugin 2.7.1 Install following plugins Naginator (1.17) Git (2.4.4) Setup a maven in Manage Jenkins > Configure System. I used maven-3.1.1. Create a maven project "maventest" Git repository: https://github.com/ikedam/dependencytest Goals: package hogehoge hogehoge is an invalid goal and causes failures. Retry build after failure Fixed delay: 1 Maximum number of ...: 2 Run a build. It fails and is retriggered twice. (This is a correct behavior) Go to maventest > Modules > dependee, and click "Build Now". The build fails with the following log. FATAL: null java.lang.NullPointerException at com.chikli.hudson.plugin.naginator.NaginatorListener.setUpEnvironment(NaginatorListener.java:94) at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:572) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:492) at hudson.model.Run.execute(Run.java:1738) at hudson.maven.MavenBuild.run(MavenBuild.java:265) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Finished: FAILURE
          Hide
          ikedam ikedam added a comment -

          The root cause looks for maven-plugin.
          AbstractBuild#getRootBuild should not return null, but MavenBuild does.
          https://github.com/jenkinsci/maven-plugin/blob/maven-plugin-2.12.1/src/main/java/hudson/maven/MavenBuild.java#L182

          I'll fix naginator-plugin even for a such behavior.

          Workarounds for now:

          A. Always trigger whole the maven project. (don't trigger only a module)
          B. Downgrade to naginator-1.16.1. You can get it from http://updates.jenkins-ci.org/download/plugins/naginator/

          Show
          ikedam ikedam added a comment - The root cause looks for maven-plugin. AbstractBuild#getRootBuild should not return null , but MavenBuild does. https://github.com/jenkinsci/maven-plugin/blob/maven-plugin-2.12.1/src/main/java/hudson/maven/MavenBuild.java#L182 I'll fix naginator-plugin even for a such behavior. Workarounds for now: A. Always trigger whole the maven project. (don't trigger only a module) B. Downgrade to naginator-1.16.1. You can get it from http://updates.jenkins-ci.org/download/plugins/naginator/
          ikedam ikedam made changes -
          Component/s maven-plugin [ 16033 ]
          ikedam ikedam made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Show
          ikedam ikedam added a comment - https://github.com/jenkinsci/naginator-plugin/pull/31
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ikedam
          Path:
          src/test/java/com/chikli/hudson/plugin/naginator/NaginatorListenerTest.java
          http://jenkins-ci.org/commit/naginator-plugin/6762fc835f6be057c1dc1582b2736778975c5aa5
          Log:
          JENKINS-34900 Added a test to reproduce JENKINS-34900. NPE when triggering single Maven module.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/test/java/com/chikli/hudson/plugin/naginator/NaginatorListenerTest.java http://jenkins-ci.org/commit/naginator-plugin/6762fc835f6be057c1dc1582b2736778975c5aa5 Log: JENKINS-34900 Added a test to reproduce JENKINS-34900 . NPE when triggering single Maven module.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/java/com/chikli/hudson/plugin/naginator/NaginatorListener.java
          http://jenkins-ci.org/commit/naginator-plugin/cbd89e56abe77230f0ad6eff43ee697b6d110925
          Log:
          [FIXED JENKINS-34900] Fix NPE when single Maven module is triggered.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/com/chikli/hudson/plugin/naginator/NaginatorListener.java http://jenkins-ci.org/commit/naginator-plugin/cbd89e56abe77230f0ad6eff43ee697b6d110925 Log: [FIXED JENKINS-34900] Fix NPE when single Maven module is triggered.
          scm_issue_link SCM/JIRA link daemon made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/java/com/chikli/hudson/plugin/naginator/NaginatorListener.java
          src/test/java/com/chikli/hudson/plugin/naginator/NaginatorListenerTest.java
          http://jenkins-ci.org/commit/naginator-plugin/ce036de06b64d734d89ed5a4cbc6d099e63be8a6
          Log:
          Merge pull request #31 from ikedam/feature/JENKINS-34900_FixNPEforMavenModule

          JENKINS-34900 Fix NPE when triggering single Maven module.

          Compare: https://github.com/jenkinsci/naginator-plugin/compare/27f461a9acbf...ce036de06b64

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/com/chikli/hudson/plugin/naginator/NaginatorListener.java src/test/java/com/chikli/hudson/plugin/naginator/NaginatorListenerTest.java http://jenkins-ci.org/commit/naginator-plugin/ce036de06b64d734d89ed5a4cbc6d099e63be8a6 Log: Merge pull request #31 from ikedam/feature/ JENKINS-34900 _FixNPEforMavenModule JENKINS-34900 Fix NPE when triggering single Maven module. Compare: https://github.com/jenkinsci/naginator-plugin/compare/27f461a9acbf...ce036de06b64
          Hide
          ikedam ikedam added a comment -

          Fixed in naginator-plugin 1.17.1.
          It will be available in the update center in a day.
          Please try that.

          Show
          ikedam ikedam added a comment - Fixed in naginator-plugin 1.17.1. It will be available in the update center in a day. Please try that.
          ikedam ikedam made changes -
          Assignee ikedam [ ikedam ] Anil Arige [ aarige ]
          Hide
          leandro_freitas_softdevelop Leandro Kersting de Freitas added a comment -

          \o/ great job. Congratulations.

          Show
          leandro_freitas_softdevelop Leandro Kersting de Freitas added a comment - \o/ great job. Congratulations.
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 171101 ] JNJira + In-Review [ 199037 ]
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/java/hudson/maven/MavenBuild.java
          src/test/java/hudson/maven/AbstractMaven3xBuildTest.java
          http://jenkins-ci.org/commit/maven-plugin/aacdd9d8b07fbf7fb7493243fa26a38dc5f601a0
          Log:
          JENKINS-34900 getRootBuild() returns itself when there's no parent. (#68)

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/maven/MavenBuild.java src/test/java/hudson/maven/AbstractMaven3xBuildTest.java http://jenkins-ci.org/commit/maven-plugin/aacdd9d8b07fbf7fb7493243fa26a38dc5f601a0 Log: JENKINS-34900 getRootBuild() returns itself when there's no parent. (#68)

            People

            • Assignee:
              aarige Anil Arige
              Reporter:
              aarige Anil Arige
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: