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

Got IllegalStateException while restart Jenkins

    • Jenkins 2.185

      Hi oleg_nenashev 
      I'm using Jenkins version 2.162
      When I restart jenkins using /restart command or after plugin installation I got the following error at Jenkins restart page:

      Stack tracejava.lang.IllegalStateException: Expected 1 instance of hudson.model.User$AllUsers but got 0
      	at hudson.ExtensionList.lookupSingleton(ExtensionList.java:450)
      	at hudson.model.User$AllUsers.getInstance(User.java:1084)
      	at hudson.model.User$AllUsers.get(User.java:1102)
      	at hudson.model.User$AllUsers.access$100(User.java:1065)
      	at hudson.model.User.getOrCreateById(User.java:521)
      	at hudson.model.User.getById(User.java:619)
      	at hudson.security.HttpSessionContextIntegrationFilter2.hasInvalidSessionSeed(HttpSessionContextIntegrationFilter2.java:87)
      	at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:60)
      	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:1642)
      	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      	at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
      	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:1595)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242)
      	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:503)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
      	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:118)
      	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:765)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
      	at java.lang.Thread.run(Thread.java:748)
      

      As I see frontend part scripts/loading.js:53 sent GET request to server URL and got 500 code. 

      The normal behaviour of  loading.js:41 should get 503 code from the server

          [JENKINS-55945] Got IllegalStateException while restart Jenkins

          Oleg Nenashev added a comment -

          Hi. I see the ticket, but I have no bandwidth to process it right now.

          Will unassign the ticket so that others can work on it if they have some time

          Oleg Nenashev added a comment - Hi. I see the ticket, but I have no bandwidth to process it right now. Will unassign the ticket so that others can work on it if they have some time

          Pavel Roskin added a comment -

          I got this when I loaded a locally compiled version of the Stash pull request builder plugin and selected the "Restart Jenkins" checkbox. I saw that message. I reloaded the page after a few seconds, Jenkins is working normally. Jenkins 2.164 in Docker.

          Pavel Roskin added a comment - I got this when I loaded a locally compiled version of the Stash pull request builder plugin and selected the "Restart Jenkins" checkbox. I saw that message. I reloaded the page after a few seconds, Jenkins is working normally. Jenkins 2.164 in Docker.

          Getting this when restarting after updating a plugin. Clicking the checkbox for restarting jenkins when no jobs are running, will immediately produce this error.

          However, if I wait for Jenkins to restart, it will eventually restart properly.

          This is on a brand new Jenkins installation using the official docker image on an Ubuntu 18.04 EC2 instance.

          Michael Sanders added a comment - Getting this when restarting after updating a plugin. Clicking the checkbox for restarting jenkins when no jobs are running, will immediately produce this error. However, if I wait for Jenkins to restart, it will eventually restart properly. This is on a brand new Jenkins installation using the official docker image on an Ubuntu 18.04 EC2 instance.

          Boyd Smith added a comment -

          Like urinalcake, I received this error when clicking the "Restart jenkins when no jobs are running" from the pluginManager/updatePlugins area.

          Boyd Smith added a comment - Like urinalcake , I received this error when clicking the "Restart jenkins when no jobs are running" from the pluginManager/updatePlugins area.

          mike mancini added a comment -

          I also encounter this in the same context as Boyd and Michael - a workaround for me was to log out, log back in, and then hit the /restart endpoint.

          mike mancini added a comment - I also encounter this in the same context as Boyd and Michael - a workaround for me was to log out, log back in, and then hit the /restart endpoint.

          Tor Mala added a comment -

          I get the same behaviour. Fresh install on AWS ubuntu 18.04 installing version 2.164.1

          I have set locale to en_US.UTF8

          I also get errors when I try to create user with passwords containing characters outside ASCII

          Tor Mala added a comment - I get the same behaviour. Fresh install on AWS ubuntu 18.04 installing version 2.164.1 I have set locale to en_US.UTF8 I also get errors when I try to create user with passwords containing characters outside ASCII

          Pavel Roskin added a comment -

          I understand the reason is an attempt to authenticate the http request after the user list is destroyed. A simple fix would be to catch IllegalStateException in User#getOrCreateById and return null. A better solution would be to create a nullable ExtensionList#lookupSingletonOrNull, use it from User.java and handle null properly in all callers.

           

          Pavel Roskin added a comment - I understand the reason is an attempt to authenticate the http request after the user list is destroyed. A simple fix would be to catch IllegalStateException in User#getOrCreateById and return null. A better solution would be to create a nullable ExtensionList#lookupSingletonOrNull , use it from User.java and handle null properly in all callers.  

          Casey Wise added a comment -

          Getting this attempting to configure a new install on Windows.  Installed the following plugins when I saw this first.

          • GitHub
          • Bitbucket

          Casey Wise added a comment - Getting this attempting to configure a new install on Windows.  Installed the following plugins when I saw this first. GitHub Bitbucket

          I got this too today. And reverted only in plugins folder the github-branch-source.bak. But now the plugin manager does not show up the new version, strange.

          Ronny Borchert added a comment - I got this too today. And reverted only in plugins folder the github-branch-source.bak. But now the plugin manager does not show up the new version, strange.

          Lakshya Kapoor added a comment - - edited

          I ran into this right after upgrading to 2.164.2 today. Clearing the /caches folder and restarting Jenkins got rid of the error.

          EDIT: The error returns every time I reboot Jenkins after updating a plugin. Manually restarting the service (on Windows) fixes it until the next reboot for plugin updates...

          Lakshya Kapoor added a comment - - edited I ran into this right after upgrading to 2.164.2 today. Clearing the /caches folder and restarting Jenkins got rid of the error. EDIT : The error returns every time I reboot Jenkins after updating a plugin. Manually restarting the service (on Windows) fixes it until the next reboot for plugin updates...

          Jeff Thompson added a comment -

          I'm taking a look at this to see if I can figure out what's going on. I haven't had any luck at reproducing it yet. There must be something about timing or configuration. There's probably something a little off about the Jenkins init sequence. If anyone could contribute additional logging, particularly showing init sequence progress, that might be helpful. It might be possible to catch the error here and do something, but without reproduction it's difficult to know if we'd be doing the right thing. Catching it and setting the security context to null would probably work.

          Jeff Thompson added a comment - I'm taking a look at this to see if I can figure out what's going on. I haven't had any luck at reproducing it yet. There must be something about timing or configuration. There's probably something a little off about the Jenkins init sequence. If anyone could contribute additional logging, particularly showing init sequence progress, that might be helpful. It might be possible to catch the error here and do something, but without reproduction it's difficult to know if we'd be doing the right thing. Catching it and setting the security context to null would probably work.

          Pavel Roskin added a comment -

          I can reproduce it every time. I just access the Jenkins URL with "/safeRestart", confirm restart and keep reloading the page every second. It shows the error approximately after 5 to 10 reloads.

          It's interesting that I don't see any stack trace in the console log. Jenkins 2.182 in a Docker container.

           

          2019-06-28 21:20:09.963+0000 [id=318] INFO jenkins.model.Jenkins$23#run: Restart in 10 seconds
          2019-06-28 21:20:19.964+0000 [id=318] INFO jenkins.model.Jenkins$23#run: Restarting VM as requested by roskinp
          2019-06-28 21:20:19.965+0000 [id=318] INFO jenkins.model.Jenkins#cleanUp: Stopping Jenkins
          2019-06-28 21:20:19.983+0000 [id=318] INFO jenkins.model.Jenkins$18#onAttained: Started termination
          2019-06-28 21:20:19.993+0000 [id=318] INFO jenkins.model.Jenkins$18#onAttained: Completed termination
          2019-06-28 21:20:19.993+0000 [id=318] INFO jenkins.model.Jenkins#_cleanUpDisconnectComputers: Starting node disconnection
          2019-06-28 21:20:21.011+0000 [id=318] INFO jenkins.model.Jenkins#_cleanUpShutdownPluginManager: Stopping plugin manager
          2019-06-28 21:20:21.026+0000 [id=318] INFO jenkins.model.Jenkins#_cleanUpPersistQueue: Persisting build queue
          2019-06-28 21:20:21.028+0000 [id=318] INFO jenkins.model.Jenkins#_cleanUpAwaitDisconnects: Waiting for node disconnection completion
          2019-06-28 21:20:21.033+0000 [id=318] INFO jenkins.model.Jenkins#cleanUp: Jenkins stopped
          Running from: /usr/share/jenkins/jenkins-stable.war
          webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
          2019-06-28 21:20:23.482+0000 [id=1] INFO org.eclipse.jetty.util.log.Log#initialized: Logging initialized @595ms to org.eclipse.jetty.util.log.JavaUtilLog
          2019-06-28 21:20:23.606+0000 [id=1] INFO winstone.Logger#logInternal: Beginning extraction from war file
          2019-06-28 21:20:23.642+0000 [id=1] WARNING o.e.j.s.handler.ContextHandler#setContextPath: Empty contextPath
          2019-06-28 21:20:23.704+0000 [id=1] INFO org.eclipse.jetty.server.Server#doStart: jetty-9.4.z-SNAPSHOT; built: 2019-05-02T00:04:53.875Z; git: e1bc35120a6617ee3df052294e433f3a25ce7097; jvm 1.8.0_181-8u181-b13-2~deb9u1-b13
          2019-06-28 21:20:24.033+0000 [id=1] INFO o.e.j.w.StandardDescriptorProcessor#visitServlet: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
          2019-06-28 21:20:24.087+0000 [id=1] INFO o.e.j.s.s.DefaultSessionIdManager#doStart: DefaultSessionIdManager workerName=node0
          2019-06-28 21:20:24.088+0000 [id=1] INFO o.e.j.s.s.DefaultSessionIdManager#doStart: No SessionScavenger set, using defaults
          2019-06-28 21:20:24.091+0000 [id=1] INFO o.e.j.server.session.HouseKeeper#startScavenging: node0 Scavenging every 660000ms
          Jenkins home directory: /var/jenkins_home found at: EnvVars.masterEnvVars.get("JENKINS_HOME")

           

          Here's what I see on the page. The same Jenkins container.

           

          java.lang.IllegalStateException: Expected 1 instance of hudson.model.User$AllUsers but got 0
          at hudson.ExtensionList.lookupSingleton(ExtensionList.java:451)
          at hudson.model.User$AllUsers.getInstance(User.java:1080)
          at hudson.model.User$AllUsers.get(User.java:1098)
          at hudson.model.User$AllUsers.access$100(User.java:1061)
          at hudson.model.User.getOrCreateById(User.java:517)
          at hudson.model.User.getById(User.java:615)
          at hudson.security.HttpSessionContextIntegrationFilter2.hasInvalidSessionSeed(HttpSessionContextIntegrationFilter2.java:87)
          at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:60)
          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(Thread.java:748)

          Pavel Roskin added a comment - I can reproduce it every time. I just access the Jenkins URL with "/safeRestart", confirm restart and keep reloading the page every second. It shows the error approximately after 5 to 10 reloads. It's interesting that I don't see any stack trace in the console log. Jenkins 2.182 in a Docker container.   2019-06-28 21:20:09.963+0000 [id=318] INFO jenkins.model.Jenkins$23#run: Restart in 10 seconds 2019-06-28 21:20:19.964+0000 [id=318] INFO jenkins.model.Jenkins$23#run: Restarting VM as requested by roskinp 2019-06-28 21:20:19.965+0000 [id=318] INFO jenkins.model.Jenkins#cleanUp: Stopping Jenkins 2019-06-28 21:20:19.983+0000 [id=318] INFO jenkins.model.Jenkins$18#onAttained: Started termination 2019-06-28 21:20:19.993+0000 [id=318] INFO jenkins.model.Jenkins$18#onAttained: Completed termination 2019-06-28 21:20:19.993+0000 [id=318] INFO jenkins.model.Jenkins#_cleanUpDisconnectComputers: Starting node disconnection 2019-06-28 21:20:21.011+0000 [id=318] INFO jenkins.model.Jenkins#_cleanUpShutdownPluginManager: Stopping plugin manager 2019-06-28 21:20:21.026+0000 [id=318] INFO jenkins.model.Jenkins#_cleanUpPersistQueue: Persisting build queue 2019-06-28 21:20:21.028+0000 [id=318] INFO jenkins.model.Jenkins#_cleanUpAwaitDisconnects: Waiting for node disconnection completion 2019-06-28 21:20:21.033+0000 [id=318] INFO jenkins.model.Jenkins#cleanUp: Jenkins stopped Running from: /usr/share/jenkins/jenkins-stable.war webroot: EnvVars.masterEnvVars.get("JENKINS_HOME") 2019-06-28 21:20:23.482+0000 [id=1] INFO org.eclipse.jetty.util.log.Log#initialized: Logging initialized @595ms to org.eclipse.jetty.util.log.JavaUtilLog 2019-06-28 21:20:23.606+0000 [id=1] INFO winstone.Logger#logInternal: Beginning extraction from war file 2019-06-28 21:20:23.642+0000 [id=1] WARNING o.e.j.s.handler.ContextHandler#setContextPath: Empty contextPath 2019-06-28 21:20:23.704+0000 [id=1] INFO org.eclipse.jetty.server.Server#doStart: jetty-9.4.z-SNAPSHOT; built: 2019-05-02T00:04:53.875Z; git: e1bc35120a6617ee3df052294e433f3a25ce7097; jvm 1.8.0_181-8u181-b13-2~deb9u1-b13 2019-06-28 21:20:24.033+0000 [id=1] INFO o.e.j.w.StandardDescriptorProcessor#visitServlet: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet 2019-06-28 21:20:24.087+0000 [id=1] INFO o.e.j.s.s.DefaultSessionIdManager#doStart: DefaultSessionIdManager workerName=node0 2019-06-28 21:20:24.088+0000 [id=1] INFO o.e.j.s.s.DefaultSessionIdManager#doStart: No SessionScavenger set, using defaults 2019-06-28 21:20:24.091+0000 [id=1] INFO o.e.j.server.session.HouseKeeper#startScavenging: node0 Scavenging every 660000ms Jenkins home directory: /var/jenkins_home found at: EnvVars.masterEnvVars.get("JENKINS_HOME")   Here's what I see on the page. The same Jenkins container.   java.lang.IllegalStateException: Expected 1 instance of hudson.model.User$AllUsers but got 0 at hudson.ExtensionList.lookupSingleton(ExtensionList.java:451) at hudson.model.User$AllUsers.getInstance(User.java:1080) at hudson.model.User$AllUsers.get(User.java:1098) at hudson.model.User$AllUsers.access$100(User.java:1061) at hudson.model.User.getOrCreateById(User.java:517) at hudson.model.User.getById(User.java:615) at hudson.security.HttpSessionContextIntegrationFilter2.hasInvalidSessionSeed(HttpSessionContextIntegrationFilter2.java:87) at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:60) 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(Thread.java:748)

          Jeff Thompson added a comment -

          I tried that same sequence several times and still couldn't reproduce it. Frustrating.

          One possible approach might be to catch the exception in `hasInvalidSessionSeed()` and return false. That might do the job, but it's hard to be confident without being able to reproduce the issue. One argument against that approach is that the exception is correct – it's in an invalid state. Ignoring it here may just allow it to continue on to other issues. This one, at least, doesn't seem too hazardous. 

          Another possible approach might be to wait here until the system gets into a valid state. That sounds risky.

          What we really need to do is figure out how it got into the invalid state and handle that.

          Jeff Thompson added a comment - I tried that same sequence several times and still couldn't reproduce it. Frustrating. One possible approach might be to catch the exception in `hasInvalidSessionSeed()` and return false. That might do the job, but it's hard to be confident without being able to reproduce the issue. One argument against that approach is that the exception is correct – it's in an invalid state. Ignoring it here may just allow it to continue on to other issues. This one, at least, doesn't seem too hazardous.  Another possible approach might be to wait here until the system gets into a valid state. That sounds risky. What we really need to do is figure out how it got into the invalid state and handle that.

          Pavel Roskin added a comment -

          Yes, I confirm that it works. I patched the code, installed the new jenkins.war, restarted Jenkins 5 times with constant refreshes, did not see the backtrace or the Evil Jenkins picture. Without the patch, the issue is reproducible every time. Here's the patch I used:

          diff --git a/core/src/main/java/hudson/security/HttpSessionContextIntegrationFilter2.java b/core/src/main/java/hudson/security/HttpSessionContextIntegrationFilter2.java
          index 7a67c77dd0..2084651432 100644
          --- a/core/src/main/java/hudson/security/HttpSessionContextIntegrationFilter2.java
          +++ b/core/src/main/java/hudson/security/HttpSessionContextIntegrationFilter2.java
          @@ -84,7 +84,13 @@ public class HttpSessionContextIntegrationFilter2 extends HttpSessionContextInte
                       return false;
                   }
          .
          -        User userFromSession = User.getById(authentication.getName(), false);
          +        User userFromSession;
          +        try {
          +            userFromSession = User.getById(authentication.getName(), false);
          +        } catch (IllegalStateException e) {
          +            return false;
          +        }
          +
                   if (userFromSession == null) {
                       // no requirement for further test as there is no user inside
                       return false;
          

           

           

          Pavel Roskin added a comment - Yes, I confirm that it works. I patched the code, installed the new jenkins.war, restarted Jenkins 5 times with constant refreshes, did not see the backtrace or the Evil Jenkins picture. Without the patch, the issue is reproducible every time. Here's the patch I used: diff --git a/core/src/main/java/hudson/security/HttpSessionContextIntegrationFilter2.java b/core/src/main/java/hudson/security/HttpSessionContextIntegrationFilter2.java index 7a67c77dd0..2084651432 100644 --- a/core/src/main/java/hudson/security/HttpSessionContextIntegrationFilter2.java +++ b/core/src/main/java/hudson/security/HttpSessionContextIntegrationFilter2.java @@ -84,7 +84,13 @@ public class HttpSessionContextIntegrationFilter2 extends HttpSessionContextInte return false ; } . - User userFromSession = User.getById(authentication.getName(), false ); + User userFromSession; + try { + userFromSession = User.getById(authentication.getName(), false ); + } catch (IllegalStateException e) { + return false ; + } + if (userFromSession == null ) { // no requirement for further test as there is no user inside return false ;    

          Jeff Thompson added a comment -

          Thanks proski. That's what I was thinking of trying. At least you can test that it works. Would you like to submit a PR for that? If you do, be sure to @mention me (@jeffret-b on GitHub).

          I'm looking into an ATH test that is supposed to duplicate this issue but I haven't been able to get it configured correctly yet.

          Jeff Thompson added a comment - Thanks proski . That's what I was thinking of trying. At least you can test that it works. Would you like to submit a PR for that? If you do, be sure to @mention me (@jeffret-b on GitHub). I'm looking into an ATH test that is supposed to duplicate this issue but I haven't been able to get it configured correctly yet.

          Jeff Thompson added a comment -

          Inspired by proski's patch, I submitted a PR about this issue: https://github.com/jenkinsci/jenkins/pull/4107

          If anyone affected by this issue would like to review, comment, or especially test that proposal, please do.

          Jeff Thompson added a comment - Inspired by proski 's patch, I submitted a PR about this issue:  https://github.com/jenkinsci/jenkins/pull/4107 If anyone affected by this issue would like to review, comment, or especially test that proposal, please do.

          Oleg Nenashev added a comment -

          It was fixed in Jenkins 2.185

          Oleg Nenashev added a comment - It was fixed in Jenkins 2.185

          supjac m added a comment -

          I was getting the same error as the above. But now after the update, I don't get an error, Jenkins just stays on the restarting screen. This is the info from the err.log:

          INFO Restarting VM as requested by user
          INFO jenkins.model.Jenkins$18#onAttained: Started termination
          INFO jenkins.model.Jenkins#_cleanUpDisconnectComputers: Starting node disconnection
          INFO j.s.DefaultJnlpSlaveReceiver#channelClosed: restart thread for Slave1 terminated: java.nio.channels.ClosedChannelException
          INFO j.s.DefaultJnlpSlaveReceiver#channelClosed: restart thread for Slave2 terminated: java.nio.channels.ClosedChannelException
          INFO j.s.DefaultJnlpSlaveReceiver#channelClosed: restart thread for Slave3 terminated: java.nio.channels.ClosedChannelException
          INFO j.s.DefaultJnlpSlaveReceiver#channelClosed: restart thread for Slave4 terminated: java.nio.channels.ClosedChannelException
          INFO jenkins.model.Jenkins#_cleanUpShutdownPluginManager: Stopping plugin manager
          INFO h.p.virtualbox.VirtualBoxPlugin#stop: Stopping VirtualBoxPlugin
          INFO jenkins.model.Jenkins#_cleanUpPersistQueue: Persisting build queue
          INFO jenkins.model.Jenkins#_cleanUpAwaitDisconnects: Waiting for node disconnection completion
          INFO jenkins.model.Jenkins#cleanUp: Jenkins stopped
          WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.
          WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.
          WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.
          WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.
          WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.
          WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.
          WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session

          The warnings will repeat until I restart the service.
          I use Windows server 2012 R2 and Java 8.131
          jenkins username is not an admin for security purposes, but has appropriate permissions.

          supjac m added a comment - I was getting the same error as the above. But now after the update, I don't get an error, Jenkins just stays on the restarting screen. This is the info from the err.log: INFO Restarting VM as requested by user INFO jenkins.model.Jenkins$18#onAttained: Started termination INFO jenkins.model.Jenkins#_cleanUpDisconnectComputers: Starting node disconnection INFO j.s.DefaultJnlpSlaveReceiver#channelClosed: restart thread for Slave1 terminated: java.nio.channels.ClosedChannelException INFO j.s.DefaultJnlpSlaveReceiver#channelClosed: restart thread for Slave2 terminated: java.nio.channels.ClosedChannelException INFO j.s.DefaultJnlpSlaveReceiver#channelClosed: restart thread for Slave3 terminated: java.nio.channels.ClosedChannelException INFO j.s.DefaultJnlpSlaveReceiver#channelClosed: restart thread for Slave4 terminated: java.nio.channels.ClosedChannelException INFO jenkins.model.Jenkins#_cleanUpShutdownPluginManager: Stopping plugin manager INFO h.p.virtualbox.VirtualBoxPlugin#stop: Stopping VirtualBoxPlugin INFO jenkins.model.Jenkins#_cleanUpPersistQueue: Persisting build queue INFO jenkins.model.Jenkins#_cleanUpAwaitDisconnects: Waiting for node disconnection completion INFO jenkins.model.Jenkins#cleanUp: Jenkins stopped WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session. WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session. WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session. WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session. WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session. WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session. WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session The warnings will repeat until I restart the service. I use Windows server 2012 R2 and Java 8.131 jenkins username is not an admin for security purposes, but has appropriate permissions.

          Jeff Thompson added a comment -

          supjac, I was afraid the fix would shift the error around somehow. Since proski reported the fix worked for their scenarios, I decided to submit it to see if it helped some people. 

          It's interesting that, in your case at least, that it seems to start immediately after the "Jenkins stopped" message. Maybe there's something going on right at the start of the init sequence. Or maybe even before it somehow.

          Unfortunately, as I've been unable to reproduce the problem I've gone as far as I can with it. If someone else can figure out how to get more information about it or come with a proposal that would be great.

          Jeff Thompson added a comment - supjac , I was afraid the fix would shift the error around somehow. Since proski reported the fix worked for their scenarios, I decided to submit it to see if it helped some people.  It's interesting that, in your case at least, that it seems to start immediately after the "Jenkins stopped" message. Maybe there's something going on right at the start of the init sequence. Or maybe even before it somehow. Unfortunately, as I've been unable to reproduce the problem I've gone as far as I can with it. If someone else can figure out how to get more information about it or come with a proposal that would be great.

          Guilherme Emiliano Zanella added a comment - - edited

          I'm still with the same problem. I try to configure the artifactory and when I restart the jenkins after install or uninstall the artifactory plugin i got this error:

           

          "

          Stack trace

          java.lang.IllegalStateException: Expected 1 instance of hudson.model.User$AllUsers but got 0 at hudson.ExtensionList.lookupSingleton(ExtensionList.java:451) at hudson.model.User$AllUsers.getInstance(User.java:1080) at hudson.model.User$AllUsers.get(User.java:1098) at hudson.model.User$AllUsers.access$100(User.java:1061) at hudson.model.User.getOrCreateById(User.java:517) at hudson.model.User.getById(User.java:615) at hudson.security.HttpSessionContextIntegrationFilter2.hasInvalidSessionSeed(HttpSessionContextIntegrationFilter2.java:87) at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:60) 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:1701) 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:1668) 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:502) 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:765) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683) at java.lang.Thread.run(Thread.java:748)

          "

          Guilherme Emiliano Zanella added a comment - - edited I'm still with the same problem. I try to configure the artifactory and when I restart the jenkins after install or uninstall the artifactory plugin i got this error:   " Stack trace java.lang.IllegalStateException: Expected 1 instance of hudson.model.User$AllUsers but got 0 at hudson.ExtensionList.lookupSingleton(ExtensionList.java:451) at hudson.model.User$AllUsers.getInstance(User.java:1080) at hudson.model.User$AllUsers.get(User.java:1098) at hudson.model.User$AllUsers.access$100(User.java:1061) at hudson.model.User.getOrCreateById(User.java:517) at hudson.model.User.getById(User.java:615) at hudson.security.HttpSessionContextIntegrationFilter2.hasInvalidSessionSeed(HttpSessionContextIntegrationFilter2.java:87) at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:60) 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:1701) 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:1668) 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:502) 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:765) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683) at java.lang.Thread.run(Thread.java:748) "

          Jeff Thompson added a comment -

          gzanella, double-check your versions and make sure you've got the version of Jenkins that contains the change. The line numbers of your stack trace don't line up with changed version.

          Jeff Thompson added a comment - gzanella , double-check your versions and make sure you've got the version of Jenkins that contains the change. The line numbers of your stack trace don't line up with changed version.

          Jeff Thompson, I did "sudo apt-get upgrade jenkins" and after the upgrade i try to uninstall and install again and got the same error.

          "

          Stack trace

          java.lang.IllegalStateException: Expected 1 instance of hudson.model.User$AllUsers but got 0 at hudson.ExtensionList.lookupSingleton(ExtensionList.java:451) at hudson.model.User$AllUsers.getInstance(User.java:1080) at hudson.model.User$AllUsers.get(User.java:1098) at hudson.model.User$AllUsers.access$100(User.java:1061) at hudson.model.User.getOrCreateById(User.java:517) at hudson.model.User.getById(User.java:615) at hudson.security.HttpSessionContextIntegrationFilter2.hasInvalidSessionSeed(HttpSessionContextIntegrationFilter2.java:87) at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:60) 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:1701) 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:1668) 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:502) 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:765) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683) at java.lang.Thread.run(Thread.java:748)

          "

          Sorry but I still beginning with this tool and doesn't know much, what I do to fix this? Please..

          Guilherme Emiliano Zanella added a comment - Jeff Thompson, I did "sudo apt-get upgrade jenkins" and after the upgrade i try to uninstall and install again and got the same error. " Stack trace java.lang.IllegalStateException: Expected 1 instance of hudson.model.User$AllUsers but got 0 at hudson.ExtensionList.lookupSingleton(ExtensionList.java:451) at hudson.model.User$AllUsers.getInstance(User.java:1080) at hudson.model.User$AllUsers.get(User.java:1098) at hudson.model.User$AllUsers.access$100(User.java:1061) at hudson.model.User.getOrCreateById(User.java:517) at hudson.model.User.getById(User.java:615) at hudson.security.HttpSessionContextIntegrationFilter2.hasInvalidSessionSeed(HttpSessionContextIntegrationFilter2.java:87) at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:60) 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:1701) 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:1668) 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:502) 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:765) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683) at java.lang.Thread.run(Thread.java:748) " Sorry but I still beginning with this tool and doesn't know much, what I do to fix this? Please..

          Jeff Thompson added a comment -

          gzanella, I'm not sure what version that will give you. When you run Jenkins, which version does it say you have?

          Jeff Thompson added a comment - gzanella , I'm not sure what version that will give you. When you run Jenkins, which version does it say you have?

          Jeff Thompson

          Says I have the Jenkins 2.176.2.

          About Jenkins 2.176.2 [Jenkins].pdf

          Guilherme Emiliano Zanella added a comment - Jeff Thompson Says I have the Jenkins 2.176.2. About Jenkins 2.176.2 [Jenkins].pdf

          Jeff Thompson added a comment -

          That explains your observations, gzanella. The change went into the 2.185 weekly release. You've got the latest LTS release, which doesn't have this change. You could request this change be backported to the next incremental release of the LTS. I would be hesitant to backport this, given its experimental nature and we have a report of the change not fixing things for someone. You could switch from using the LTS line to the weekly. See [LTS Release Line](https://jenkins.io/download/lts/) for more information.

          Jeff Thompson added a comment - That explains your observations, gzanella . The change went into the 2.185 weekly release. You've got the latest LTS release, which doesn't have this change. You could request this change be backported to the next incremental release of the LTS. I would be hesitant to backport this, given its experimental nature and we have a report of the change not fixing things for someone. You could switch from using the LTS line to the weekly. See [LTS Release Line] ( https://jenkins.io/download/lts/ ) for more information.

          I do this and the error has gone. Thank you for help!

          Guilherme Emiliano Zanella added a comment - I do this and the error has gone. Thank you for help!

          supjac m added a comment -

          so, I have fixed the issue with my jenkins setup.
          After looking into the WindowsServiceLifecycle, i noticed that the command to restart was restart! When I tried that in the command line I got my actual error:
          Unhandled Exception: System.IO.FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
          So jenkins was not actually restarting, just getting through the cleanup phase
          I installed .net 3.5 but was still getting the same error. I had to modify my Jenkins.exe.config to look like this:
          <startup>
          <startup useLegacyV2RuntimeActivationPolicy="true">
          <supportedRuntime version="v4.0" />
          </startup>

          Now it is working for me

          supjac m added a comment - so, I have fixed the issue with my jenkins setup. After looking into the WindowsServiceLifecycle, i noticed that the command to restart was restart! When I tried that in the command line I got my actual error: Unhandled Exception: System.IO.FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. So jenkins was not actually restarting, just getting through the cleanup phase I installed .net 3.5 but was still getting the same error. I had to modify my Jenkins.exe.config to look like this: <startup> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0" /> </startup> Now it is working for me

          Simon Tunnat added a comment -

          I have the same problem with Jenkins LTS 2.176.2. Could you please fix that version as well?

          Simon Tunnat added a comment - I have the same problem with Jenkins LTS 2.176.2. Could you please fix that version as well?

          Jeff Thompson added a comment -

          simontunnat, you are welcome to request this change be backported. Since supjac, determined their continued failures were unrelated I no longer object to backporting.

          Jeff Thompson added a comment - simontunnat , you are welcome to request this change be backported. Since supjac , determined their continued failures were unrelated I no longer object to backporting.

          Simon Tunnat added a comment -

          jthompson how / where do I have to request such a backport?

          Simon Tunnat added a comment - jthompson how / where do I have to request such a backport?

          Jeff Thompson added a comment -

          simontunnat, as I mentioned above, you can read about the LTS releases, including backports, at https://jenkins.io/download/lts/

          Jeff Thompson added a comment - simontunnat , as I mentioned above, you can read about the LTS releases, including backports, at  https://jenkins.io/download/lts/

          Lübbe Onken added a comment - - edited

          The issue is not yet resolved.

          We have exactly the same problem as supjac in #comment-371811.

          Just updated Jenkins from 2.219 to 2.220, Windows Server 2016 and a dedicated jenkins user.

          Jenkins gets into this infinite loop when we try to restart it from the web frontend.
          The jenkins service always has to be restarted manually after a jenkins or plugin update.

          No problems restarting jenkins from the web frontend when it runs as system user directly after the installation.

           

          2020-02-11 10:38:05.853+0000 [id=770] INFO jenkins.model.Jenkins#cleanUp: Stopping Jenkins
          2020-02-11 10:38:05.868+0000 [id=770] INFO jenkins.model.Jenkins$18#onAttained: Started termination
          2020-02-11 10:38:05.946+0000 [id=770] INFO jenkins.model.Jenkins$18#onAttained: Completed termination
          2020-02-11 10:38:05.946+0000 [id=770] INFO jenkins.model.Jenkins#_cleanUpDisconnectComputers: Starting node disconnection
          2020-02-11 10:38:05.962+0000 [id=770] INFO jenkins.model.Jenkins#_cleanUpShutdownPluginManager: Stopping plugin manager
          2020-02-11 10:38:05.962+0000 [id=770] INFO jenkins.model.Jenkins#_cleanUpPersistQueue: Persisting build queue
          2020-02-11 10:38:05.979+0000 [id=770] INFO jenkins.model.Jenkins#_cleanUpAwaitDisconnects: Waiting for node disconnection completion
          2020-02-11 10:38:05.979+0000 [id=770] INFO jenkins.model.Jenkins#cleanUp: Jenkins stopped
          2020-02-11 10:38:06.103+0000 [id=12] WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.
          2020-02-11 10:38:11.133+0000 [id=603] WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.
          2020-02-11 10:38:16.164+0000 [id=632] WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.
          2020-02-11 10:38:21.193+0000 [id=12] WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.
          2020-02-11 10:38:26.211+0000 [id=603] WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.

          Lübbe Onken added a comment - - edited The issue is not yet resolved. We have exactly the same problem as supjac in #comment-371811. Just updated Jenkins from 2.219 to 2.220, Windows Server 2016 and a dedicated jenkins user. Jenkins gets into this infinite loop when we try to restart it from the web frontend. The jenkins service always has to be restarted manually after a jenkins or plugin update. No problems restarting jenkins from the web frontend when it runs as system user directly after the installation.   2020-02-11 10:38:05.853+0000 [id=770] INFO jenkins.model.Jenkins#cleanUp: Stopping Jenkins 2020-02-11 10:38:05.868+0000 [id=770] INFO jenkins.model.Jenkins$18#onAttained: Started termination 2020-02-11 10:38:05.946+0000 [id=770] INFO jenkins.model.Jenkins$18#onAttained: Completed termination 2020-02-11 10:38:05.946+0000 [id=770] INFO jenkins.model.Jenkins#_cleanUpDisconnectComputers: Starting node disconnection 2020-02-11 10:38:05.962+0000 [id=770] INFO jenkins.model.Jenkins#_cleanUpShutdownPluginManager: Stopping plugin manager 2020-02-11 10:38:05.962+0000 [id=770] INFO jenkins.model.Jenkins#_cleanUpPersistQueue: Persisting build queue 2020-02-11 10:38:05.979+0000 [id=770] INFO jenkins.model.Jenkins#_cleanUpAwaitDisconnects: Waiting for node disconnection completion 2020-02-11 10:38:05.979+0000 [id=770] INFO jenkins.model.Jenkins#cleanUp: Jenkins stopped 2020-02-11 10:38:06.103+0000 [id=12] WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session. 2020-02-11 10:38:11.133+0000 [id=603] WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session. 2020-02-11 10:38:16.164+0000 [id=632] WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session. 2020-02-11 10:38:21.193+0000 [id=12] WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session. 2020-02-11 10:38:26.211+0000 [id=603] WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.

          luebbe is right - we have the same issue where jenkins.err.log shows:

          Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.

          We use Jenkins 2.255 on Windows Server 2016

          Niels Kristian Jensen added a comment - luebbe is right - we have the same issue where jenkins.err.log shows: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session. We use Jenkins 2.255 on Windows Server 2016

          ethorsa added a comment -

          I can confirm the problem on windows hosted Jenkins v2.235.5.

          ethorsa added a comment - I can confirm the problem on windows hosted Jenkins v2.235.5.

          Niels Kristian Jensen added a comment - - edited

          The issue is still there in Jenkins 2.249.1 on Windows Server 2019 and a dedicated jenkins user.

          Niels Kristian Jensen added a comment - - edited The issue is still there in Jenkins 2.249.1 on Windows Server 2019 and a dedicated jenkins user.

          Alex added a comment -

          I got the same flood of errors on Jenkins 2.263.1

          WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.
          

          Took a look at jenkins.wrapper.log and noticed

          2021-01-11 00:37:42,243 FATAL - WMI Operation failure: AccessDenied
          WMI.WmiException: AccessDenied
             at WMI.WmiRoot.BaseHandler.CheckError(ManagementBaseObject result)
             at WMI.WmiRoot.InstanceHandler.Invoke(Object proxy, MethodInfo method, Object[] arguments)
             at winsw.WrapperService.<Run>g__Restart|33_5(<>c__DisplayClass33_0& )
             at winsw.WrapperService.Run(String[] _args, ServiceDescriptor descriptor)
             at winsw.WrapperService.Main(String[] args)
          

          So it looks like the Web UI /restart endpoint is trying to actually restart a Windows service, for which it does not have permissions if running as a limited user. To fix this, it is possible to run Jenkins as a member of Power Users or Administrators group, but I chose to grant permissions for restarting only the Jenkins service.

          Using setacl, to view permissions:
          SetACL.exe -on jenkins -ot srv -actn list
          To grant service restart permissions ('jenkins' is the name of the service and 'domain\user' should be replaced with actual values):
          SetACL.exe -on jenkins -ot srv -actn ace -ace "n:domain\user;p:start_stop;m:grant"

          Tried it, and it worked for me.

          Alex added a comment - I got the same flood of errors on Jenkins 2.263.1 WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session. Took a look at jenkins.wrapper.log and noticed 2021-01-11 00:37:42,243 FATAL - WMI Operation failure: AccessDenied WMI.WmiException: AccessDenied at WMI.WmiRoot.BaseHandler.CheckError(ManagementBaseObject result) at WMI.WmiRoot.InstanceHandler.Invoke(Object proxy, MethodInfo method, Object[] arguments) at winsw.WrapperService.<Run>g__Restart|33_5(<>c__DisplayClass33_0& ) at winsw.WrapperService.Run(String[] _args, ServiceDescriptor descriptor) at winsw.WrapperService.Main(String[] args) So it looks like the Web UI /restart endpoint is trying to actually restart a Windows service, for which it does not have permissions if running as a limited user. To fix this, it is possible to run Jenkins as a member of Power Users or Administrators group, but I chose to grant permissions for restarting only the Jenkins service. Using setacl , to view permissions: SetACL.exe -on jenkins -ot srv -actn list To grant service restart permissions ('jenkins' is the name of the service and 'domain\user' should be replaced with actual values): SetACL.exe -on jenkins -ot srv -actn ace -ace "n:domain\user;p:start_stop;m:grant" Tried it, and it worked for me.

          Niels Kristian Jensen added a comment - We no longer have the issue, after applying the fix seen here: https://issues.jenkins.io/browse/JENKINS-50219?focusedCommentId=338697&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-338697

          ethorsa added a comment -

          nkjensen unfortunately this didn't help in my case, I still get an IllegalStateException and stuck Jenkins.

          ethorsa added a comment - nkjensen  unfortunately this didn't help in my case, I still get an IllegalStateException and stuck Jenkins.

          Lots of discussion about this on Windows. Are people seeing this on Linux?

          Also, below is our exact error. It has the same Expected instance syntax, but it isn't referencing the AllUsers, so I wonder if this is something different.

          java.lang.IllegalStateException: Expected 1 instance of jenkins.security.s2m.AdminWhitelistRule but got 0
          at hudson.ExtensionList.lookupSingleton(ExtensionList.java:451)
          at io.jenkins.plugins.casc.core.AdminWhitelistRuleConfigurator.instance(AdminWhitelistRuleConfigurator.java:59)
          at io.jenkins.plugins.casc.core.AdminWhitelistRuleConfigurator.instance(AdminWhitelistRuleConfigurator.java:42)
          at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:286)
          at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:351)
          at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:287)
          at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$checkWith$8(ConfigurationAsCode.java:777)
          at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:713)
          at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:777)
          at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:762)
          at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:638)
          at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:307)
          at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:299)

          Doug Whitfield added a comment - Lots of discussion about this on Windows. Are people seeing this on Linux? Also, below is our exact error. It has the same Expected instance syntax, but it isn't referencing the AllUsers, so I wonder if this is something different. java.lang.IllegalStateException: Expected 1 instance of jenkins.security.s2m.AdminWhitelistRule but got 0 at hudson.ExtensionList.lookupSingleton(ExtensionList.java:451) at io.jenkins.plugins.casc.core.AdminWhitelistRuleConfigurator.instance(AdminWhitelistRuleConfigurator.java:59) at io.jenkins.plugins.casc.core.AdminWhitelistRuleConfigurator.instance(AdminWhitelistRuleConfigurator.java:42) at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:286) at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:351) at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:287) at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$checkWith$8(ConfigurationAsCode.java:777) at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:713) at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:777) at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:762) at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:638) at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:307) at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:299)

          ethorsa added a comment - - edited

          I'm having the same problem on a RHEL Jenkins:

          java.lang.IllegalStateException: Expected 1 instance of jenkins.security.s2m.AdminWhitelistRule but got 0
          	at hudson.ExtensionList.lookupSingleton(ExtensionList.java:452)
          	at io.jenkins.plugins.casc.core.AdminWhitelistRuleConfigurator.instance(AdminWhitelistRuleConfigurator.java:59)
          	at io.jenkins.plugins.casc.core.AdminWhitelistRuleConfigurator.instance(AdminWhitelistRuleConfigurator.java:42)
          	at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:285)
          	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:350)
          	at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:286)
          	at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$checkWith$8(ConfigurationAsCode.java:776)
          	at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:712)
          	at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:776)
          	at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:761)
          	at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:637)
          	at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:306)
          	at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:298)

          ethorsa added a comment - - edited I'm having the same problem on a RHEL Jenkins: java.lang.IllegalStateException: Expected 1 instance of jenkins.security.s2m.AdminWhitelistRule but got 0 at hudson.ExtensionList.lookupSingleton(ExtensionList.java:452) at io.jenkins.plugins.casc.core.AdminWhitelistRuleConfigurator.instance(AdminWhitelistRuleConfigurator.java:59) at io.jenkins.plugins.casc.core.AdminWhitelistRuleConfigurator.instance(AdminWhitelistRuleConfigurator.java:42) at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:285) at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:350) at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:286) at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$checkWith$8(ConfigurationAsCode.java:776) at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:712) at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:776) at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:761) at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:637) at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:306) at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:298)

            jthompson Jeff Thompson
            artem_fedorov Artem Fedorov
            Votes:
            17 Vote for this issue
            Watchers:
            30 Start watching this issue

              Created:
              Updated: