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

winstone.ClientSocketException: Failed to write to client

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • Windows Server 2003, JDK 1.6.0_23_64, Jenkins 1.415

      Slaves are connected via JNLP

      winstone.ClientSocketException: Failed to write to client
      at winstone.ClientOutputStream.write(ClientOutputStream.java:41)
      at winstone.WinstoneOutputStream.commit(WinstoneOutputStream.java:181)
      at winstone.WinstoneOutputStream.commit(WinstoneOutputStream.java:123)
      at winstone.WinstoneOutputStream.write(WinstoneOutputStream.java:112)
      at net.bull.javamelody.FilterServletOutputStream.write(FilterServletOutputStream.java:70)
      at net.bull.javamelody.CounterResponseStream.write(CounterResponseStream.java:83)
      at org.kohsuke.stapler.Stapler.serveStaticResource(Stapler.java:410)
      at org.kohsuke.stapler.Stapler.serveStaticResource(Stapler.java:241)
      at org.kohsuke.stapler.Stapler.service(Stapler.java:149)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
      at winstone.ServletConfiguration.execute(ServletConfiguration.java:249)
      at winstone.RequestDispatcher.forward(RequestDispatcher.java:335)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:378)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94)
      at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:157)
      at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:131)
      at net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:82)
      at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:84)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:97)
      at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:52)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:97)
      at hudson.plugins.audit_trail.AuditTrailFilter.doFilter(AuditTrailFilter.java:65)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:97)
      at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
      at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)
      at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
      at java.lang.Thread.run(Thread.java:662)
      Caused by: java.net.SocketException: Software caused connection abort: socket write error
      at java.net.SocketOutputStream.socketWrite0(Native Method)
      at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
      at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
      at winstone.ClientOutputStream.write(ClientOutputStream.java:39)
      ... 55 more

          [JENKINS-10524] winstone.ClientSocketException: Failed to write to client

          James Nord added a comment -

          have the issue and we do not use a reverse proxy.

          James Nord added a comment - have the issue and we do not use a reverse proxy.

          James Hardwick added a comment - - edited

          If it were a matter of too many javascript files being loaded than a lot more users would be having this problem.

          If you guys are running Jenkins behind an apache proxy, try just hitting jenkins directly for a day and see what your results are. This might require typing a longer URL and appending :8080 at the end, but definitely worth it for debugging reasons.

          All our problems went away once we figured out our apache proxying issue. We initially discovered the discrepancy by running the following curl command against jenkins, first through the apache proxy, and second against jenkins directly:

           
          #!/bin/bash
          
          for i in {1..100}
          do
            # via proxy
            wget --quiet --spider http://build/api/json?pretty=true
            if [ $? -ne 0 ]; then
              echo "wget failed via proxy"
            fi
          done
          
          for i in {1..100}
          do
            # bypassing the proxy
            wget --quiet --spider http://jenkins:8080/api/json?pretty=true
            if [ $? -ne 0 ]; then
              echo "wget failed directly"
            fi
          done
          

          If you run that and you only see "wget failed via proxy" but nothing directly, then it's your proxy configuration.

          James Hardwick added a comment - - edited If it were a matter of too many javascript files being loaded than a lot more users would be having this problem. If you guys are running Jenkins behind an apache proxy, try just hitting jenkins directly for a day and see what your results are. This might require typing a longer URL and appending :8080 at the end, but definitely worth it for debugging reasons. All our problems went away once we figured out our apache proxying issue. We initially discovered the discrepancy by running the following curl command against jenkins, first through the apache proxy, and second against jenkins directly: #!/bin/bash for i in {1..100} do # via proxy wget --quiet --spider http: //build/api/json?pretty= true if [ $? -ne 0 ]; then echo "wget failed via proxy" fi done for i in {1..100} do # bypassing the proxy wget --quiet --spider http: //jenkins:8080/api/json?pretty= true if [ $? -ne 0 ]; then echo "wget failed directly" fi done If you run that and you only see "wget failed via proxy" but nothing directly, then it's your proxy configuration.

          My point being, if you use a proxy at all and are having issues, give that a try first.

          James Hardwick added a comment - My point being, if you use a proxy at all and are having issues, give that a try first.

          Linards L added a comment -

          Same here on 2k8r2 x64 sp1 @ jdk 1.7 @ v1.514.

          Linards L added a comment - Same here on 2k8r2 x64 sp1 @ jdk 1.7 @ v1.514.

          Same problem here. Using v1.516 with Windows Server 2008 R2, JDK 1.7 Update 21 64Bit.

          We use a master and 10 slaves. All connected without any proxy.

          If i request any of the master jenkins urls via VPN this exception occurs more often.

          Sebastian Laag added a comment - Same problem here. Using v1.516 with Windows Server 2008 R2, JDK 1.7 Update 21 64Bit. We use a master and 10 slaves. All connected without any proxy. If i request any of the master jenkins urls via VPN this exception occurs more often.

          Ahmed Osman added a comment - - edited

          Experiencing this issue, while we are using a proxy we did not run into this until we configured matrix based security with the bitbucket oAuth plugin. With matrix based security in use, the error presented itself after logging out then back in. Once we switched aware from matrix based security the error went away.

          Ahmed Osman added a comment - - edited Experiencing this issue, while we are using a proxy we did not run into this until we configured matrix based security with the bitbucket oAuth plugin. With matrix based security in use, the error presented itself after logging out then back in. Once we switched aware from matrix based security the error went away.

          Jesse Glick added a comment - - edited

          Jenkins 1.521 included https://github.com/stapler/stapler/commit/ac0b5683c4a3a45c3b987baf264674934470b668 which installs a new pretty exception handler that may affect the symptoms of this bug somehow.

          Jesse Glick added a comment - - edited Jenkins 1.521 included https://github.com/stapler/stapler/commit/ac0b5683c4a3a45c3b987baf264674934470b668 which installs a new pretty exception handler that may affect the symptoms of this bug somehow.

          Jesse Glick added a comment -

          Jesse Glick added a comment - https://github.com/stapler/stapler/commit/a6307f473e44aa4fd6a26275304d738dba5201c9 (once integrated into Jenkins core) might work.

          Jesse Glick added a comment -

          7e8bbea3336dc65a10c2fd69a20beac20bc6fca3 in 1.528 should have integrated the purported fix.

          Jesse Glick added a comment - 7e8bbea3336dc65a10c2fd69a20beac20bc6fca3 in 1.528 should have integrated the purported fix.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/pom.xml
          http://jenkins-ci.org/commit/jenkins/fdbcfda5acd430a8f8bfb90d7def4351f7bfce57
          Log:
          [FIXED JENKINS-10524][FIXED JENKINS-19168] Stapler 1.218.

          (cherry picked from commit d814a6ff7f2e99c9ada722d17c33ca87b0bbea65)

          Conflicts:
          changelog.html
          core/pom.xml

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/pom.xml http://jenkins-ci.org/commit/jenkins/fdbcfda5acd430a8f8bfb90d7def4351f7bfce57 Log: [FIXED JENKINS-10524] [FIXED JENKINS-19168] Stapler 1.218. (cherry picked from commit d814a6ff7f2e99c9ada722d17c33ca87b0bbea65) Conflicts: changelog.html core/pom.xml

            jglick Jesse Glick
            robsimon robsimon
            Votes:
            10 Vote for this issue
            Watchers:
            22 Start watching this issue

              Created:
              Updated:
              Resolved: