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

NPE in hudson.maven.MavenModuleSet.buildDependencyGraph

XMLWordPrintable

      java.lang.NullPointerException
      	at hudson.maven.MavenModuleSet.buildDependencyGraph(MavenModuleSet.java:931)
      	at hudson.model.DependencyGraph.build(DependencyGraph.java:95)
      	at jenkins.model.Jenkins.rebuildDependencyGraph(Jenkins.java:4665)
      	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.parsePoms(MavenModuleSetBuild.java:1059)
      	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:691)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
      	at hudson.model.Run.execute(Run.java:1815)
      	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:429)
      

      We have the same NPE triggered asynchronously via jenkins.model.Jenkins.rebuildDependencyGraphAsync().

      This happens when a seed job is running and creating/updating jobs via jobdsl.

      The cause is that MavenModuleSet#prebuilders is null when an instance is deserialized (so the MavenModuleSet constructor is not called) and MavenModuleSet#onLoad() is still executing (and thus the assignment of the prebuilders field has not happened, yet.

      The simple fix is to add a null-guard around the field-accesses in MavenModuleSet.buildDependencyGraph().

      I don't quite understand how the field can be null in the serialized form, but apparently that's possible.

      I found the same stacktrace here, FWIW.

            Unassigned Unassigned
            capf Carsten Pfeiffer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: