Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-8733

Do not fail when the download of a static file has been cancelled

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.5-M2, 6.5
    • Component/s: None
    • Labels:

      Description

      When the download of a static file has been canceled, it generates some useless log on server's side :

      Processing of request /static/cpp/build-wrapper-linux-x86.zip failed
      java.lang.IllegalStateException: Cannot call sendError() after the response has been committed
      	at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:478)
      	at javax.servlet.http.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:129)
      	at org.jruby.rack.servlet.ResponseCapture.sendError(ResponseCapture.java:87)
      	at org.sonar.server.plugins.StaticResourcesServlet.doGet(StaticResourcesServlet.java:69)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.jruby.rack.RackFilter.doFilterInternal(RackFilter.java:78)
      	at org.jruby.rack.UnmappedRackFilter.isDoDispatch(UnmappedRackFilter.java:106)
      	at org.jruby.rack.AbstractFilter.isDoDispatch(AbstractFilter.java:107)
      	at org.jruby.rack.AbstractFilter.doFilter(AbstractFilter.java:65)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:128)
      	at org.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:95)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:76)
      	at org.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:63)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.sonar.server.platform.web.SecurityServletFilter.doHttpFilter(SecurityServletFilter.java:73)
      	at org.sonar.server.platform.web.SecurityServletFilter.doFilter(SecurityServletFilter.java:49)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.sonar.server.platform.web.RoutesFilter.doFilter(RoutesFilter.java:55)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.sonar.server.platform.web.requestid.RequestIdFilter.doFilter(RequestIdFilter.java:63)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:62)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      	at ch.qos.logback.access.tomcat.LogbackValve.invoke(LogbackValve.java:256)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
      	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
      	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)
      

      There is also no need to report the following exception (with stacktrace, at least) :

      Unable to load resource [static/build-wrapper-linux-x86.zip] from plugin [cpp]
      org.apache.catalina.connector.ClientAbortException: java.io.IOException: Connection reset by peer
      	at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:393)
      	at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:426)
      	at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:339)
      	at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:418)
      	at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:406)
      	at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:97)
      	at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1793)
      	at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1769)
      	at org.apache.commons.io.IOUtils.copy(IOUtils.java:1744)
      	at org.sonar.server.plugins.StaticResourcesServlet.doGet(StaticResourcesServlet.java:63)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.jruby.rack.RackFilter.doFilterInternal(RackFilter.java:78)
      	at org.jruby.rack.UnmappedRackFilter.isDoDispatch(UnmappedRackFilter.java:106)
      	at org.jruby.rack.AbstractFilter.isDoDispatch(AbstractFilter.java:107)
      	at org.jruby.rack.AbstractFilter.doFilter(AbstractFilter.java:65)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:128)
      	at org.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:95)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:76)
      	at org.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:63)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.sonar.server.platform.web.SecurityServletFilter.doHttpFilter(SecurityServletFilter.java:73)
      	at org.sonar.server.platform.web.SecurityServletFilter.doFilter(SecurityServletFilter.java:49)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.sonar.server.platform.web.RoutesFilter.doFilter(RoutesFilter.java:55)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.sonar.server.platform.web.requestid.RequestIdFilter.doFilter(RequestIdFilter.java:63)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:62)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      	at ch.qos.logback.access.tomcat.LogbackValve.invoke(LogbackValve.java:256)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
      	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
      	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.io.IOException: Connection reset by peer
      	at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
      	at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
      	at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
      	at sun.nio.ch.IOUtil.write(IOUtil.java:65)
      	at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471)
      	at org.apache.tomcat.util.net.NioChannel.write(NioChannel.java:124)
      	at org.apache.tomcat.util.net.NioBlockingSelector.write(NioBlockingSelector.java:101)
      	at org.apache.tomcat.util.net.NioSelectorPool.write(NioSelectorPool.java:172)
      	at org.apache.coyote.http11.InternalNioOutputBuffer.writeToSocket(InternalNioOutputBuffer.java:139)
      	at org.apache.coyote.http11.InternalNioOutputBuffer.addToBB(InternalNioOutputBuffer.java:197)
      	at org.apache.coyote.http11.InternalNioOutputBuffer.access$000(InternalNioOutputBuffer.java:41)
      	at org.apache.coyote.http11.InternalNioOutputBuffer$SocketOutputBuffer.doWrite(InternalNioOutputBuffer.java:320)
      	at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:118)
      	at org.apache.coyote.http11.AbstractOutputBuffer.doWrite(AbstractOutputBuffer.java:256)
      	at org.apache.coyote.Response.doWrite(Response.java:501)
      	at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:388)
      	... 55 common frames omitted
      

        Attachments

          Activity

            People

            • Assignee:
              sebastien.lesaint Sebastien Lesaint
              Reporter:
              julien.lancelot Julien Lancelot
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: