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

Illegal state exception if navigating pages during Jenkins 2.0 startup

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core
    • Labels:
    • Environment:
    • Similar Issues:

      Description

      Jenkins layouts must not invoke getActiveInstance() during the startup.

      Mar 22, 2016 5:26:51 PM org.eclipse.jetty.util.log.JavaUtilLog warn
      WARNING: EXCEPTION 
      javax.servlet.ServletException: org.apache.commons.jelly.JellyTagException: jar:file:/var/cache/jenkins/war/WEB-INF/lib/jenkins-core-2.0-alpha-5-SNAPSHOT.jar!/lib/layout/layout.jelly:161:89: <j:invokeStatic> method getActiveInstance threw exception: Jenkins has not been started, or was already shut down
      	at org.kohsuke.stapler.jelly.JellyRequestDispatcher.forward(JellyRequestDispatcher.java:60)
      	at hudson.util.HudsonIsRestarting.doDynamic(HudsonIsRestarting.java:45)
      	at sun.reflect.GeneratedMethodAccessor169.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:324)
      	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:167)
      	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:100)
      	at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:403)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
      	at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:595)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      	at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:191)
      	at org.eclipse.jetty.server.Dispatcher.error(Dispatcher.java:77)
      	at org.eclipse.jetty.server.handler.ErrorHandler.handle(ErrorHandler.java:92)
      	at org.eclipse.jetty.server.Response.sendError(Response.java:597)
      	at org.eclipse.jetty.server.Response.sendError(Response.java:544)
      	at javax.servlet.http.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:167)
      	at javax.servlet.http.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:167)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:857)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
      	at hudson.init.impl.InstallUncaughtExceptionHandler$1.reportException(InstallUncaughtExceptionHandler.java:27)
      	at org.kohsuke.stapler.compression.CompressionFilter.reportException(CompressionFilter.java:77)
      	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:55)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      	at org.eclipse.jetty.server.Server.handle(Server.java:499)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
      	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
      	at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: org.apache.commons.jelly.JellyTagException: jar:file:/var/cache/jenkins/war/WEB-INF/lib/jenkins-core-2.0-alpha-5-SNAPSHOT.jar!/lib/layout/layout.jelly:161:89: <j:invokeStatic> method getActiveInstance threw exception: Jenkins has not been started, or was already shut down
      	at org.apache.commons.jelly.tags.core.InvokeStaticTag.doTag(InvokeStaticTag.java:148)
      	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
      	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      	at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
      	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      	at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
      	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      	at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
      	at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:120)
      	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      	at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
      	at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:95)
      	at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:63)
      	at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:53)
      	at org.kohsuke.stapler.jelly.JellyRequestDispatcher.forward(JellyRequestDispatcher.java:55)
      	... 58 more
      Caused by: java.lang.IllegalStateException: Jenkins has not been started, or was already shut down
      	at jenkins.model.Jenkins.getActiveInstance(Jenkins.java:726)
      	at sun.reflect.GeneratedMethodAccessor166.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.apache.commons.jelly.tags.core.InvokeStaticTag.doTag(InvokeStaticTag.java:125)
      	... 72 more
      

        Attachments

          Issue Links

            Activity

            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Keith Zantow I've updated the issue's environment section. It has happened after the first start after WAR replacement from 1.642.2. I've pressed "Install recommended plugin", then the instance has been restarted with this error

            Show
            oleg_nenashev Oleg Nenashev added a comment - Keith Zantow I've updated the issue's environment section. It has happened after the first start after WAR replacement from 1.642.2. I've pressed "Install recommended plugin", then the instance has been restarted with this error
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: kzantow
            Path:
            core/src/main/resources/lib/layout/layout.jelly
            http://jenkins-ci.org/commit/jenkins/8f094a41bc94053403bf65cac5f9183a192ce03a
            Log:
            JENKINS-33728 - Remove stray getActiveInstance call in layout.jelly

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: kzantow Path: core/src/main/resources/lib/layout/layout.jelly http://jenkins-ci.org/commit/jenkins/8f094a41bc94053403bf65cac5f9183a192ce03a Log: JENKINS-33728 - Remove stray getActiveInstance call in layout.jelly
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Daniel Beck
            Path:
            core/src/main/resources/lib/layout/layout.jelly
            http://jenkins-ci.org/commit/jenkins/ef24fd6a76e348b78fd57bbd3cf41b6fbf42f230
            Log:
            Merge pull request #2164 from kzantow/JENKINS-33728-dont-call-getactiveinstance-in-layoutjelly

            JENKINS-33728 - Remove stray getActiveInstance call in layout.jelly

            Compare: https://github.com/jenkinsci/jenkins/compare/6a355ae3dfb9...ef24fd6a76e3

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/resources/lib/layout/layout.jelly http://jenkins-ci.org/commit/jenkins/ef24fd6a76e348b78fd57bbd3cf41b6fbf42f230 Log: Merge pull request #2164 from kzantow/ JENKINS-33728 -dont-call-getactiveinstance-in-layoutjelly JENKINS-33728 - Remove stray getActiveInstance call in layout.jelly Compare: https://github.com/jenkinsci/jenkins/compare/6a355ae3dfb9...ef24fd6a76e3
            Hide
            kzantow Keith Zantow added a comment -

            Oleg Nenashev could you validate the fix for this at your convenience?

            Show
            kzantow Keith Zantow added a comment - Oleg Nenashev could you validate the fix for this at your convenience?
            Hide
            danielbeck Daniel Beck added a comment -

            I'm pretty sure this is fixed.

            Show
            danielbeck Daniel Beck added a comment - I'm pretty sure this is fixed.

              People

              • Assignee:
                kzantow Keith Zantow
                Reporter:
                oleg_nenashev Oleg Nenashev
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: