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

"Jenkins.instance is missing" error upon initial installation on Windows

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Environment:
      Windows 10 Pro, VM on Azure, AdoptOpenJDK 11.0.5.10
    • Similar Issues:
    • Released As:
      Jenkins 2.223

      Description

      I installed Jenkins 2.204.2 for the first time on my Windows 10 Pro machine today. I have made no changes to its configuration after installing it using the Windows MSI installer

      When the installer first automatically opened http://localhost:8080 upon installation, I just got a "failed to connect" browser error page. When I looked at Services, the Jenkins service was not running.

      After that, I changed the Jenkins Windows service to run as a domain user which has been granted Modify access to the Jenkins installation at C:\Program Files (x86)\Jenkins. Then I manually started the Jenkins windows service.

      When I go to http://localhost:8080, I get an error page with the following information:

      Oops!
      
      A problem occurred while processing the request. Please check our bug tracker to see if a similar problem has already been reported. If it is already reported, please vote and put a comment on it to let us gauge the impact of the problem. If you think this is a new issue, please file a new issue. When you file an issue, make sure to add the entire stack trace, along with the version of Jenkins and relevant plugins. The users list might be also useful in understanding what has happened.
      
      Stack trace
      java.lang.IllegalStateException: Jenkins.instance is missing. Read the documentation of Jenkins.getInstanceOrNull to see what you are doing wrong.
      	at jenkins.model.Jenkins.get(Jenkins.java:778)
      	at hudson.security.TokenBasedRememberMeServices2.autoLogin(TokenBasedRememberMeServices2.java:164)
      	at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:104)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      	at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90)
      	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
      	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
      	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
      	at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1700)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1667)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
      	at org.eclipse.jetty.server.Server.handle(Server.java:505)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
      	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
      	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
      	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
      	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:698)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:804)
      	at java.lang.Thread.run(Unknown Source)
      

      Upon receiving that error message, the Jenkins Windows Service stops and must be restarted before viewing the page again. Same error message after restarting the service.

      The failed-boot-attempts.txt file in the Jenkins installation contains this:

      Sun Feb 23 22:10:14 CST 2020
      

        Attachments

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Analysis:

           

          Show
          oleg_nenashev Oleg Nenashev added a comment - Analysis: https://github.com/jenkinsci/jenkins/pull/4042  looks to be a related change, but it just replaces old method with a new one. The behavior should not have changed after that. I suspect the root cause is a SECURITY-996 fix by Wadeck Follonier in  https://github.com/jenkinsci/jenkins/commit/ef9583a24abc4de157e1570cb32d7a273d327f36  . It was 2 years ago. Since that the code needs the Jenkins instance, and apparently the login attempt happens before Jenkins is fully loaded   
          Show
          wfollonier Wadeck Follonier added a comment - - edited Analysis done in https://issues.jenkins-ci.org/browse/JENKINS-59992?focusedCommentId=379193&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-379193 Duplicate of: https://issues.jenkins-ci.org/browse/JENKINS-60454 https://issues.jenkins-ci.org/browse/JENKINS-59992 https://issues.jenkins-ci.org/browse/JENKINS-55070
          Hide
          wfollonier Wadeck Follonier added a comment -
          Show
          wfollonier Wadeck Follonier added a comment - Symptom correction proposal: https://github.com/jenkinsci/jenkins/pull/4525
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          It was released in Jenkins 2.223  in March

          Show
          oleg_nenashev Oleg Nenashev added a comment - It was released in Jenkins 2.223  in March

            People

            • Assignee:
              wfollonier Wadeck Follonier
              Reporter:
              apjanke Andrew Janke
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: