• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • multijob-plugin
    • None
    • Ubuntu 14.04

      Stacktrace is below. Will include job configuration if you need it.
      This error occurrs when the first multijob phase build step is ran, which comes after two regular build steps.

      ERROR: Build step failed with exception
      java.lang.NullPointerException
      at com.tikal.jenkins.plugins.multijob.MultiJobBuilder.getScmChange(MultiJobBuilder.java:171)
      at com.tikal.jenkins.plugins.multijob.MultiJobBuilder.perform(MultiJobBuilder.java:243)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
      at hudson.model.Build$BuildExecution.build(Build.java:205)
      at hudson.model.Build$BuildExecution.doRun(Build.java:162)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
      at com.tikal.jenkins.plugins.multijob.MultiJobBuild$MultiJobRunnerImpl.run(MultiJobBuild.java:136)
      at hudson.model.Run.execute(Run.java:1741)
      at com.tikal.jenkins.plugins.multijob.MultiJobBuild.run(MultiJobBuild.java:73)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:408)
      Build step 'MultiJob Phase' marked build as failure

          [JENKINS-31527] multijob plugin throws NPE

          Jeff Yemin added a comment -

          I started seeing this after upgrading to 1.19 and it stopped after downgrading to 1.18.

          Jeff Yemin added a comment - I started seeing this after upgrading to 1.19 and it stopped after downgrading to 1.18.

          We are seeing the same problem. Having varying success by disabling concurrent builds on some multi-jobs which seems to resolve the issue on some of the jobs. Downgrading to 1.18 would appear to cause job data to be lost, so it's not really an option.

          David Bayendor added a comment - We are seeing the same problem. Having varying success by disabling concurrent builds on some multi-jobs which seems to resolve the issue on some of the jobs. Downgrading to 1.18 would appear to cause job data to be lost, so it's not really an option.

          It looks like the issue is related to lines 168-170 of MultiJobBuilder.java as quoted below:

                  if ( lastBuild.getResult().isWorseThan(Result.UNSTABLE) ) {
                      return StatusJob.LASTBUILD_RESULT_IS_WORSE_THAN_UNSTABLE;
                  }
          

          The code should check that the last build's result is non-null as it seems it can be null when a build is still running.

          Creating a copy of the downstream job I would like to run and ensuring this copy isn't used anywhere else prevented the multi-job project from running into the null pointer exception.

          Mark Hesselink added a comment - It looks like the issue is related to lines 168-170 of MultiJobBuilder.java as quoted below: if ( lastBuild.getResult().isWorseThan(Result.UNSTABLE) ) { return StatusJob.LASTBUILD_RESULT_IS_WORSE_THAN_UNSTABLE; } The code should check that the last build's result is non-null as it seems it can be null when a build is still running. Creating a copy of the downstream job I would like to run and ensuring this copy isn't used anywhere else prevented the multi-job project from running into the null pointer exception.

          After looking at the exception errors, I agree with Mark Hesselink's analysis. We successfully reverted to the 1.18 plugin and have pinned it for the time being until this is resolved.

          David Bayendor added a comment - After looking at the exception errors, I agree with Mark Hesselink's analysis. We successfully reverted to the 1.18 plugin and have pinned it for the time being until this is resolved.

          Jörg Ziegler added a comment -

          Confirmed in 1.20, downgrading to 1.18 fixes it.

          Jörg Ziegler added a comment - Confirmed in 1.20, downgrading to 1.18 fixes it.

          James Femia added a comment -

          I also encounter this issue in 1.20 and 1.18 when using the "Build only if SCM changes" option on a phase job, if the job referenced by that phase job is already in progress.

          James Femia added a comment - I also encounter this issue in 1.20 and 1.18 when using the "Build only if SCM changes" option on a phase job, if the job referenced by that phase job is already in progress.

          Hey, is this issue still valid with the current version 1.21 and Jenkins 2?

          Sascha Grunert added a comment - Hey, is this issue still valid with the current version 1.21 and Jenkins 2?

          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

          I think JENKINS-31643 is a duplicate

          Jakub Bochenski added a comment - I think JENKINS-31643 is a duplicate

          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

            Unassigned Unassigned
            davi_d DAvid Siegel
            Votes:
            8 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: