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

Got IllegalStateException while restart Jenkins

    Details

    • Similar Issues:
    • Released As:
      Jenkins 2.185

      Description

      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

        Attachments

          Activity

          Hide
          jthompson Jeff Thompson added a comment -

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

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

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

          Show
          simontunnat Simon Tunnat added a comment - Jeff Thompson how / where do I have to request such a backport?
          Hide
          jthompson Jeff Thompson added a comment -

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

          Show
          jthompson Jeff Thompson added a comment - Simon Tunnat , as I mentioned above, you can read about the LTS releases, including backports, at  https://jenkins.io/download/lts/
          Hide
          luebbe Lübbe Onken added a comment - - edited

          The issue is not yet resolved.

          We have exactly the same problem as supjac m 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.

          Show
          luebbe Lübbe Onken added a comment - - edited The issue is not yet resolved. We have exactly the same problem as supjac m 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.
          Hide
          nkjensen Niels Kristian Jensen added a comment -

          Lübbe Onken 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

          Show
          nkjensen Niels Kristian Jensen added a comment - Lübbe Onken 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

            People

            • Assignee:
              jthompson Jeff Thompson
              Reporter:
              artem_fedorov Artem Fedorov
            • Votes:
              14 Vote for this issue
              Watchers:
              27 Start watching this issue

              Dates

              • Created:
                Updated: