Jenkins slave jobs failing on “Unexpected termination of channel”

jenkins

I am currently seeing a set of errors across my builds.

Is this expected behaviour if you loose Jenkins (say to a box crash, or a kill -9)?

Or is there something worse going on (like a bad network connection)?

The stack and error is:

hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:158)
        at $Proxy175.join(Unknown Source)   at
hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:861)     at
hudson.Launcher$ProcStarter.join(Launcher.java:345)     at
hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:82)
        at
hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:58)
        at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
        at
hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:703)
        at hudson.model.Build$RunnerImpl.build(Build.java:178)  at
hudson.model.Build$RunnerImpl.doRun(Build.java:139)     at
hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:473)
        at hudson.model.Run.run(Run.java:1410)  at
hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)     at
hudson.model.ResourceController.execute(ResourceController.java:88)
        at hudson.model.Executor.run(Executor.java:238) Caused by:
hudson.remoting.RequestAbortedException: java.io.IOException:
Unexpected termination of the channel   at
hudson.remoting.Request.abort(Request.java:273)     at
hudson.remoting.Channel.terminate(Channel.java:732)     at
hudson.remoting.Channel$ReaderThread.run(Channel.java:1157) Caused by:
java.io.IOException: Unexpected termination of the channel  at
hudson.remoting.Channel$ReaderThread.run(Channel.java:1133) Caused by:
java.io.EOFException    at
java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2554)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1297)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
        at hudson.remoting.Channel$ReaderThread.run(Channel.java:1127)

Best Solution

You'll see that error if the Jenkins master loses connectivity with the slave. It could be due to any of the three issues you listed above:

  • Manually killing the slave process

  • The slave server becoming unavailable

  • A network problem between the master and the slave

Related Question