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

NPE in AbstractProject constructor if Jenkins instance has not been completely initialized

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Similar Issues:

      Description

      I got into the error during my experiments with automatic job creation on the plugin startup.

      NPE may happen if...

      • Jenkins instance has been already initialized
      • Nodes have not been loaded yet

      Stacktrace example (the code has not been committed yet):

      SEVERE: Failed Initializing plugin docker-traceability
      java.lang.NullPointerException
      at hudson.model.AbstractProject.<init>(AbstractProject.java:269)
      at org.jenkinsci.plugins.docker.traceability.model.jobs.DockerBuildReferenceJob.<init>(DockerBuildReferenceJob.java:65)
      at org.jenkinsci.plugins.docker.traceability.model.jobs.DockerBuildReferenceJob.loadJob(DockerBuildReferenceJob.java:134)
      at org.jenkinsci.plugins.docker.traceability.model.jobs.DockerBuildReferenceFactory.onStart(DockerBuildReferenceFactory.java:55)
      at org.jenkinsci.plugins.docker.traceability.DockerTraceabilityPlugin.postInitialize(DockerTraceabilityPlugin.java:66)
      at hudson.PluginManager$2$1$2.run(PluginManager.java:376)

        Attachments

          Issue Links

            Activity

            Show
            oleg_nenashev Oleg Nenashev added a comment - https://github.com/jenkinsci/jenkins/pull/1724
            Hide
            jglick Jesse Glick added a comment -

            Whatever DockerBuildReferenceJob is, it sounds illegal. Do not do it.

            Show
            jglick Jesse Glick added a comment - Whatever DockerBuildReferenceJob is, it sounds illegal. Do not do it.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            core/src/main/java/hudson/model/AbstractProject.java
            http://jenkins-ci.org/commit/jenkins/a7ec87c007817c15528a58ac3b35de979adef895
            Log:
            [FIXED JENKINS-28654] - Check null nodes condition in AbstractProject constructor

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/model/AbstractProject.java http://jenkins-ci.org/commit/jenkins/a7ec87c007817c15528a58ac3b35de979adef895 Log: [FIXED JENKINS-28654] - Check null nodes condition in AbstractProject constructor
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            core/src/main/java/hudson/model/AbstractProject.java
            http://jenkins-ci.org/commit/jenkins/695a3d7dabdd23ba5fd8faca9c45dbbed9215b15
            Log:
            Merge pull request #1724 from oleg-nenashev/AbstractProject_constructor_NPE

            [FIXED JENKINS-28654] - Check null nodes condition in AbstractProject constructor

            Compare: https://github.com/jenkinsci/jenkins/compare/29f223a5078c...695a3d7dabdd

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/model/AbstractProject.java http://jenkins-ci.org/commit/jenkins/695a3d7dabdd23ba5fd8faca9c45dbbed9215b15 Log: Merge pull request #1724 from oleg-nenashev/AbstractProject_constructor_NPE [FIXED JENKINS-28654] - Check null nodes condition in AbstractProject constructor Compare: https://github.com/jenkinsci/jenkins/compare/29f223a5078c...695a3d7dabdd
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #4168

            Result = UNSTABLE

            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #4168 Result = UNSTABLE

              People

              • Assignee:
                oleg_nenashev Oleg Nenashev
                Reporter:
                oleg_nenashev Oleg Nenashev
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: