java.io.IOException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • SSH Connection to Slave Error
    via GitHub by AdnaneKhan
    ,
  • Jenkins upgrade to 2.58 can't launch slaves
    via Stack Overflow by Deon
    ,
  • Using Ecualyptus slaves, it can take a while before the DNS name is populated with the correct IP is referenced by the name. Until then, euca-0-0-0-0.eucalyptus.eucadomain... is presented. Needless to say, if the ec2 plugin tries to connect to that name, it fails. The mitigation would seem to be to allow a wait before connect option, or a retry option which re-checks dns on retry. I edited the plugin myself to add a dumb fixed 60s delay and that did fix the issue, however this should be fixed properly. Stack trace follows. Connecting to euca-0-0-0-0.eucalyptus.eucadomain.sc.local on port 22. Connected via SSH. bootstrap() Getting keypair... Using key: jenkins cc:05:1a:f4:95:e0:0d:99:b9:ea:56:fd:6c:90:a1:d0:85:8d:74:5e -----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEAn/addoIs+dTHJlhb6D+mex0m/hdXbQz5UWBDIKnU5g2cPWFW L4n0HaoJ8nHMSviDmzFfZ+Mdutn+aEzSz/lvmHK1VS4tJ+W5adFc6CcohFU2u6w Authenticating as sc Authentication failed. Trying again... Authenticating as sc Authentication failed. Trying again... Authenticating as sc Authentication failed. Trying again... Authenticating as sc Authentication failed. Trying again... Authenticating as sc Authentication failed. Trying again... Authenticating as sc ERROR: Publickey authentication failed. java.io.IOException: Publickey authentication failed. at com.trilead.ssh2.auth.AuthenticationManager.authenticatePublicKey(AuthenticationManager.java:264) at com.trilead.ssh2.Connection.authenticateWithPublicKey(Connection.java:445) at hudson.plugins.ec2.ssh.EC2UnixLauncher.bootstrap(EC2UnixLauncher.java:187) at hudson.plugins.ec2.ssh.EC2UnixLauncher.launch(EC2UnixLauncher.java:77) at hudson.plugins.ec2.EC2ComputerLauncher.launch(EC2ComputerLauncher.java:80) at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:230) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) 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:724) Caused by: java.io.IOException: The connection is closed. at com.trilead.ssh2.auth.AuthenticationManager.deQueue(AuthenticationManager.java:79) at com.trilead.ssh2.auth.AuthenticationManager.getNextMessage(AuthenticationManager.java:102) at com.trilead.ssh2.auth.AuthenticationManager.authenticatePublicKey(AuthenticationManager.java:239) ... 10 more Caused by: java.io.IOException: Peer sent DISCONNECT message (reason code 2): Too many authentication failures for spacecurve at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:750) at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:475) ... 1 more
    via by cosmo king,
  • In every 10 or so instance launches, I see cases where the EC2 plugin opens a SSH connection to the new instance before the time where I believe the corresponding private key has been put in place by the AWS infrastructure during the launch of the instance. As a result, we see errors in the node launch. The output for the launch is below. just before slave CentOS (i-f295e51b) gets launched ... executing pre-launch scripts ... Node CentOS (i-f295e51b)(i-f295e51b) is still pending/launching, waiting 5s Node CentOS (i-f295e51b)(i-f295e51b) is still pending/launching, waiting 5s Node CentOS (i-f295e51b)(i-f295e51b) is still pending/launching, waiting 5s Node CentOS (i-f295e51b)(i-f295e51b) is still pending/launching, waiting 5s Node CentOS (i-f295e51b)(i-f295e51b) is still pending/launching, waiting 5s Node CentOS (i-f295e51b)(i-f295e51b) is still pending/launching, waiting 5s Node CentOS (i-f295e51b)(i-f295e51b) is ready Connecting to 10.240.1.146 on port 22, with timeout 10000. Failed to connect via ssh: The kexTimeout (10000 ms) expired. Waiting for SSH to come up. Sleeping 5. Connecting to 10.240.1.146 on port 22, with timeout 10000. Failed to connect via ssh: The kexTimeout (10000 ms) expired. Waiting for SSH to come up. Sleeping 5. Connecting to 10.240.1.146 on port 22, with timeout 10000. Failed to connect via ssh: The kexTimeout (10000 ms) expired. Waiting for SSH to come up. Sleeping 5. Connecting to 10.240.1.146 on port 22, with timeout 10000. Connected via SSH. bootstrap() Getting keypair... Using key: jenkins dc:xx:xx:xx -----BEGIN RSA PRIVATE KEY----- MIIEow<private key info> Authenticating as centos Authentication failed. Trying again... Authenticating as centos Authentication failed. Trying again... Authenticating as centos Authentication failed. Trying again... Authenticating as centos Authentication failed. Trying again... Authenticating as centos Authentication failed. Trying again... Authenticating as centos ERROR: Publickey authentication failed. java.io.IOException: Publickey authentication failed. at com.trilead.ssh2.auth.AuthenticationManager.authenticatePublicKey(AuthenticationManager.java:315) at com.trilead.ssh2.Connection.authenticateWithPublicKey(Connection.java:467) at hudson.plugins.ec2.ssh.EC2UnixLauncher.bootstrap(EC2UnixLauncher.java:260) at hudson.plugins.ec2.ssh.EC2UnixLauncher.launch(EC2UnixLauncher.java:91) at hudson.plugins.ec2.EC2ComputerLauncher.launch(EC2ComputerLauncher.java:107) at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:238) at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.IOException: The connection is closed. at com.trilead.ssh2.auth.AuthenticationManager.deQueue(AuthenticationManager.java:63) at com.trilead.ssh2.auth.AuthenticationManager.getNextMessage(AuthenticationManager.java:86) at com.trilead.ssh2.auth.AuthenticationManager.authenticatePublicKey(AuthenticationManager.java:290) ... 10 more Caused by: java.io.IOException: Peer sent DISCONNECT message (reason code 2): Too many authentication failures for centos at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:766) at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:489) ... 1 more
    via by Mike Kingsbury,
  • Hello, I'm on Jenkins LTS v1.565.2 + ec2 plugin v1.24 I already have my own key pair as we now are trying migrate to using ec2 plugin for autoscaling, so I import my own keypairs on AWS EC2 console, but now supplying the same private key to ec2 plugin don't seem to work. I do see an ec2 instance is created and running, just can't get Jenkins ssh into that slave. {code} Node aws builder (i-83605288)(i-83605288) is still stopping, waiting 5s Node aws builder (i-83605288)(i-83605288) is still stopping, waiting 5s Node aws builder (i-83605288)(i-83605288) is still stopping, waiting 5s Node aws builder (i-83605288)(i-83605288) is ready Connecting to ip-1-2-3-4.us-west-2.compute.internal on port 22, with timeout 10000. Waiting for SSH to come up. Sleeping 5. Connecting to ip-1-2-3-4.us-west-2.compute.internal on port 22, with timeout 10000. Connected via SSH. bootstrap() Getting keypair... Using key: jenkins-builder 0f:64:0d:18:40:d3:f0:04:45:de:84:ab:39:20:7f:42 -----BEGIN RSA PRIVATE KEY----- MIIEoQIBAAKCAQEAzEibczy885OzrUb4DCsPueOSok1uUgSAMPLEabcdefgehef UzGGq+6qVCSHtGpjJXlK+DFDBADFEWRX+W7CifKEspRasZsC3hhHC3BnCbH7fuB Authenticating as 4g ruby dummy dummy2 aws m3.medium Authentication failed. Trying again... Authenticating as 4g ruby dummy dummy2 aws m3.medium Authentication failed. Trying again... Authenticating as 4g ruby dummy dummy2 aws m3.medium Authentication failed. Trying again... Authenticating as 4g ruby dummy dummy2 aws m3.medium Authentication failed. Trying again... Authenticating as 4g ruby dummy dummy2 aws m3.medium Authentication failed. Trying again... Authenticating as 4g ruby dummy dummy2 aws m3.medium ERROR: Publickey authentication failed. java.io.IOException: Publickey authentication failed. at com.trilead.ssh2.auth.AuthenticationManager.authenticatePublicKey(AuthenticationManager.java:315) at com.trilead.ssh2.Connection.authenticateWithPublicKey(Connection.java:467) at hudson.plugins.ec2.ssh.EC2UnixLauncher.bootstrap(EC2UnixLauncher.java:194) at hudson.plugins.ec2.ssh.EC2UnixLauncher.launch(EC2UnixLauncher.java:82) at hudson.plugins.ec2.EC2ComputerLauncher.launch(EC2ComputerLauncher.java:101) at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:228) at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46) 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:745) Caused by: java.io.IOException: The connection is closed. at com.trilead.ssh2.auth.AuthenticationManager.deQueue(AuthenticationManager.java:63) at com.trilead.ssh2.auth.AuthenticationManager.getNextMessage(AuthenticationManager.java:86) at com.trilead.ssh2.auth.AuthenticationManager.authenticatePublicKey(AuthenticationManager.java:290) ... 10 more Caused by: java.io.IOException: Peer sent DISCONNECT message (reason code 2): Too many authentication failures for 4g ruby dummy dummy2 aws m3.medium at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:755) at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:480) ... 1 more {code}
    via by Sam Xiao,
    • java.io.IOException: There was a problem while connecting to localhost:32771 at com.trilead.ssh2.Connection.connect(Connection.java:818) at com.github.kostyasha.yad.utils.HostAndPortChecker.bySshWithEveryRetryWaitFor(HostAndPortChecker.java:89) at com.github.kostyasha.yad.launcher.DockerComputerSSHLauncher.waitUp(DockerComputerSSHLauncher.java:90) at com.github.kostyasha.yad.DockerCloud.provisionWithWait(DockerCloud.java:219) at com.github.kostyasha.yad.DockerCloud.lambda$provision$0(DockerCloud.java:120) at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.IOException: Key exchange was not finished, connection is closed. at com.trilead.ssh2.transport.KexManager.getOrWaitForConnectionInfo(KexManager.java:93) at com.trilead.ssh2.transport.TransportManager.getConnectionInfo(TransportManager.java:230) at com.trilead.ssh2.Connection.connect(Connection.java:770) ... 9 more Caused by: java.io.IOException: Cannot read full block, EOF reached. at com.trilead.ssh2.crypto.cipher.CipherInputStream.getBlock(CipherInputStream.java:81) at com.trilead.ssh2.crypto.cipher.CipherInputStream.read(CipherInputStream.java:108) at com.trilead.ssh2.transport.TransportConnection.receiveMessage(TransportConnection.java:232) at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:693) at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:489) ... 1 more

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor2 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,