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

NPE in ComputerListener#onConfigurationChange breaks Jenkins

    XMLWordPrintable

Details

    Description

      When installing the smart-jenkins-plugin on a current Jenkins (2.111), the Jenkins instance doesn't start anymore:

       

      java.lang.NullPointerException
      	at smartjenkins.SmartJenkinsComputerListener.onConfigurationChange(SmartJenkinsComputerListener.java:41)
      	at hudson.model.AbstractCIBase.updateComputerList(AbstractCIBase.java:231)
      	at jenkins.model.Jenkins.updateComputerList(Jenkins.java:1547)
      	at jenkins.model.Nodes$8.run(Nodes.java:333)
      	at hudson.model.Queue._withLock(Queue.java:1375)
      	at hudson.model.Queue.withLock(Queue.java:1252)
      	at jenkins.model.Nodes.load(Nodes.java:324)
      	at jenkins.model.Jenkins$14.run(Jenkins.java:3060)
      	at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
      	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
      	at jenkins.model.Jenkins$5.runTask(Jenkins.java:1064)
      	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
      	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Caused: org.jvnet.hudson.reactor.ReactorException
      	at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:282)
      	at jenkins.InitReactorRunner.run(InitReactorRunner.java:48)
      	at jenkins.model.Jenkins.executeReactor(Jenkins.java:1098)
      	at jenkins.model.Jenkins.<init>(Jenkins.java:900)
      	at hudson.model.Hudson.<init>(Hudson.java:85)
      	at hudson.model.Hudson.<init>(Hudson.java:81)
      	at hudson.WebAppMain$3.run(WebAppMain.java:233)
      Caused: hudson.util.HudsonFailedToLoad
      	at hudson.WebAppMain$3.run(WebAppMain.java:250)
      

      PS: I have no desire to use that plugin, so I'm fine with getting it blacklisted in the update-center, so that nobody else stumbles into this trap.

      Attachments

        Issue Links

          Activity

            I'm facing the same issue after i upgraded jenkins to 2.107.1. I resolved this by stopping the service, deleting the plugin smart-jenkins and its config file. 

            domsfreekin16 Dominic Jeremiah added a comment - I'm facing the same issue after i upgraded jenkins to 2.107.1. I resolved this by stopping the service, deleting the plugin smart-jenkins and its config file. 
            oleg_nenashev Oleg Nenashev added a comment -

            There is a defect in the plugin. https://github.com/jenkinsci/smart-jenkins-plugin/blob/master/src/main/java/smartjenkins/SmartJenkinsComputerListener.java#L41 . The fields like SmartJenkinsConfiguration are cached as static ones, and it cannot work reliably in general. I do not know which change in the core causes the regression in newer version, but AFAICT the fix is required on the plugin side

            oleg_nenashev Oleg Nenashev added a comment - There is a defect in the plugin. https://github.com/jenkinsci/smart-jenkins-plugin/blob/master/src/main/java/smartjenkins/SmartJenkinsComputerListener.java#L41 . The fields like SmartJenkinsConfiguration are cached as static ones, and it cannot work reliably in general. I do not know which change in the core causes the regression in newer version, but AFAICT the fix is required on the plugin side

            Code changed in jenkins
            User: Jesse Glick
            Path:
            core/src/main/java/hudson/model/AbstractCIBase.java
            http://jenkins-ci.org/commit/jenkins/c8b2f52895dad7fbc0e5aeaadbaa7f3ff2d4bdee
            Log:
            JENKINS-50217 Defend against buggy ComputerListener.onConfigurationChange implementations.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/model/AbstractCIBase.java http://jenkins-ci.org/commit/jenkins/c8b2f52895dad7fbc0e5aeaadbaa7f3ff2d4bdee Log: JENKINS-50217 Defend against buggy ComputerListener.onConfigurationChange implementations.

            Code changed in jenkins
            User: Jesse Glick
            Path:
            core/src/main/java/hudson/model/AbstractCIBase.java
            http://jenkins-ci.org/commit/jenkins/6f91299d6700de94eece184666400a208c237141
            Log:
            Merge pull request #3471 from jglick/robustness-JENKINS-50217

            JENKINS-50217 Defend against buggy ComputerListener.onConfigurationChange implementations

            Compare: https://github.com/jenkinsci/jenkins/compare/0e5fc86f4f72...6f91299d6700
            *NOTE:* This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

            Functionality will be removed from GitHub.com on January 31st, 2019.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/model/AbstractCIBase.java http://jenkins-ci.org/commit/jenkins/6f91299d6700de94eece184666400a208c237141 Log: Merge pull request #3471 from jglick/robustness- JENKINS-50217 JENKINS-50217 Defend against buggy ComputerListener.onConfigurationChange implementations Compare: https://github.com/jenkinsci/jenkins/compare/0e5fc86f4f72...6f91299d6700 * NOTE: * This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/ Functionality will be removed from GitHub.com on January 31st, 2019.
            oleg_nenashev Oleg Nenashev added a comment -

            The core robustness patch has been released in 2.126. Marked as lts-candidate. The plugin still needs to be fixed, I will move it to a separate ticket

            jglick I would appreciate if you start creating separate issues if you see changes needed in the core. Otherwise we have issues with changelogs & Co.

            oleg_nenashev Oleg Nenashev added a comment - The core robustness patch has been released in 2.126. Marked as lts-candidate. The plugin still needs to be fixed, I will move it to a separate ticket jglick I would appreciate if you start creating separate issues if you see changes needed in the core. Otherwise we have issues with changelogs & Co.

            Code changed in jenkins
            User: Jesse Glick
            Path:
            core/src/main/java/hudson/model/AbstractCIBase.java
            http://jenkins-ci.org/commit/jenkins/8ade79859ef23ce12a2ceb4ebbf449df8761c626
            Log:
            JENKINS-50217 Defend against buggy ComputerListener.onConfigurationChange implementations.

            (cherry picked from commit c8b2f52895dad7fbc0e5aeaadbaa7f3ff2d4bdee)

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/model/AbstractCIBase.java http://jenkins-ci.org/commit/jenkins/8ade79859ef23ce12a2ceb4ebbf449df8761c626 Log: JENKINS-50217 Defend against buggy ComputerListener.onConfigurationChange implementations. (cherry picked from commit c8b2f52895dad7fbc0e5aeaadbaa7f3ff2d4bdee)

            People

              Unassigned Unassigned
              tgr Tobias Gruetzmacher
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: