java.nio.channels.ClosedChannelException

Jenkins JIRA | Michael Prokop | 3 years ago
  1. 0

    My Jenkins slaves are connected via the swarm plugin (tested with swarm-client-1.10 and swarm-client-1.15), as soon as I upgrade Jenkins master to 1.560 Jenkins jobs very soon die with (quoting Jenkins job output): {quote} 09:17:44 FATAL: hudson.remoting.RequestAbortedException: java.nio.channels.ClosedByInterruptException 09:17:44 hudson.remoting.RequestAbortedException: hudson.remoting.RequestAbortedException: java.nio.channels.ClosedByInterruptException 09:17:44 at hudson.remoting.RequestAbortedException.wrapForRethrow(RequestAbortedException.java:41) 09:17:44 at hudson.remoting.RequestAbortedException.wrapForRethrow(RequestAbortedException.java:34) 09:17:44 at hudson.remoting.Request.call(Request.java:174) 09:17:44 at hudson.remoting.Channel.call(Channel.java:738) 09:17:44 at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:168) 09:17:44 at com.sun.proxy.$Proxy57.join(Unknown Source) 09:17:44 at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:951) 09:17:44 at hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:137) 09:17:44 at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:97) 09:17:44 at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66) 09:17:44 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) 09:17:44 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:740) 09:17:44 at hudson.model.Build$BuildExecution.build(Build.java:198) 09:17:44 at hudson.model.Build$BuildExecution.doRun(Build.java:159) 09:17:44 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:519) 09:17:44 at hudson.model.Run.execute(Run.java:1703) 09:17:44 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 09:17:44 at hudson.model.ResourceController.execute(ResourceController.java:88) 09:17:44 at hudson.model.Executor.run(Executor.java:231) 09:17:44 Caused by: hudson.remoting.RequestAbortedException: java.nio.channels.ClosedByInterruptException 09:17:44 at hudson.remoting.Request.abort(Request.java:299) 09:17:44 at hudson.remoting.Channel.terminate(Channel.java:801) 09:17:44 at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:69) 09:17:44 Caused by: java.nio.channels.ClosedByInterruptException 09:17:44 at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:201) 09:17:44 at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:281) 09:17:44 at hudson.remoting.SocketChannelStream$1.read(SocketChannelStream.java:33) 09:17:44 at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:65) 09:17:44 at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:109) 09:17:44 at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:103) 09:17:44 at java.io.InputStream.read(InputStream.java:101) 09:17:44 at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:81) 09:17:44 at hudson.remoting.FlightRecorderInputStream.read(FlightRecorderInputStream.java:77) 09:17:44 at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2291) 09:17:44 at java.io.ObjectInputStream$BlockDataInputStream.peek(ObjectInputStream.java:2584) 09:17:44 at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2594) 09:17:44 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1317) 09:17:44 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) 09:17:44 at hudson.remoting.Command.readFrom(Command.java:92) 09:17:44 at hudson.remoting.ClassicCommandTransport.read(ClassicCommandTransport.java:70) 09:17:44 at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48) {quote} ... and the slaves get disconnected, quoting from jenkins.log: {quote} Apr 25, 2014 9:40:34 AM jenkins.slaves.JnlpSlaveAgentProtocol$Handler$1 onClosed WARNING: Channel reader thread: jenkins-slave6 for + jenkins-slave6 terminated java.nio.channels.ClosedChannelException at sun.nio.ch.SocketChannelImpl.ensureReadOpen(SocketChannelImpl.java:131) at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:174) at hudson.remoting.SocketChannelStream$1.read(SocketChannelStream.java:33) at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:65) at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:109) at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:103) at hudson.remoting.FlightRecorderInputStream.read(FlightRecorderInputStream.java:85) at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2308) at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2321) at java.io.ObjectInputStream$BlockDataInputStream.readInt(ObjectInputStream.java:2816) at java.io.ObjectInputStream.readHandle(ObjectInputStream.java:1451) at java.io.ObjectInputStream.readTypeString(ObjectInputStream.java:1417) at java.io.ObjectStreamClass.readNonProxy(ObjectStreamClass.java:680) at java.io.ObjectInputStream.readClassDescriptor(ObjectInputStream.java:829) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1600) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1516) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1621) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1516) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1621) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1516) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1349) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1914) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1797) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1349) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) at hudson.remoting.Command.readFrom(Command.java:92) at hudson.remoting.ClassicCommandTransport.read(ClassicCommandTransport.java:70) at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48) {quote} AFAICS this seems to be related to the following Git commit: {quote} commit d4c74bf35d4d04bf289b020efd29f827458e0e11 Author: Kohsuke Kawaguchi <kk@kohsuke.org> Date: Fri Apr 4 17:39:44 2014 -0700 Integrated NIO JNLP slaves handling {quote}] Downgrading to Jenkins v1.559 again works around the issue.

    Jenkins JIRA | 3 years ago | Michael Prokop
    java.nio.channels.ClosedChannelException
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    My Jenkins slaves are connected via the swarm plugin (tested with swarm-client-1.10 and swarm-client-1.15), as soon as I upgrade Jenkins master to 1.560 Jenkins jobs very soon die with (quoting Jenkins job output): {quote} 09:17:44 FATAL: hudson.remoting.RequestAbortedException: java.nio.channels.ClosedByInterruptException 09:17:44 hudson.remoting.RequestAbortedException: hudson.remoting.RequestAbortedException: java.nio.channels.ClosedByInterruptException 09:17:44 at hudson.remoting.RequestAbortedException.wrapForRethrow(RequestAbortedException.java:41) 09:17:44 at hudson.remoting.RequestAbortedException.wrapForRethrow(RequestAbortedException.java:34) 09:17:44 at hudson.remoting.Request.call(Request.java:174) 09:17:44 at hudson.remoting.Channel.call(Channel.java:738) 09:17:44 at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:168) 09:17:44 at com.sun.proxy.$Proxy57.join(Unknown Source) 09:17:44 at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:951) 09:17:44 at hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:137) 09:17:44 at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:97) 09:17:44 at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66) 09:17:44 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) 09:17:44 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:740) 09:17:44 at hudson.model.Build$BuildExecution.build(Build.java:198) 09:17:44 at hudson.model.Build$BuildExecution.doRun(Build.java:159) 09:17:44 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:519) 09:17:44 at hudson.model.Run.execute(Run.java:1703) 09:17:44 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 09:17:44 at hudson.model.ResourceController.execute(ResourceController.java:88) 09:17:44 at hudson.model.Executor.run(Executor.java:231) 09:17:44 Caused by: hudson.remoting.RequestAbortedException: java.nio.channels.ClosedByInterruptException 09:17:44 at hudson.remoting.Request.abort(Request.java:299) 09:17:44 at hudson.remoting.Channel.terminate(Channel.java:801) 09:17:44 at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:69) 09:17:44 Caused by: java.nio.channels.ClosedByInterruptException 09:17:44 at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:201) 09:17:44 at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:281) 09:17:44 at hudson.remoting.SocketChannelStream$1.read(SocketChannelStream.java:33) 09:17:44 at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:65) 09:17:44 at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:109) 09:17:44 at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:103) 09:17:44 at java.io.InputStream.read(InputStream.java:101) 09:17:44 at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:81) 09:17:44 at hudson.remoting.FlightRecorderInputStream.read(FlightRecorderInputStream.java:77) 09:17:44 at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2291) 09:17:44 at java.io.ObjectInputStream$BlockDataInputStream.peek(ObjectInputStream.java:2584) 09:17:44 at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2594) 09:17:44 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1317) 09:17:44 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) 09:17:44 at hudson.remoting.Command.readFrom(Command.java:92) 09:17:44 at hudson.remoting.ClassicCommandTransport.read(ClassicCommandTransport.java:70) 09:17:44 at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48) {quote} ... and the slaves get disconnected, quoting from jenkins.log: {quote} Apr 25, 2014 9:40:34 AM jenkins.slaves.JnlpSlaveAgentProtocol$Handler$1 onClosed WARNING: Channel reader thread: jenkins-slave6 for + jenkins-slave6 terminated java.nio.channels.ClosedChannelException at sun.nio.ch.SocketChannelImpl.ensureReadOpen(SocketChannelImpl.java:131) at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:174) at hudson.remoting.SocketChannelStream$1.read(SocketChannelStream.java:33) at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:65) at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:109) at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:103) at hudson.remoting.FlightRecorderInputStream.read(FlightRecorderInputStream.java:85) at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2308) at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2321) at java.io.ObjectInputStream$BlockDataInputStream.readInt(ObjectInputStream.java:2816) at java.io.ObjectInputStream.readHandle(ObjectInputStream.java:1451) at java.io.ObjectInputStream.readTypeString(ObjectInputStream.java:1417) at java.io.ObjectStreamClass.readNonProxy(ObjectStreamClass.java:680) at java.io.ObjectInputStream.readClassDescriptor(ObjectInputStream.java:829) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1600) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1516) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1621) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1516) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1621) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1516) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1349) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1914) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1797) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1349) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) at hudson.remoting.Command.readFrom(Command.java:92) at hudson.remoting.ClassicCommandTransport.read(ClassicCommandTransport.java:70) at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48) {quote} AFAICS this seems to be related to the following Git commit: {quote} commit d4c74bf35d4d04bf289b020efd29f827458e0e11 Author: Kohsuke Kawaguchi <kk@kohsuke.org> Date: Fri Apr 4 17:39:44 2014 -0700 Integrated NIO JNLP slaves handling {quote}] Downgrading to Jenkins v1.559 again works around the issue.

    Jenkins JIRA | 3 years ago | Michael Prokop
    java.nio.channels.ClosedChannelException
  4. 0

    Apache Spark: Error on JavaSparkContext.stop()

    Stack Overflow | 2 years ago
    java.nio.channels.ClosedChannelException

  1. davidvanlaatum 6 times, last 6 months ago
4 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.nio.channels.ClosedChannelException

    No message provided

    at sun.nio.ch.SocketChannelImpl.ensureReadOpen()
  2. Java RT
    SocketChannelImpl.read
    1. sun.nio.ch.SocketChannelImpl.ensureReadOpen(SocketChannelImpl.java:131)
    2. sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:174)
    2 frames
  3. Hudson :: Remoting Layer
    SocketChannelStream$1.read
    1. hudson.remoting.SocketChannelStream$1.read(SocketChannelStream.java:33)
    1 frame
  4. Java RT
    ChannelInputStream.read
    1. sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:65)
    2. sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:109)
    3. sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:103)
    3 frames
  5. Hudson :: Remoting Layer
    FlightRecorderInputStream.read
    1. hudson.remoting.FlightRecorderInputStream.read(FlightRecorderInputStream.java:85)
    1 frame
  6. Java RT
    ObjectInputStream.readObject
    1. java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2308)
    2. java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2321)
    3. java.io.ObjectInputStream$BlockDataInputStream.readInt(ObjectInputStream.java:2816)
    4. java.io.ObjectInputStream.readHandle(ObjectInputStream.java:1451)
    5. java.io.ObjectInputStream.readTypeString(ObjectInputStream.java:1417)
    6. java.io.ObjectStreamClass.readNonProxy(ObjectStreamClass.java:680)
    7. java.io.ObjectInputStream.readClassDescriptor(ObjectInputStream.java:829)
    8. java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1600)
    9. java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1516)
    10. java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1621)
    11. java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1516)
    12. java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1621)
    13. java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1516)
    14. java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770)
    15. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1349)
    16. java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)
    17. java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1914)
    18. java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1797)
    19. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1349)
    20. java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
    20 frames
  7. Hudson :: Remoting Layer
    SynchronousCommandTransport$ReaderThread.run
    1. hudson.remoting.Command.readFrom(Command.java:92)
    2. hudson.remoting.ClassicCommandTransport.read(ClassicCommandTransport.java:70)
    3. hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48)
    3 frames