If you create a matrix project and start to build it, but then kill the execution before all the configurations have really run, and then call Queue.schedule on one of these configurations, you can get an exception:

      java.lang.NullPointerException
      	at hudson.matrix.MatrixConfiguration.newBuild(MatrixConfiguration.java:240)
      	at hudson.matrix.MatrixConfiguration.newBuild(MatrixConfiguration.java:70)
      	at hudson.model.AbstractProject.createExecutable(AbstractProject.java:1305)
      	at hudson.model.AbstractProject.createExecutable(AbstractProject.java:140)
      	at hudson.model.Executor.run(Executor.java:212)
      

      Here MatrixBuild lb is null.

          [JENKINS-17728] NPE from MatrixConfiguration.newBuild

          Jesse Glick created issue -
          Jesse Glick made changes -
          Labels Original: exception matrix New: exception lts-candidate matrix

          Jesse Glick added a comment - - edited

          getParent().getLastBuild() is not null, but there is a ParentBuildAction in the current work unit context whose parent is null. Did not manage to reproduce in a functional test, I think because a restart of Jenkins is required.

          Jesse Glick added a comment - - edited getParent().getLastBuild() is not null, but there is a ParentBuildAction in the current work unit context whose parent is null. Did not manage to reproduce in a functional test, I think because a restart of Jenkins is required.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          core/src/main/java/hudson/matrix/MatrixConfiguration.java
          http://jenkins-ci.org/commit/jenkins/06e459fffebfe447dcd3edad73559ffb4a8ae707
          Log:
          [FIXED JENKINS-17728] ParentBuildAction.parent can sometimes be null.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/matrix/MatrixConfiguration.java http://jenkins-ci.org/commit/jenkins/06e459fffebfe447dcd3edad73559ffb4a8ae707 Log: [FIXED JENKINS-17728] ParentBuildAction.parent can sometimes be null.
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2488
          [FIXED JENKINS-17728] ParentBuildAction.parent can sometimes be null. (Revision 06e459fffebfe447dcd3edad73559ffb4a8ae707)

          Result = SUCCESS
          Jesse Glick : 06e459fffebfe447dcd3edad73559ffb4a8ae707
          Files :

          • changelog.html
          • core/src/main/java/hudson/matrix/MatrixConfiguration.java

          dogfood added a comment - Integrated in jenkins_main_trunk #2488 [FIXED JENKINS-17728] ParentBuildAction.parent can sometimes be null. (Revision 06e459fffebfe447dcd3edad73559ffb4a8ae707) Result = SUCCESS Jesse Glick : 06e459fffebfe447dcd3edad73559ffb4a8ae707 Files : changelog.html core/src/main/java/hudson/matrix/MatrixConfiguration.java
          Jesse Glick made changes -
          Link New: This issue is duplicated by JENKINS-15356 [ JENKINS-15356 ]
          Jesse Glick made changes -
          Link New: This issue is duplicated by JENKINS-16276 [ JENKINS-16276 ]
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-15199 [ JENKINS-15199 ]

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          core/src/main/java/hudson/matrix/MatrixConfiguration.java
          http://jenkins-ci.org/commit/jenkins/ea0bf9577435e3195b3be02879530224885f6c24
          Log:
          [FIXED JENKINS-17728] ParentBuildAction.parent can sometimes be null.(cherry picked from commit 06e459fffebfe447dcd3edad73559ffb4a8ae707)

          Conflicts:
          changelog.html

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/matrix/MatrixConfiguration.java http://jenkins-ci.org/commit/jenkins/ea0bf9577435e3195b3be02879530224885f6c24 Log: [FIXED JENKINS-17728] ParentBuildAction.parent can sometimes be null.(cherry picked from commit 06e459fffebfe447dcd3edad73559ffb4a8ae707) Conflicts: changelog.html

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

              Created:
              Updated:
              Resolved: