Reputation: 165
We are seeing hudson.remoting.ChannelClosedException: channel is already closed
which is caused by java.net.SocketException: Connection reset
.
Any suggestions on how to fix it?
The full exception stacktrace:
[21-11-2013 14:29:54] FATAL: channel is already closed
[21-11-2013 14:29:54] hudson.remoting.ChannelClosedException: channel is already closed
[21-11-2013 14:29:54] at hudson.remoting.Channel.send(Channel.java:516)
[21-11-2013 14:29:54] at hudson.remoting.Request.call(Request.java:129)
[21-11-2013 14:29:54] at hudson.remoting.Channel.call(Channel.java:714)
[21-11-2013 14:29:54] at hudson.Launcher$RemoteLauncher.kill(Launcher.java:887)
[21-11-2013 14:29:54] at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:609)
[21-11-2013 14:29:54] at com.tikal.jenkins.plugins.multijob.MultiJobBuild$MultiJobRunnerImpl.run(MultiJobBuild.java:67)
[21-11-2013 14:29:54] at hudson.model.Run.execute(Run.java:1603)
[21-11-2013 14:29:54] at hudson.model.Run.run(Run.java:1549)
[21-11-2013 14:29:54] at com.tikal.jenkins.plugins.multijob.MultiJobBuild.run(MultiJobBuild.java:60)
[21-11-2013 14:29:54] at hudson.model.ResourceController.execute(ResourceController.java:88)
[21-11-2013 14:29:54] at hudson.model.Executor.run(Executor.java:247)
[21-11-2013 14:29:54] Caused by: java.net.SocketException: Connection reset
[21-11-2013 14:29:54] at java.net.SocketInputStream.read(Unknown Source)
[21-11-2013 14:29:54] at java.net.SocketInputStream.read(Unknown Source)
[21-11-2013 14:29:54] at java.io.BufferedInputStream.fill(Unknown Source)
[21-11-2013 14:29:54] at java.io.BufferedInputStream.read(Unknown Source)
[21-11-2013 14:29:54] at hudson.remoting.FlightRecorderInputStream.read(FlightRecorderInputStream.java:77)
[21-11-2013 14:29:54] at java.io.ObjectInputStream$PeekInputStream.peek(Unknown Source)
[21-11-2013 14:29:54] at java.io.ObjectInputStream$BlockDataInputStream.peek(Unknown Source)
[21-11-2013 14:29:54] at java.io.ObjectInputStream$BlockDataInputStream.peekByte(Unknown Source)
[21-11-2013 14:29:54] at java.io.ObjectInputStream.readObject0(Unknown Source)
[21-11-2013 14:29:54] at java.io.ObjectInputStream.readObject(Unknown Source)
[21-11-2013 14:29:54] at hudson.remoting.Command.readFrom(Command.java:92)
[21-11-2013 14:29:54] at hudson.remoting.ClassicCommandTransport.read(ClassicCommandTransport.java:71)
Upvotes: 11
Views: 29773
Reputation: 1584
You get this error for 2 reasons:
The first time Jenkins tries to SSH on the remote node, the server prompts the user if he'd like to add the SHH key to its known keys. Normally, in a command prompt, you'd only answer YES and move on. But Jenkins will get stuck on this line. Then the connection attempt will fail. Solution: connect manually to the remote node from jenkins server using a command prompt once. Then you can answer YES manually. All future attempts from jenkins will work.
The java agent stopped working for an obscure reason on the remote node. Solution: restart the java agent. Simple enough... but maybe not if you dont know how to restart it! I found that a simple way is to change the timeout value (connection timeout in seconds) on the node configuration. When saving the new value, you will actually restart the java agent!
Upvotes: 5
Reputation: 648
As I know, that error can come when a build is running on a slave PC and the client stops... If it's not a master-slave problem, the see the full log of jenkins ( you can find it in Jenkins installation directory) and see what causes the problem ( can be a problem of heap or I don't know what cause the problem). Anyway, a restart of Jenkins can be a solution!
Upvotes: 4