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

Sometimes the download of artifacts fails in build scripts of other projects - Caused by: java.lang.IllegalStateException: Cannot create a session after the response has been committed

    Details

    • Similar Issues:

      Description

      I am using Jenkins ver. 1.622 and sometimes the download of artefacts fails for me. In the Logs I find this stacktrace:

      Caught exception evaluating: if (request.session.attribute('from')Unable to render embedded object: File (=null) request.session.getAttribute('from'); else if (request.getParameter('from')) not found.=null) request.getParameter('from'); else if (request.requestURI=='/loginError' || request.requestURI=='/login') '/'; else request.requestURI; in /hudson//job/JavaERP%20Core%20Artefacts/lastSuccessfulBuild/artifact/Core/artefacts/ikoffice-core-fullserver.zip. Reason: java.lang.reflect.InvocationTargetException java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor189.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125) at org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:314) at org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185) at org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75) at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83) at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57) at org.apache.commons.jexl.parser.ASTNENode.value(ASTNENode.java:55) at org.apache.commons.jexl.parser.ASTExpression.value(ASTExpression.java:54) at org.apache.commons.jexl.parser.ASTIfStatement.value(ASTIfStatement.java:60) at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80) at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:74) at org.apache.commons.jelly.expression.ExpressionSupport.evaluateRecurse(ExpressionSupport.java:61) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:263) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161) at org.apache.commons.jelly.tags.core.InvokeStaticTag.doTag(InvokeStaticTag.java:120) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269) 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.IncludeTag.doTag(IncludeTag.java:147) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269) 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.IncludeTag.doTag(IncludeTag.java:147) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161) at org.apache.commons.jelly.tags.core.OtherwiseTag.doTag(OtherwiseTag.java:41) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161) at org.apache.commons.jelly.tags.core.ChooseTag.doTag(ChooseTag.java:38) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98) 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.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.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.JellyFacet$1.dispatch(JellyFacet.java:95) 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 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:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:613) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1086) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:659) at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1558) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1515) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalStateException: Cannot create a session after the response has been committed at org.apache.catalina.connector.Request.doGetSession(Request.java:2872) at org.apache.catalina.connector.Request.getSession(Request.java:2249) at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:895) at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:907) at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:240) ... 87 more

      This looks suspiciously similar to Hudson Issue https://bugs.eclipse.org/bugs/show_bug.cgi?id=445550, and when looking at the patch it seems reasonable that this would fix my issues. 

      Could you please integrate patch https://git.eclipse.org/c/hudson/org.eclipse.hudson.core.git/commit/?id=6f9259819a82d62d1bab96ce9eee2e807e81a688 into the current jenkins release for me?

      Regards,

      Daniel Migowski

        Attachments

          Issue Links

            Activity

            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            I agree, it makes sense to consider a similar patch.

            I have updated the component, so that anybody can pick this issue

            Show
            oleg_nenashev Oleg Nenashev added a comment - I agree, it makes sense to consider a similar patch. I have updated the component, so that anybody can pick this issue
            Hide
            tonho Elton Alves added a comment -

            How can i reproduce this bug?

            Show
            tonho Elton Alves added a comment - How can i reproduce this bug?
            Hide
            danielbeck Daniel Beck added a comment -

            Please don't file issues for releases that are several years old. Troubleshooting just way too often results in "oh, this was fixed months ago", and is a waste of everyone's time.

            Show
            danielbeck Daniel Beck added a comment - Please don't file issues for releases that are several years old. Troubleshooting just way too often results in "oh, this was fixed months ago", and is a waste of everyone's time.
            Hide
            danielbeck Daniel Beck added a comment -

            In fact, the patch is for code that was ripped out to address JENKINS-31618. Reading the code, it seems to address this issue as well by calling getSession(false).

            So, I have to correct what I wrote above. It was probably fixed (~1.5) years ago, in Jenkins 2.4.

            Oleg Nenashev Can we please start rejecting bug reports for ancient releases for being a waste of time?

            Show
            danielbeck Daniel Beck added a comment - In fact, the patch is for code that was ripped out to address JENKINS-31618 . Reading the code, it seems to address this issue as well by calling getSession(false) . So, I have to correct what I wrote above. It was probably fixed (~1.5) years ago, in Jenkins 2.4. Oleg Nenashev Can we please start rejecting bug reports for ancient releases for being a waste of time?
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Daniel Beck Let's add it to https://wiki.jenkins.io/display/JENKINS/How+to+report+an+issue . In this case I just though it's reasonable after a quick code check. Was to quick for sure, I just sorted _unsorted

            Show
            oleg_nenashev Oleg Nenashev added a comment - Daniel Beck Let's add it to https://wiki.jenkins.io/display/JENKINS/How+to+report+an+issue . In this case I just though it's reasonable after a quick code check. Was to quick for sure, I just sorted _unsorted
            Hide
            dmigowski dmigowski added a comment -

            Sorry for posting this, but I didn't find the exception somewhere else in the issue tracker so I thought this wasn't handled yet. I will update the next time before posting a bug.

            How old can a version be to be allowed to have bug reports posted to it? I just ask because some bugs only occur spurious and at the time when the bug arises there is often a new version already out.

            Show
            dmigowski dmigowski added a comment - Sorry for posting this, but I didn't find the exception somewhere else in the issue tracker so I thought this wasn't handled yet. I will update the next time before posting a bug. How old can a version be to be allowed to have bug reports posted to it? I just ask because some bugs only occur spurious and at the time when the bug arises there is often a new version already out.
            Hide
            danielbeck Daniel Beck added a comment -

            dmigowski As you can see in Oleg's comment, no firm rules.

            "Weeks old" is good. "Years old" is bad. In between it's a judgment call, perhaps up to 3-6 months or so? Should also be doable with a reasonable upgrade schedule.

            Show
            danielbeck Daniel Beck added a comment - dmigowski As you can see in Oleg's comment, no firm rules. "Weeks old" is good. "Years old" is bad. In between it's a judgment call, perhaps up to 3-6 months or so? Should also be doable with a reasonable upgrade schedule.

              People

              • Assignee:
                Unassigned
                Reporter:
                dmigowski dmigowski
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: