• 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

          DAvid Siegel created issue -
          DAvid Siegel made changes -
          Summary Original: npe on build of sub-job New: multijob plugin throws NPE
          DAvid Siegel made changes -
          Description Original: Stacktrace is below. Will include job configuration if you need it.

          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
          New: 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

          Brian Krische added a comment -

          I am seeing the same issue as well. If it's helpful information, I am calling a MultiJob job from inside an MultiJob.

          Brian Krische added a comment - I am seeing the same issue as well. If it's helpful information, I am calling a MultiJob job from inside an MultiJob.

          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.

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

              Created:
              Updated:
              Resolved: