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

java.lang.NullPointerException com.tikal.jenkins.plugins.multijob.MultiJobBuilder.getScmChange(MultiJobBuilder.java:168)

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • multijob-plugin
    • None

      There was a null pointer exception on line 168 of com.tikal.jenkins.plugins.multijob.MultiJobBuilder. Look at the line at HEAD infers that lastbuild.getResult() is not being checked if null L168 . http://javadoc.jenkins-ci.org/hudson/model/Run.html#getResult() implies that this will return null at some stage. Please put a null check before using lastbuild.getResult().

          [JENKINS-31643] java.lang.NullPointerException com.tikal.jenkins.plugins.multijob.MultiJobBuilder.getScmChange(MultiJobBuilder.java:168)

          Luke Swithenbank created issue -
          Luke Swithenbank made changes -
          Description Original: There was a null pointer exception on line 168 of com.tikal.jenkins.plugins.multijob.MultiJobBuilder. Look at the line at HEAD infers that lastbuild.getResult() is not being checked if null. http://javadoc.jenkins-ci.org/hudson/model/Run.html#getResult() implies that this will return null at some stage. Please put a null check before using lastbuild.getResult(). New: There was a null pointer exception on line 168 of com.tikal.jenkins.plugins.multijob.MultiJobBuilder. Look at the line at HEAD infers that lastbuild.getResult() is not being checked if null [L168 |https://github.com/jenkinsci/tikal-multijob-plugin/blob/master/src/main/java/com/tikal/jenkins/plugins/multijob/MultiJobBuilder.java#L168]. http://javadoc.jenkins-ci.org/hudson/model/Run.html#getResult() implies that this will return null at some stage. Please put a null check before using lastbuild.getResult().
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 167080 ] New: JNJira + In-Review [ 182574 ]

          Jakub Bochenski added a comment - - edited

          I think I'm getting the same problem with Jenkins 2.7.1 and Multijob 1.21
          I have the "Build only if SCM changes" option enabled on the first phase job

          09:06:02 ERROR: Build step failed with exception
          09:06:02 java.lang.NullPointerException
          09:06:02 	at com.tikal.jenkins.plugins.multijob.MultiJobBuilder.getScmChange(MultiJobBuilder.java:167)
          09:06:02 	at com.tikal.jenkins.plugins.multijob.MultiJobBuilder.perform(MultiJobBuilder.java:243)
          09:06:02 	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
          09:06:02 	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
          09:06:02 	at hudson.model.Build$BuildExecution.build(Build.java:205)
          09:06:02 	at hudson.model.Build$BuildExecution.doRun(Build.java:162)
          09:06:02 	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
          09:06:02 	at com.tikal.jenkins.plugins.multijob.MultiJobBuild$MultiJobRunnerImpl.run(MultiJobBuild.java:136)
          09:06:02 	at hudson.model.Run.execute(Run.java:1741)
          09:06:02 	at com.tikal.jenkins.plugins.multijob.MultiJobBuild.run(MultiJobBuild.java:73)
          09:06:02 	at hudson.model.ResourceController.execute(ResourceController.java:98)
          09:06:02 	at hudson.model.Executor.run(Executor.java:410)

          Workaround is to manually wipe workspace

          Jakub Bochenski added a comment - - edited I think I'm getting the same problem with Jenkins 2.7.1 and Multijob 1.21 I have the "Build only if SCM changes" option enabled on the first phase job 09:06:02 ERROR: Build step failed with exception 09:06:02 java.lang.NullPointerException 09:06:02 at com.tikal.jenkins.plugins.multijob.MultiJobBuilder.getScmChange(MultiJobBuilder.java:167) 09:06:02 at com.tikal.jenkins.plugins.multijob.MultiJobBuilder.perform(MultiJobBuilder.java:243) 09:06:02 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) 09:06:02 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) 09:06:02 at hudson.model.Build$BuildExecution.build(Build.java:205) 09:06:02 at hudson.model.Build$BuildExecution.doRun(Build.java:162) 09:06:02 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) 09:06:02 at com.tikal.jenkins.plugins.multijob.MultiJobBuild$MultiJobRunnerImpl.run(MultiJobBuild.java:136) 09:06:02 at hudson.model.Run.execute(Run.java:1741) 09:06:02 at com.tikal.jenkins.plugins.multijob.MultiJobBuild.run(MultiJobBuild.java:73) 09:06:02 at hudson.model.ResourceController.execute(ResourceController.java:98) 09:06:02 at hudson.model.Executor.run(Executor.java:410) Workaround is to manually wipe workspace

          hagzag added a comment -

          Fixed by community pull request by https://github.com/ashaybatwal

          hagzag added a comment - Fixed by community pull request by https://github.com/ashaybatwal
          hagzag made changes -
          Link New: This issue blocks JENKINS-31527 [ JENKINS-31527 ]
          hagzag made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]
          hagzag made changes -
          Link New: This issue is blocked by JENKINS-31527 [ JENKINS-31527 ]

          Jakub Bochenski added a comment - PR: https://github.com/jenkinsci/tikal-multijob-plugin/pull/99

          This is still happening in 1.23

          12:46:46 ERROR: Build step failed with exception
          12:46:46 java.lang.NullPointerException
          12:46:46 	at com.tikal.jenkins.plugins.multijob.MultiJobBuilder.getScmChange(MultiJobBuilder.java:187)
          12:46:46 	at com.tikal.jenkins.plugins.multijob.MultiJobBuilder.perform(MultiJobBuilder.java:279)
          12:46:46 	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
          12:46:46 	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
          12:46:46 	at hudson.model.Build$BuildExecution.build(Build.java:205)
          12:46:46 	at hudson.model.Build$BuildExecution.doRun(Build.java:162)
          12:46:46 	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
          12:46:46 	at com.tikal.jenkins.plugins.multijob.MultiJobBuild$MultiJobRunnerImpl.run(MultiJobBuild.java:136)
          12:46:46 	at hudson.model.Run.execute(Run.java:1720)
          12:46:46 	at com.tikal.jenkins.plugins.multijob.MultiJobBuild.run(MultiJobBuild.java:73)
          12:46:46 	at hudson.model.ResourceController.execute(ResourceController.java:98)
          12:46:46 	at hudson.model.Executor.run(Executor.java:404)

          Jakub Bochenski added a comment - This is still happening in 1.23 12:46:46 ERROR: Build step failed with exception 12:46:46 java.lang.NullPointerException 12:46:46 at com.tikal.jenkins.plugins.multijob.MultiJobBuilder.getScmChange(MultiJobBuilder.java:187) 12:46:46 at com.tikal.jenkins.plugins.multijob.MultiJobBuilder.perform(MultiJobBuilder.java:279) 12:46:46 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) 12:46:46 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) 12:46:46 at hudson.model.Build$BuildExecution.build(Build.java:205) 12:46:46 at hudson.model.Build$BuildExecution.doRun(Build.java:162) 12:46:46 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) 12:46:46 at com.tikal.jenkins.plugins.multijob.MultiJobBuild$MultiJobRunnerImpl.run(MultiJobBuild.java:136) 12:46:46 at hudson.model.Run.execute(Run.java:1720) 12:46:46 at com.tikal.jenkins.plugins.multijob.MultiJobBuild.run(MultiJobBuild.java:73) 12:46:46 at hudson.model.ResourceController.execute(ResourceController.java:98) 12:46:46 at hudson.model.Executor.run(Executor.java:404)
          Jakub Bochenski made changes -
          Resolution Original: Fixed [ 1 ]
          Status Original: Closed [ 6 ] New: Reopened [ 4 ]

            Unassigned Unassigned
            lswith Luke Swithenbank
            Votes:
            6 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: