java.net.SocketTimeoutException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I'm having a slave node to run the FitNesse test cases using the FitNesse plugin. However when the executing time of test suite is long (over 20 minutes), Jenkins will raise the Java read timed out Exception during the executing time, and the jenkins job is failed. The error is as follow: Connected: 200/OK java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:150) at java.net.SocketInputStream.read(SocketInputStream.java:121) at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) at java.io.BufferedInputStream.read1(BufferedInputStream.java:275) at java.io.BufferedInputStream.read(BufferedInputStream.java:334) at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:543) at sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:600) at sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687) at java.io.FilterInputStream.read(FilterInputStream.java:133) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2959) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2953) at hudson.plugins.fitnesse.FitnesseExecutor.getHttpBytes(FitnesseExecutor.java:249) at hudson.plugins.fitnesse.FitnesseExecutor$1.run(FitnesseExecutor.java:226) at java.lang.Thread.run(Thread.java:722) Force close of input stream. This seems to be a known issue in the FitNesse plugin, and it has been raised for a long time. Hope this bug could be resolved ASAP. Issue raised before: https://issues.jenkins-ci.org/browse/JENKINS-18501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
    via by Heng Wang,
  • I'm having a slave node to run the FitNesse test cases using the FitNesse plugin. However when the executing time of test suite is long (over 20 minutes), Jenkins will raise the Java read timed out Exception during the executing time, and the jenkins job is failed. The error is as follow: Connected: 200/OK java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:150) at java.net.SocketInputStream.read(SocketInputStream.java:121) at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) at java.io.BufferedInputStream.read1(BufferedInputStream.java:275) at java.io.BufferedInputStream.read(BufferedInputStream.java:334) at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:543) at sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:600) at sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687) at java.io.FilterInputStream.read(FilterInputStream.java:133) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2959) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2953) at hudson.plugins.fitnesse.FitnesseExecutor.getHttpBytes(FitnesseExecutor.java:249) at hudson.plugins.fitnesse.FitnesseExecutor$1.run(FitnesseExecutor.java:226) at java.lang.Thread.run(Thread.java:722) Force close of input stream. This seems to be a known issue in the FitNesse plugin, and it has been raised for a long time. Hope this bug could be resolved ASAP. Issue raised before: https://issues.jenkins-ci.org/browse/JENKINS-18501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
    via by Heng Wang,
  • issue related to fitnesse plugin
    via by Irfan Sayed,
  • We get this socket timeout the odd occasion, as you can see we have tried setting the HttpTimeout to a big number but it doesn't seem to help. 12:59:36 hudson.plugins.fitnesse.FitnesseBuilder: {fitnesseTargetPage=PayrollTeam.ModulePayroll.AaTaxArea.NewZealandTax, fitnesseTargetIsSuite=true, fitnesseHost=Private, fitnesseHttpTimeout=2700000, fitnessePortRemote=8886, fitnesseStart=False, fitnessePathToXmlResultsOut=C:\PayGlobal\FitNesse\Results\XESuiteNZTax_Results.xml} 12:59:36 Connnecting to http://PAYFIT003:8886/PayrollTeam.ModulePayroll.AaTaxArea.NewZealandTax?suite&format=xml&includehtml 12:59:36 Connected: 200/OK 13:44:46 java.net.SocketTimeoutException: Read timed out 13:44:46 at java.net.SocketInputStream.socketRead0(Native Method) 13:44:46 at java.net.SocketInputStream.read(Unknown Source) 13:44:46 at java.net.SocketInputStream.read(Unknown Source) 13:44:46 at java.io.BufferedInputStream.fill(Unknown Source) 13:44:46 at java.io.BufferedInputStream.read1(Unknown Source) 13:44:46 at java.io.BufferedInputStream.read(Unknown Source) 13:44:46 at sun.net.www.http.ChunkedInputStream.readAheadBlocking(Unknown Source) 13:44:46 at sun.net.www.http.ChunkedInputStream.readAhead(Unknown Source) 13:44:46 at sun.net.www.http.ChunkedInputStream.read(Unknown Source) 13:44:46 at java.io.FilterInputStream.read(Unknown Source) 13:44:46 at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source) 13:44:46 at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source) 13:44:46 at hudson.plugins.fitnesse.FitnesseExecutor.getHttpBytes(FitnesseExecutor.java:230) 13:44:46 at hudson.plugins.fitnesse.FitnesseExecutor$1.run(FitnesseExecutor.java:201) 13:44:46 at java.lang.Thread.run(Unknown Source) I've had a quick look at the code and I'm pretty sure this is where it is crashing: try { log.println("Connnecting to " + pageCmdTarget); HttpURLConnection connection = (HttpURLConnection) pageCmdTarget.openConnection(); connection.setReadTimeout(httpTimeout); log.println("Connected: " + connection.getResponseCode() + "/" + connection.getResponseMessage()); inputStream = connection.getInputStream(); long recvd = 0, lastLogged = 0; byte[] buf = new byte[4096]; int lastRead; while ((lastRead = inputStream.read(buf)) > 0) { bucket.write(buf, 0, lastRead); timeout.reset(); recvd += lastRead; if (recvd - lastLogged > 1024) { log.println(recvd/1024 + "k..."); lastLogged = recvd; } } } catch (IOException e) { // this may be a "premature EOF" caused by e.g. incorrect content-length HTTP header // so it may be non-fatal -- try to recover e.printStackTrace(log); } finally { if (inputStream != null) { try { inputStream.close(); } catch (Exception e) { // swallow } } } I'm not very good with networking code so would someone please be able to look at this for me and see if there is an issue or suggest something environmentally we could do to avoid these timeouts? Cheers, Sam
    via by Sam Jessop,
  • We get this socket timeout the odd occasion, as you can see we have tried setting the HttpTimeout to a big number but it doesn't seem to help. 12:59:36 hudson.plugins.fitnesse.FitnesseBuilder: {fitnesseTargetPage=PayrollTeam.ModulePayroll.AaTaxArea.NewZealandTax, fitnesseTargetIsSuite=true, fitnesseHost=Private, fitnesseHttpTimeout=2700000, fitnessePortRemote=8886, fitnesseStart=False, fitnessePathToXmlResultsOut=C:\PayGlobal\FitNesse\Results\XESuiteNZTax_Results.xml} 12:59:36 Connnecting to http://PAYFIT003:8886/PayrollTeam.ModulePayroll.AaTaxArea.NewZealandTax?suite&format=xml&includehtml 12:59:36 Connected: 200/OK 13:44:46 java.net.SocketTimeoutException: Read timed out 13:44:46 at java.net.SocketInputStream.socketRead0(Native Method) 13:44:46 at java.net.SocketInputStream.read(Unknown Source) 13:44:46 at java.net.SocketInputStream.read(Unknown Source) 13:44:46 at java.io.BufferedInputStream.fill(Unknown Source) 13:44:46 at java.io.BufferedInputStream.read1(Unknown Source) 13:44:46 at java.io.BufferedInputStream.read(Unknown Source) 13:44:46 at sun.net.www.http.ChunkedInputStream.readAheadBlocking(Unknown Source) 13:44:46 at sun.net.www.http.ChunkedInputStream.readAhead(Unknown Source) 13:44:46 at sun.net.www.http.ChunkedInputStream.read(Unknown Source) 13:44:46 at java.io.FilterInputStream.read(Unknown Source) 13:44:46 at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source) 13:44:46 at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source) 13:44:46 at hudson.plugins.fitnesse.FitnesseExecutor.getHttpBytes(FitnesseExecutor.java:230) 13:44:46 at hudson.plugins.fitnesse.FitnesseExecutor$1.run(FitnesseExecutor.java:201) 13:44:46 at java.lang.Thread.run(Unknown Source) I've had a quick look at the code and I'm pretty sure this is where it is crashing: try { log.println("Connnecting to " + pageCmdTarget); HttpURLConnection connection = (HttpURLConnection) pageCmdTarget.openConnection(); connection.setReadTimeout(httpTimeout); log.println("Connected: " + connection.getResponseCode() + "/" + connection.getResponseMessage()); inputStream = connection.getInputStream(); long recvd = 0, lastLogged = 0; byte[] buf = new byte[4096]; int lastRead; while ((lastRead = inputStream.read(buf)) > 0) { bucket.write(buf, 0, lastRead); timeout.reset(); recvd += lastRead; if (recvd - lastLogged > 1024) { log.println(recvd/1024 + "k..."); lastLogged = recvd; } } } catch (IOException e) { // this may be a "premature EOF" caused by e.g. incorrect content-length HTTP header // so it may be non-fatal -- try to recover e.printStackTrace(log); } finally { if (inputStream != null) { try { inputStream.close(); } catch (Exception e) { // swallow } } } I'm not very good with networking code so would someone please be able to look at this for me and see if there is an issue or suggest something environmentally we could do to avoid these timeouts? Cheers, Sam
    via by Sam Jessop,
  • Failed to download libraries
    via by Unknown author,
    • java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:150) at java.net.SocketInputStream.read(SocketInputStream.java:121) at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) at java.io.BufferedInputStream.read1(BufferedInputStream.java:275) at java.io.BufferedInputStream.read(BufferedInputStream.java:334) at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:543) at sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:600) at sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687) at java.io.FilterInputStream.read(FilterInputStream.java:133) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2959) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2953) at hudson.plugins.fitnesse.FitnesseExecutor.getHttpBytes(FitnesseExecutor.java:249) at hudson.plugins.fitnesse.FitnesseExecutor$1.run(FitnesseExecutor.java:226) at java.lang.Thread.run(Thread.java:722)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown User
    4 times, last one,
    Unknown visitor3 times, last one,
    tvrmsmith
    2 times, last one,
    147 more bugmates