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

Monitor View with Failing Multi-Branch pipeline build - ERROR - Caused by: java.lang.IllegalStateException: WRITER

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • build-monitor-plugin
    • None
    • Jenkins 2.407 and Build Monitor View
      Version version 1.14-702.vf34cc4398955

      We created a new Monitor View and we are getting: "Sorry to bother you, but Jenkins is having a problem "

       

      The above happen only for some multi-branch pipeline jobs and only if the build fails. It works fine if the last build was successful.

       

      We checked the Jenkins Log and we can see this the error stack below. Could someone please provide a workaround?

       

      2023-06-16 09:11:45.392+0000 [id=2865971] WARNING o.e.jetty.server.HttpChannel#handleException: /$stapler/bound/9182f9e2-26f1-4a3f-b73f-1a8a39c329e0/fetchJobViews
      org.apache.commons.jelly.JellyTagException: jar:file:/var/cache/jenkins/war/WEB-INF/lib/jenkins-core-2.407.jar!/jenkins/security/FrameOptionsPageDecorator/httpHeaders.jelly:4:63: <st:header> WRITER
      at org.apache.commons.jelly.impl.TagScript.handleException(TagScript.java:719)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:277)
      at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98)
      at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
      at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:99)
      at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:172)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:265)
      at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)
      at org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:150)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:265)
      at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98)
      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.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:101)
      at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:265)
      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:122)
      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:122)
      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:99)
      at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:66)
      at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:55)
      at org.kohsuke.stapler.jelly.ScriptInvoker.execute(ScriptInvoker.java:56)
      at org.kohsuke.stapler.jelly.ScriptInvoker.execute(ScriptInvoker.java:43)
      at org.kohsuke.stapler.Facet$1.dispatch(Facet.java:240)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:770)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:900)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:698)
      at hudson.init.impl.InstallUncaughtExceptionHandler.handleException(InstallUncaughtExceptionHandler.java:59)
      at hudson.init.impl.InstallUncaughtExceptionHandler.lambda$init$0(InstallUncaughtExceptionHandler.java:33)
      at org.kohsuke.stapler.compression.CompressionFilter.reportException(CompressionFilter.java:72)
      at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:56)
      at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:86)
      at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      at jenkins.security.SuspiciousRequestFilter.doFilter(SuspiciousRequestFilter.java:38)
      at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:527)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131)
      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:549)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:223)
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1570)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1384)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:484)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1543)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1306)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
      at org.eclipse.jetty.server.Server.handle(Server.java:563)
      at org.eclipse.jetty.server.HttpChannel.lambda$handle$0(HttpChannel.java:505)
      at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:762)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:497)
      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:282)
      at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:314)
      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
      at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
      at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:416)
      at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:385)
      at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:272)
      at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.lambda$new$0(AdaptiveExecutionStrategy.java:140)
      at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:411)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:969)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1194)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1149)
      at java.base/java.lang.Thread.run(Thread.java:829)
      Caused by: java.lang.IllegalStateException: WRITER
      at org.eclipse.jetty.server.Response.getOutputStream(Response.java:868)
      at javax.servlet.ServletResponseWrapper.getOutputStream(ServletResponseWrapper.java:100)
      at org.kohsuke.stapler.compression.CompressionServletResponse.activate(CompressionServletResponse.java:61)
      at org.kohsuke.stapler.compression.CompressionFilter.activate(CompressionFilter.java:104)
      at org.kohsuke.stapler.ResponseImpl.getCompressedOutputStream(ResponseImpl.java:322)
      at org.kohsuke.stapler.jelly.DefaultScriptInvoker.lambda$createOutputStream$0(DefaultScriptInvoker.java:121)
      at org.kohsuke.stapler.jelly.DefaultScriptInvoker$LazyOutputStreamSupplier.get(DefaultScriptInvoker.java:110)
      at org.kohsuke.stapler.jelly.DefaultScriptInvoker$1.write(DefaultScriptInvoker.java:136)
      at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)
      at java.base/sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:312)
      at java.base/sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:316)
      at java.base/sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:153)
      at java.base/java.io.OutputStreamWriter.flush(OutputStreamWriter.java:251)
      at java.base/java.io.BufferedWriter.flush(BufferedWriter.java:257)
      at org.dom4j.io.XMLWriter.flush(XMLWriter.java:275)
      at org.apache.commons.jelly.XMLOutput.flush(XMLOutput.java:127)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:267)
      ... 79 more
      Caused: javax.servlet.ServletException
      at org.kohsuke.stapler.Facet$1.dispatch(Facet.java:249)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:770)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:900)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:698)
      at hudson.init.impl.InstallUncaughtExceptionHandler.handleException(InstallUncaughtExceptionHandler.java:59)
      at hudson.init.impl.InstallUncaughtExceptionHandler.lambda$init$0(InstallUncaughtExceptionHandler.java:33)
      at org.kohsuke.stapler.compression.CompressionFilter.reportException(CompressionFilter.java:72)
      at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:56)
      at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:86)
      at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      at jenkins.security.SuspiciousRequestFilter.doFilter(SuspiciousRequestFilter.java:38)
      at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:527)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131)
      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:549)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:223)
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1570)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1384)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:484)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1543)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1306)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
      at org.eclipse.jetty.server.Server.handle(Server.java:563)
      at org.eclipse.jetty.server.HttpChannel.lambda$handle$0(HttpChannel.java:505)
      at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:762)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:497)
      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:282)
      at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:314)
      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
      at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
      at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:416)
      at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:385)
      at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:272)
      at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.lambda$new$0(AdaptiveExecutionStrategy.java:140)
      at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:411)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:969)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1194)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1149)
      at java.base/java.lang.Thread.run(Thread.java:829)
      

       

        1. build-monitor-page.png
          build-monitor-page.png
          109 kB
        2. plugins.txt
          2 kB
        3. run-jenkins.sh
          0.9 kB

          [JENKINS-71469] Monitor View with Failing Multi-Branch pipeline build - ERROR - Caused by: java.lang.IllegalStateException: WRITER

          Mark Waite added a comment -

          I'm unable to duplicate the problem based on the information that you provided. You'll need to provide more information so that others can duplicate the issue. "How to report an issue" provides a list of the types of information needed.

          Steps I took while trying to duplicate the issue:

          1. Create a plugins.txt file with the exact plugins I used and their versions
          2. Create a run-jenkins.sh script that downloads Jenkins 2.407 and the plugins listed in plugins.txt
          3. Run the run-jenkins.sh script and complete the setup wizard by downloading no additional plugins and creating a user
          4. Define a failing multibranch Pipeline using https://github.com/jenkinsci/elastic-axis-plugin as the branch source
          5. Define a freestyle job and run it several times as a stable build
          6. Define a Pipeline job and run it several times as a stable build
          7. Define a folder and add a Pipeline and a freestyle job to the folder, run them both
          8. Define a build monitor view that recurses folders and select the items in the view with the regular expression ".*"
          9. Confirm that all 6 jobs are displayed in the build monitor view, with 2 failing and 4 passing

          The resulting status monitor page looks like this:

          I was surprised to see stack traces in the console output of my Jenkins controller. Those stack traces did not seem to affect the rendering of the page, but they were surprising. They included text like:

          2023-06-17 13:21:04.086+0000 [id=18]    WARNING o.k.s.f.adjunct.AdjunctsInPage#findNeeded: No such adjunct found: org.kohsuke.stapler.framework.prototype.prototype
          org.kohsuke.stapler.framework.adjunct.NoSuchAdjunctException: Neither org.kohsuke.stapler.framework.prototype.prototype.css, .js, .html, nor .jelly were found
                  at org.kohsuke.stapler.framework.adjunct.Adjunct.<init>(Adjunct.java:125)
                  at org.kohsuke.stapler.framework.adjunct.AdjunctManager.get(AdjunctManager.java:148)
                  at org.kohsuke.stapler.framework.adjunct.AdjunctsInPage.findNeeded(AdjunctsInPage.java:161)
                  at org.kohsuke.stapler.framework.adjunct.AdjunctsInPage.assumeIncluded(AdjunctsInPage.java:131)
                  at org.kohsuke.stapler.framework.adjunct.AdjunctsInPage.assumeIncluded(AdjunctsInPage.java:125)
                  at org.kohsuke.stapler.jelly.AdjunctTag.doTag(AdjunctTag.java:80)
          

          Mark Waite added a comment - I'm unable to duplicate the problem based on the information that you provided. You'll need to provide more information so that others can duplicate the issue. "How to report an issue" provides a list of the types of information needed. Steps I took while trying to duplicate the issue: Create a plugins.txt file with the exact plugins I used and their versions Create a run-jenkins.sh script that downloads Jenkins 2.407 and the plugins listed in plugins.txt Run the run-jenkins.sh script and complete the setup wizard by downloading no additional plugins and creating a user Define a failing multibranch Pipeline using https://github.com/jenkinsci/elastic-axis-plugin as the branch source Define a freestyle job and run it several times as a stable build Define a Pipeline job and run it several times as a stable build Define a folder and add a Pipeline and a freestyle job to the folder, run them both Define a build monitor view that recurses folders and select the items in the view with the regular expression ".*" Confirm that all 6 jobs are displayed in the build monitor view, with 2 failing and 4 passing The resulting status monitor page looks like this: I was surprised to see stack traces in the console output of my Jenkins controller. Those stack traces did not seem to affect the rendering of the page, but they were surprising. They included text like: 2023-06-17 13:21:04.086+0000 [id=18] WARNING o.k.s.f.adjunct.AdjunctsInPage#findNeeded: No such adjunct found: org.kohsuke.stapler.framework.prototype.prototype org.kohsuke.stapler.framework.adjunct.NoSuchAdjunctException: Neither org.kohsuke.stapler.framework.prototype.prototype.css, .js, .html, nor .jelly were found at org.kohsuke.stapler.framework.adjunct.Adjunct.<init>(Adjunct.java:125) at org.kohsuke.stapler.framework.adjunct.AdjunctManager.get(AdjunctManager.java:148) at org.kohsuke.stapler.framework.adjunct.AdjunctsInPage.findNeeded(AdjunctsInPage.java:161) at org.kohsuke.stapler.framework.adjunct.AdjunctsInPage.assumeIncluded(AdjunctsInPage.java:131) at org.kohsuke.stapler.framework.adjunct.AdjunctsInPage.assumeIncluded(AdjunctsInPage.java:125) at org.kohsuke.stapler.jelly.AdjunctTag.doTag(AdjunctTag.java:80)

          Andrea Lai added a comment -

          We had 40 muiti-branch pipeline jobs with a failing branch. Only 5 out of the 40 were showing the issue. I could not identify any pattern so I cannot provide steps to reproduce the issue. Sorry 

           

          Andrea Lai added a comment - We had 40 muiti-branch pipeline jobs with a failing branch. Only 5 out of the 40 were showing the issue. I could not identify any pattern so I cannot provide steps to reproduce the issue. Sorry   

          Andrea Lai added a comment -

          The problem seems to go away when we unselect "Display committers" option. 

          Andrea Lai added a comment - The problem seems to go away when we unselect "Display committers" option. 

            Unassigned Unassigned
            andrea_lai Andrea Lai
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: