Skip to content

[JENKINS-35206] NullPointerException on startup after update from 2.5 to 2.6 #17195

Closed

Description

@jenkins-infra-bot

After updating to 2.6 from 2.5 I'm getting the following NPE directly at startup:

hudson.util.HudsonFailedToLoad: java.lang.NullPointerException
	at hudson.WebAppMain$3.run(WebAppMain.java:244)
Caused by: java.lang.NullPointerException
	at jenkins.install.InstallState.equals(InstallState.java:179)
	at jenkins.install.InstallUtil.proceedToNextStateFrom(InstallUtil.java:97)
	at jenkins.model.Jenkins.<init>(Jenkins.java:888)
	at hudson.model.Hudson.<init>(Hudson.java:85)
	at hudson.model.Hudson.<init>(Hudson.java:81)
	at hudson.WebAppMain$3.run(WebAppMain.java:227)

The stacktrace didn't suggest a particular plugin so I chose 'core' as component. Please correct if necessary.

jenkins.err.log

Mai 30, 2016 7:23:10 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Logging initialized @​470ms
Mai 30, 2016 7:23:10 AM winstone.Logger logInternal
INFO: Beginning extraction from war file
Mai 30, 2016 7:23:14 AM org.eclipse.jetty.util.log.JavaUtilLog warn
WARNING: Empty contextPath
Mai 30, 2016 7:23:14 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: jetty-9.2.z-SNAPSHOT
Mai 30, 2016 7:23:15 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
Mai 30, 2016 7:23:15 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started w.@​1e3c1c7{/,file:/C:/Program%20Files%20(x86)/Jenkins/war/,AVAILABLE}{C:\Program Files (x86)\Jenkins\war}
Mai 30, 2016 7:23:15 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started ServerConnector@​19b0f9d{HTTP/1.1}{0.0.0.0:8080}
Mai 30, 2016 7:23:15 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started @​5203ms
Mai 30, 2016 7:23:15 AM winstone.Logger logInternal
INFO: Winstone Servlet Engine v2.0 running: controlPort=disabled
Mai 30, 2016 7:23:16 AM jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
Mai 30, 2016 7:23:16 AM jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
Mai 30, 2016 7:23:18 AM jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
Mai 30, 2016 7:23:18 AM hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
INFO: Failed to instantiate optional component org.jenkinsci.plugins.workflow.steps.scm.SubversionStep$DescriptorImpl; skipping
Mai 30, 2016 7:23:19 AM jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
Mai 30, 2016 7:23:19 AM jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
Mai 30, 2016 7:23:19 AM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
Mai 30, 2016 7:23:19 AM hudson.model.AsyncPeriodicWork$1 run
INFO: Started Download metadata
Mai 30, 2016 7:23:19 AM hudson.model.AsyncPeriodicWork$1 run
INFO: Finished Download metadata. 8 ms
Mai 30, 2016 7:23:19 AM org.jenkinsci.main.modules.sshd.SSHD start
INFO: Started SSHD at port 65097
Mai 30, 2016 7:23:19 AM jenkins.InitReactorRunner$1 onAttained
INFO: Completed initialization
Mai 30, 2016 7:23:19 AM hudson.util.BootFailure publish
SEVERE: Failed to initialize Jenkins
hudson.util.HudsonFailedToLoad: java.lang.NullPointerException
	at hudson.WebAppMain$3.run(WebAppMain.java:244)
Caused by: java.lang.NullPointerException
	at jenkins.install.InstallState.equals(InstallState.java:179)
	at jenkins.install.InstallUtil.proceedToNextStateFrom(InstallUtil.java:97)
	at jenkins.model.Jenkins.<init>(Jenkins.java:888)
	at hudson.model.Hudson.<init>(Hudson.java:85)
	at hudson.model.Hudson.<init>(Hudson.java:81)
	at hudson.WebAppMain$3.run(WebAppMain.java:227)


Originally reported by axelbehrens, imported from: NullPointerException on startup after update from 2.5 to 2.6
  • assignee: kzantow
  • status: Resolved
  • priority: Blocker
  • component(s): core
  • label(s): 2.7.1-fixed
  • resolution: Fixed
  • resolved: 2016-06-06T08:05:11+00:00
  • votes: 0
  • watchers: 3
  • imported: 2025-11-24
Raw content of original issue

After updating to 2.6 from 2.5 I'm getting the following NPE directly at startup:

hudson.util.HudsonFailedToLoad: java.lang.NullPointerException
	at hudson.WebAppMain$3.run(WebAppMain.java:244)
Caused by: java.lang.NullPointerException
	at jenkins.install.InstallState.equals(InstallState.java:179)
	at jenkins.install.InstallUtil.proceedToNextStateFrom(InstallUtil.java:97)
	at jenkins.model.Jenkins.<init>(Jenkins.java:888)
	at hudson.model.Hudson.<init>(Hudson.java:85)
	at hudson.model.Hudson.<init>(Hudson.java:81)
	at hudson.WebAppMain$3.run(WebAppMain.java:227)

The stacktrace didn't suggest a particular plugin so I chose 'core' as component. Please correct if necessary.

jenkins.err.log

Mai 30, 2016 7:23:10 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Logging initialized @470ms
Mai 30, 2016 7:23:10 AM winstone.Logger logInternal
INFO: Beginning extraction from war file
Mai 30, 2016 7:23:14 AM org.eclipse.jetty.util.log.JavaUtilLog warn
WARNING: Empty contextPath
Mai 30, 2016 7:23:14 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: jetty-9.2.z-SNAPSHOT
Mai 30, 2016 7:23:15 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
Mai 30, 2016 7:23:15 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started w.@1e3c1c7{/,file:/C:/Program%20Files%20(x86)/Jenkins/war/,AVAILABLE}{C:\Program Files (x86)\Jenkins\war}
Mai 30, 2016 7:23:15 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started ServerConnector@19b0f9d{HTTP/1.1}{0.0.0.0:8080}
Mai 30, 2016 7:23:15 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started @5203ms
Mai 30, 2016 7:23:15 AM winstone.Logger logInternal
INFO: Winstone Servlet Engine v2.0 running: controlPort=disabled
Mai 30, 2016 7:23:16 AM jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
Mai 30, 2016 7:23:16 AM jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
Mai 30, 2016 7:23:18 AM jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
Mai 30, 2016 7:23:18 AM hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
INFO: Failed to instantiate optional component org.jenkinsci.plugins.workflow.steps.scm.SubversionStep$DescriptorImpl; skipping
Mai 30, 2016 7:23:19 AM jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
Mai 30, 2016 7:23:19 AM jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
Mai 30, 2016 7:23:19 AM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
Mai 30, 2016 7:23:19 AM hudson.model.AsyncPeriodicWork$1 run
INFO: Started Download metadata
Mai 30, 2016 7:23:19 AM hudson.model.AsyncPeriodicWork$1 run
INFO: Finished Download metadata. 8 ms
Mai 30, 2016 7:23:19 AM org.jenkinsci.main.modules.sshd.SSHD start
INFO: Started SSHD at port 65097
Mai 30, 2016 7:23:19 AM jenkins.InitReactorRunner$1 onAttained
INFO: Completed initialization
Mai 30, 2016 7:23:19 AM hudson.util.BootFailure publish
SEVERE: Failed to initialize Jenkins
hudson.util.HudsonFailedToLoad: java.lang.NullPointerException
	at hudson.WebAppMain$3.run(WebAppMain.java:244)
Caused by: java.lang.NullPointerException
	at jenkins.install.InstallState.equals(InstallState.java:179)
	at jenkins.install.InstallUtil.proceedToNextStateFrom(InstallUtil.java:97)
	at jenkins.model.Jenkins.<init>(Jenkins.java:888)
	at hudson.model.Hudson.<init>(Hudson.java:85)
	at hudson.model.Hudson.<init>(Hudson.java:81)
	at hudson.WebAppMain$3.run(WebAppMain.java:227)

Activity

  1. jenkins-infra-bot commented on May 30, 2016

    @jenkins-infra-bot
    Author
  2. jenkins-infra-bot commented on May 30, 2016

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Original comment link
    • Raw content of original comment:

      It was caused by changes in the Update Wizard made by kzantow. Does this issue block the startup?

    It was caused by changes in the Update Wizard made by kzantow.
    Does this issue block the startup?

  3. jenkins-infra-bot commented on May 31, 2016

    @jenkins-infra-bot
    Author
    axelbehrens:
    • Original comment link
    • Raw content of original comment:

      Yes, the NPE stacktrace is the only thing shown in the web UI.

    Yes, the NPE stacktrace is the only thing shown in the web UI.

  4. jenkins-infra-bot commented on May 31, 2016

    @jenkins-infra-bot
    Author
    danielbeck:
    • Original comment link
    • Raw content of original comment:

      axelbehrens Do you remember what you did in 2.5? Did you run the upgrade wizard (installation of Pipeline plugins)? Did you dismiss it, or ignore the banner?

    axelbehrens Do you remember what you did in 2.5? Did you run the upgrade wizard (installation of Pipeline plugins)? Did you dismiss it, or ignore the banner?

  5. jenkins-infra-bot commented on May 31, 2016

    @jenkins-infra-bot
    Author
    kzantow:
    • Original comment link
    • Raw content of original comment:

      axelbehrens could you provide any additional information how you were able to get your Jenkins instance into this state? I was not able to reproduce it installing 2.5 and upgrading to 2.6. In any case, I've prepared a patch, which should fix this against the 2.6 codebase here.

    axelbehrens could you provide any additional information how you were able to get your Jenkins instance into this state? I was not able to reproduce it installing 2.5 and upgrading to 2.6. In any case, I've prepared a patch, which should fix this against the 2.6 codebase here.

  6. jenkins-infra-bot commented on Jun 1, 2016

    @jenkins-infra-bot
    Author
    axelbehrens:
    • Original comment link
    • Raw content of original comment:

      kzantow, this is only a test instance running on my laptop (Windows 7 x64). I've installed v2.0 from scratch, added a handful of plugins and created some jobs. I automatically updated pretty much to every new release until 2.6.

      This is my config.xml if that helps:

      <?xml version='1.0' encoding='UTF-8'?>
      <hudson>
        <disabledAdministrativeMonitors>
          <string>jenkins.diagnostics.SecurityIsOffMonitor</string>
        </disabledAdministrativeMonitors>
        <version>1.0</version>
        <installState>RESTART</installState>
        <numExecutors>2</numExecutors>
        <mode>NORMAL</mode>
        <useSecurity>true</useSecurity>
        <authorizationStrategy class="hudson.security.AuthorizationStrategy$Unsecured"/>
        <securityRealm class="hudson.security.SecurityRealm$None"/>
        <disableRememberMe>false</disableRememberMe>
        <projectNamingStrategy class="jenkins.model.ProjectNamingStrategy$DefaultProjectNamingStrategy"/>
        <workspaceDir>${ITEM_ROOTDIR}/workspace</workspaceDir>
        <buildsDir>${ITEM_ROOTDIR}/builds</buildsDir>
        <jdks/>
        <viewsTabBar class="hudson.views.DefaultViewsTabBar"/>
        <myViewsTabBar class="hudson.views.DefaultMyViewsTabBar"/>
        <clouds/>
        <scmCheckoutRetryCount>0</scmCheckoutRetryCount>
        <views>
          <hudson.model.AllView>
            <owner class="hudson" reference="../../.."/>
            <name>All</name>
            <filterExecutors>false</filterExecutors>
            <filterQueue>false</filterQueue>
            <properties class="hudson.model.View$PropertyList"/>
          </hudson.model.AllView>
        </views>
        <primaryView>All</primaryView>
        <slaveAgentPort>0</slaveAgentPort>
        <label></label>
        <nodeProperties/>
        <globalNodeProperties/>
      </hudson>
      

      Cheers

    kzantow, this is only a test instance running on my laptop (Windows 7 x64). I've installed v2.0 from scratch, added a handful of plugins and created some jobs. I automatically updated pretty much to every new release until 2.6.

    This is my config.xml if that helps:

    <?xml version='1.0' encoding='UTF-8'?>
    <hudson>
      <disabledAdministrativeMonitors>
        <string>jenkins.diagnostics.SecurityIsOffMonitor</string>
      </disabledAdministrativeMonitors>
      <version>1.0</version>
      <installState>RESTART</installState>
      <numExecutors>2</numExecutors>
      <mode>NORMAL</mode>
      <useSecurity>true</useSecurity>
      <authorizationStrategy class="hudson.security.AuthorizationStrategy$Unsecured"/>
      <securityRealm class="hudson.security.SecurityRealm$None"/>
      <disableRememberMe>false</disableRememberMe>
      <projectNamingStrategy class="jenkins.model.ProjectNamingStrategy$DefaultProjectNamingStrategy"/>
      <workspaceDir>${ITEM_ROOTDIR}/workspace</workspaceDir>
      <buildsDir>${ITEM_ROOTDIR}/builds</buildsDir>
      <jdks/>
      <viewsTabBar class="hudson.views.DefaultViewsTabBar"/>
      <myViewsTabBar class="hudson.views.DefaultMyViewsTabBar"/>
      <clouds/>
      <scmCheckoutRetryCount>0</scmCheckoutRetryCount>
      <views>
        <hudson.model.AllView>
          <owner class="hudson" reference="../../.."/>
          <name>All</name>
          <filterExecutors>false</filterExecutors>
          <filterQueue>false</filterQueue>
          <properties class="hudson.model.View$PropertyList"/>
        </hudson.model.AllView>
      </views>
      <primaryView>All</primaryView>
      <slaveAgentPort>0</slaveAgentPort>
      <label></label>
      <nodeProperties/>
      <globalNodeProperties/>
    </hudson>
    
    

    Cheers

  7. jenkins-infra-bot commented on Jun 1, 2016

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Original comment link
    • Raw content of original comment:

      Copy-paste from Keith's PR: "IMHO the only realistic case of getting such state is a corrupted config file with the legacy non-transient installState due to the whatever reason (e.g. upgrade from the previous version). I would vote for handling it in InstallState#readResolve() or in Jenkins#readResolve()"

      Working on this alternate solution

    Copy-paste from Keith's PR: "IMHO the only realistic case of getting such state is a corrupted config file with the legacy non-transient installState due to the whatever reason (e.g. upgrade from the previous version). I would vote for handling it in InstallState#readResolve() or in Jenkins#readResolve()"

    Working on this alternate solution

  8. jenkins-infra-bot commented on Jun 1, 2016

    @jenkins-infra-bot
    Author
    kzantow:
    • Original comment link
    • Raw content of original comment:

      oleg_nenashev yeah, this <installState>RESTART</installState> is the culprit, it looks like. A shame XStream doesn't realize the field is now transient and skip it. I still think that this could potentially be set from other sources (e.g. Groovy startup scripts), which makes my solution more general purpose.

    oleg_nenashev yeah, this RESTART is the culprit, it looks like. A shame XStream doesn't realize the field is now transient and skip it. I still think that this could potentially be set from other sources (e.g. Groovy startup scripts), which makes my solution more general purpose.

  9. jenkins-infra-bot commented on Jun 1, 2016

    @jenkins-infra-bot
    Author
    oleg_nenashev:

    Agreed, XStream fix does not close all potential misuse cases. Created #2387 anyway

  10. jenkins-infra-bot commented on Jun 2, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Oleg Nenashev
    Path:
    core/src/main/java/jenkins/install/InstallState.java
    test/src/test/java/jenkins/install/InstallStateTest.java
    http://jenkins-ci.org/commit/jenkins/1b2711c9578f5b34bc452fcc3f2dd055b1c0865c
    Log:
    JENKINS-35206 - Make the InstallState object deserialization robust against corrupted files (#2387)

    • JENKINS-35206 - Install state should be robust against messed statuses when deserializing objects
  11. jenkins-infra-bot commented on Jun 3, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Keith Zantow
    Path:
    core/src/main/java/jenkins/install/InstallUtil.java
    core/src/main/java/jenkins/model/Jenkins.java
    http://jenkins-ci.org/commit/jenkins/541641100b4a9570d72d263a12edbc1e06c987a2
    Log:
    JENKINS-35206 - fix potential NPE due to corrupt Jenkins.InstallState (#2385)

  12. jenkins-infra-bot commented on Jun 6, 2016

    @jenkins-infra-bot
    Author
    axelbehrens:
    • Original comment link
    • Raw content of original comment:

      BTW: It's fixed now in 2.8

    BTW: It's fixed now in 2.8

  13. jenkins-infra-bot commented on Feb 17, 2017

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Keith Zantow
    Path:
    core/src/main/java/jenkins/install/InstallUtil.java
    core/src/main/java/jenkins/model/Jenkins.java
    http://jenkins-ci.org/commit/jenkins/3837f44a6f2621dde0bea59c522cc1e0464b67c2
    Log:
    JENKINS-35206 - fix potential NPE due to corrupt Jenkins.InstallState (#2385)
    (cherry picked from commit 5416411)

  14. jenkins-infra-bot commented on Feb 17, 2017

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Oleg Nenashev
    Path:
    core/src/main/java/jenkins/install/InstallState.java
    test/src/test/java/jenkins/install/InstallStateTest.java
    http://jenkins-ci.org/commit/jenkins/e8467e304ba33329c1afd0fa15a8456f52711f4b
    Log:
    JENKINS-35206 - Make the InstallState object deserialization robust against corrupted files (#2387)

    • JENKINS-35206 - Install state should be robust against messed statuses when deserializing objects

    (cherry picked from commit 1b2711c)

  15. removed
    bugFor changelog: Minor bug. Will be listed after features
    on Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions