hudson.util.IOException2: Slave JVM has terminated. Exit code=126

Stack Overflow | Upen | 2 years ago
  1. 0

    Jenkins SSH Slave Configuration

    Stack Overflow | 2 years ago | Upen
    hudson.util.IOException2: Slave JVM has terminated. Exit code=126
  2. 0

    [JENKINS-8894] Failed to launch slave agent. - Jenkins JIRA

    jenkins-ci.org | 1 year ago
    java.io.EOFException: unexpected stream termination
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Test environment reproducing the issue is a Jenkins instance with 24 slave nodes all on the same machine with the same remote FS. To not get false negatives because of sshd limits /etc/ssh/sshd cofing need a change: < MaxSessions 200 < MaxStartups 200:30:400 The output of failing nodes are different because of the jar file being corrupted in different ways. I pasted some examples below. The issues is that the slave jar files are removed and copy by all ssh-slaves nodes. Code from src/main/java/hudson/plugins/sshslaves/SSHLauncher.java: [...] connection.exec("rm " + workingDirectory + "/slave.jar", new NullStream()); [...] scp.put(IOUtils.toByteArray(is), "slave.jar", workingDirectory, "0644"); [...] I have created a pull request with suggested fix: https://github.com/jenkinsci/ssh-slaves-plugin/pull/17 Asmund [05/02/14 12:23:38] [SSH] Checking java version of java [05/02/14 12:23:39] [SSH] java -version returned 1.7.0_55. [05/02/14 12:23:39] [SSH] Starting sftp client. [05/02/14 12:23:39] [SSH] Copying latest slave.jar... [05/02/14 12:23:39] [SSH] Copied 409,398 bytes. Expanded the channel window size to 4MB [05/02/14 12:23:39] [SSH] Starting slave process: cd "/tmp" && java -jar slave.jar Error: Invalid or corrupt jarfile slave.jar java.io.EOFException: unexpected stream termination at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:200) at hudson.remoting.Channel.<init>(Channel.java:419) at hudson.remoting.Channel.<init>(Channel.java:398) at hudson.remoting.Channel.<init>(Channel.java:394) at hudson.remoting.Channel.<init>(Channel.java:383) at hudson.remoting.Channel.<init>(Channel.java:375) at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:338) at hudson.plugins.sshslaves.SSHLauncher.startSlave(SSHLauncher.java:901) at hudson.plugins.sshslaves.SSHLauncher.access$400(SSHLauncher.java:126) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:658) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:642) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) [05/02/14 12:23:39] [SSH] Connection closed. [05/02/14 12:25:39] [SSH] Checking java version of java [05/02/14 12:25:39] [SSH] java -version returned 1.7.0_55. [05/02/14 12:25:39] [SSH] Starting sftp client. [05/02/14 12:25:39] [SSH] Copying latest slave.jar... [05/02/14 12:25:39] [SSH] Copied 409,398 bytes. Expanded the channel window size to 4MB [05/02/14 12:25:39] [SSH] Starting slave process: cd "/tmp" && java -jar slave.jar Error: Unable to access jarfile slave.jar java.io.IOException: SSH channel is closed. (Close requested by remote) at com.trilead.ssh2.channel.ChannelManager.sendData(ChannelManager.java:382) at com.trilead.ssh2.channel.ChannelOutputStream.write(ChannelOutputStream.java:63) at hudson.remoting.BinarySafeStream$2.flush(BinarySafeStream.java:299) at java.io.ObjectOutputStream$BlockDataOutputStream.flush(ObjectOutputStream.java:1822) at java.io.ObjectOutputStream.flush(ObjectOutputStream.java:718) at hudson.remoting.Capability.writePreamble(Capability.java:116) at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:182) at hudson.remoting.Channel.<init>(Channel.java:419) at hudson.remoting.Channel.<init>(Channel.java:398) at hudson.remoting.Channel.<init>(Channel.java:394) at hudson.remoting.Channel.<init>(Channel.java:383) at hudson.remoting.Channel.<init>(Channel.java:375) at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:338) at hudson.plugins.sshslaves.SSHLauncher.startSlave(SSHLauncher.java:901) at hudson.plugins.sshslaves.SSHLauncher.access$400(SSHLauncher.java:126) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:658) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:642) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) [05/02/14 12:25:39] [SSH] Starting slave process: cd "/tmp" && java -jar slave.jar Error: Invalid or corrupt jarfile slave.jar java.io.IOException: SSH channel is closed. (Close requested by remote) at com.trilead.ssh2.channel.ChannelManager.sendData(ChannelManager.java:382) at com.trilead.ssh2.channel.ChannelOutputStream.write(ChannelOutputStream.java:63) at hudson.remoting.BinarySafeStream$2._write(BinarySafeStream.java:272) at hudson.remoting.BinarySafeStream$2.write(BinarySafeStream.java:255) at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1876) at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1785) at java.io.ObjectOutputStream.writeNonProxyDesc(ObjectOutputStream.java:1285) at java.io.ObjectOutputStream.writeClassDesc(ObjectOutputStream.java:1230) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1426) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) at java.io.ObjectOutputStream.writeFatalException(ObjectOutputStream.java:1576) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:350) at hudson.remoting.Capability.writePreamble(Capability.java:115) at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:182) at hudson.remoting.Channel.<init>(Channel.java:419) at hudson.remoting.Channel.<init>(Channel.java:398) at hudson.remoting.Channel.<init>(Channel.java:394) at hudson.remoting.Channel.<init>(Channel.java:383) at hudson.remoting.Channel.<init>(Channel.java:375) at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:338) at hudson.plugins.sshslaves.SSHLauncher.startSlave(SSHLauncher.java:901) at hudson.plugins.sshslaves.SSHLauncher.access$400(SSHLauncher.java:126) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:658) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:642) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744)

    Jenkins JIRA | 3 years ago | Asmund Ostvold
    java.io.EOFException: unexpected stream termination

    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.io.EOFException

      unexpected stream termination

      at hudson.remoting.ChannelBuilder.negotiate()
    2. Hudson :: Remoting Layer
      Channel.<init>
      1. hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:200)
      2. hudson.remoting.Channel.<init>(Channel.java:419)
      3. hudson.remoting.Channel.<init>(Channel.java:398)
      4. hudson.remoting.Channel.<init>(Channel.java:394)
      5. hudson.remoting.Channel.<init>(Channel.java:383)
      6. hudson.remoting.Channel.<init>(Channel.java:375)
      6 frames
    3. Hudson
      SlaveComputer.setChannel
      1. hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:344)
      1 frame
    4. hudson.plugins.sshslaves
      SSHLauncher$2.call
      1. hudson.plugins.sshslaves.SSHLauncher.startSlave(SSHLauncher.java:945)
      2. hudson.plugins.sshslaves.SSHLauncher.access$400(SSHLauncher.java:133)
      3. hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:711)
      4. hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:696)
      4 frames
    5. Java RT
      Thread.run
      1. java.util.concurrent.FutureTask.run(FutureTask.java:262)
      2. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      3. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      4. java.lang.Thread.run(Thread.java:745)
      4 frames