java.net.SocketException

tip

It's possible you're trying to write to a connection that's already closed. Another cause for this is that you closed the socket with unread data in the socket receive buffer.


rafaelrafael
tip

This might be caused by unmatching versions of SSL. Java starts normally with SSLv2 and your server might not be able to negotiate. You have to force Java to use SSLv3. See this comment: https://goo.gl/hx0YB3


rafaelrafael

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • We've recently upgraded to Hudson ver. 1.358 and upgraded our Hudson plugins (CheckStyle, FindBugs, Emma, etc). Since taking the upgrades, we're noticing that slave agents are terminating after building our 'code checking' project, which consists of: - CheckStyle (now on 3.6) - FindBugs (now on 4.8) - Emma coverage reports (now on 1.20) We've narrowed the problem down to the Emma plugin; the Hudson slave does not terminate when I deactivate the "Record Emma coverage report" step in my Hudson project. When I re-enable the Emma coverage report step, the Hudson slave starts dying again. Slave agents are happily building our other builds (junit tests, end-2-end tests). Here's some logging below: (please let me know, if you need more details) ============================== When this happens, his is the logging we see on the: 1) Hudson server log file: 17-May-2010 12:49:29 hudson.TcpSlaveAgentListener$ConnectionHandler run INFO: Accepted connection #36 from /xx.xx.xx.xx:38048 17-May-2010 12:49:29 hudson.TcpSlaveAgentListener$ConnectionHandler error WARNING: Connection #36 is aborted: cislave3 is already connected to this master. Rejecting this connection. 2) Hudson slave agent log file: 17-May-2010 12:49:19 hudson.remoting.Engine$2 onDead INFO: Ping failed. Terminating the socket. 17-May-2010 12:49:19 hudson.remoting.Channel$ReaderThread run SEVERE: I/O error in channel channel java.net.SocketException: Socket closed at java.net.SocketInputStream.read(SocketInputStream.java:162) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:237) at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2249) at java.io.ObjectInputStream$BlockDataInputStream.peek(ObjectInputStream.java:2542) at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2552) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1297) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at hudson.remoting.Channel$ReaderThread.run(Channel.java:856) 17-May-2010 12:49:19 hudson.remoting.jnlp.Main$CuiListener status INFO: Terminated 17-May-2010 12:49:29 hudson.remoting.jnlp.Main$CuiListener status INFO: Locating server among [http://ccmain.xx.com:8080/] 17-May-2010 12:49:29 hudson.remoting.jnlp.Main$CuiListener status INFO: Connecting to ccmain.xx.com:44477 17-May-2010 12:49:29 hudson.remoting.jnlp.Main$CuiListener status INFO: Handshaking 17-May-2010 12:49:29 hudson.remoting.jnlp.Main$CuiListener error SEVERE: The server rejected the connection: cislave3 is already connected to this master. Rejecting this connection. java.lang.Exception: The server rejected the connection: cislave3 is already connected to this master. Rejecting this connection. at hudson.remoting.Engine.run(Engine.java:191)
    via by saipatel,
  • We've recently upgraded to Hudson ver. 1.358 and upgraded our Hudson plugins (CheckStyle, FindBugs, Emma, etc). Since taking the upgrades, we're noticing that slave agents are terminating after building our 'code checking' project, which consists of: - CheckStyle (now on 3.6) - FindBugs (now on 4.8) - Emma coverage reports (now on 1.20) We've narrowed the problem down to the Emma plugin; the Hudson slave does not terminate when I deactivate the "Record Emma coverage report" step in my Hudson project. When I re-enable the Emma coverage report step, the Hudson slave starts dying again. Slave agents are happily building our other builds (junit tests, end-2-end tests). Here's some logging below: (please let me know, if you need more details) ============================== When this happens, his is the logging we see on the: 1) Hudson server log file: 17-May-2010 12:49:29 hudson.TcpSlaveAgentListener$ConnectionHandler run INFO: Accepted connection #36 from /xx.xx.xx.xx:38048 17-May-2010 12:49:29 hudson.TcpSlaveAgentListener$ConnectionHandler error WARNING: Connection #36 is aborted: cislave3 is already connected to this master. Rejecting this connection. 2) Hudson slave agent log file: 17-May-2010 12:49:19 hudson.remoting.Engine$2 onDead INFO: Ping failed. Terminating the socket. 17-May-2010 12:49:19 hudson.remoting.Channel$ReaderThread run SEVERE: I/O error in channel channel java.net.SocketException: Socket closed at java.net.SocketInputStream.read(SocketInputStream.java:162) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:237) at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2249) at java.io.ObjectInputStream$BlockDataInputStream.peek(ObjectInputStream.java:2542) at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2552) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1297) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at hudson.remoting.Channel$ReaderThread.run(Channel.java:856) 17-May-2010 12:49:19 hudson.remoting.jnlp.Main$CuiListener status INFO: Terminated 17-May-2010 12:49:29 hudson.remoting.jnlp.Main$CuiListener status INFO: Locating server among [http://ccmain.xx.com:8080/] 17-May-2010 12:49:29 hudson.remoting.jnlp.Main$CuiListener status INFO: Connecting to ccmain.xx.com:44477 17-May-2010 12:49:29 hudson.remoting.jnlp.Main$CuiListener status INFO: Handshaking 17-May-2010 12:49:29 hudson.remoting.jnlp.Main$CuiListener error SEVERE: The server rejected the connection: cislave3 is already connected to this master. Rejecting this connection. java.lang.Exception: The server rejected the connection: cislave3 is already connected to this master. Rejecting this connection. at hudson.remoting.Engine.run(Engine.java:191)
    via by saipatel,
  • hudson jnlp slave terminates connection
    via by jenkins-ci,
  • Jenkins host sees node(s) as offline but node services are still running on slaves. Exception from node details page: java.net.SocketException: Socket closed at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(Unknown Source) at java.io.BufferedInputStream.fill(Unknown Source) at java.io.BufferedInputStream.read1(Unknown Source) at java.io.BufferedInputStream.read(Unknown Source) at java.io.ObjectInputStream$PeekInputStream.read(Unknown Source) at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source) at java.io.ObjectInputStream$BlockDataInputStream.readUTFBody(Unknown Source) at java.io.ObjectInputStream$BlockDataInputStream.readUTF(Unknown Source) at java.io.ObjectInputStream.readUTF(Unknown Source) at java.io.ObjectStreamClass.readNonProxy(Unknown Source) at java.io.ObjectInputStream.readClassDescriptor(Unknown Source) at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source) at java.io.ObjectInputStream.readClassDesc(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at hudson.remoting.Channel$ReaderThread.run(Channel.java:992) Exception from job build log: FATAL: hudson.remoting.RequestAbortedException: java.net.SocketException: Socket closed hudson.remoting.RequestAbortedException: hudson.remoting.RequestAbortedException: java.net.SocketException: Socket closed at hudson.remoting.Request.call(Request.java:137) at hudson.remoting.Channel.call(Channel.java:643) at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:158) at $Proxy43.join(Unknown Source) at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:850) at hudson.Launcher$ProcStarter.join(Launcher.java:336) at hudson.plugins.msbuild.MsBuildBuilder.perform(MsBuildBuilder.java:130) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:662) at hudson.model.Build$RunnerImpl.build(Build.java:177) at hudson.model.Build$RunnerImpl.doRun(Build.java:139) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:429) at hudson.model.Run.run(Run.java:1374) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:145) Caused by: hudson.remoting.RequestAbortedException: java.net.SocketException: Socket closed at hudson.remoting.Request.abort(Request.java:257) at hudson.remoting.Channel.terminate(Channel.java:694) at hudson.remoting.Channel$ReaderThread.run(Channel.java:1016) Caused by: java.net.SocketException: Socket closed at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(Unknown Source) at java.io.BufferedInputStream.fill(Unknown Source) at java.io.BufferedInputStream.read1(Unknown Source) at java.io.BufferedInputStream.read(Unknown Source) at java.io.ObjectInputStream$PeekInputStream.read(Unknown Source) at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source) at java.io.ObjectInputStream$BlockDataInputStream.readUTFBody(Unknown Source) at java.io.ObjectInputStream$BlockDataInputStream.readUTF(Unknown Source) at java.io.ObjectInputStream.readUTF(Unknown Source) at java.io.ObjectStreamClass.readNonProxy(Unknown Source) at java.io.ObjectInputStream.readClassDescriptor(Unknown Source) at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source) at java.io.ObjectInputStream.readClassDesc(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at hudson.remoting.Channel$ReaderThread.run(Channel.java:992)
    via by aleksas,
    • java.net.SocketException: Socket closed at java.net.SocketInputStream.read(SocketInputStream.java:162) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:237) at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2249) at java.io.ObjectInputStream$BlockDataInputStream.peek(ObjectInputStream.java:2542) at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2552) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1297) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at hudson.remoting.Channel$ReaderThread.run(Channel.java:856)

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    ivanszkypeterivanszkypeter
    40 times, last one,
    191 more bugmates