Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-34100

Launch of cloud slave fails with "No route to host"

      When launching a cloud slave, the VM is created and starts booting, but before it is available, Jenkins fails with this error.

      [04/05/16 17:09:02] [SSH] Opening SSH connection to 10.0.2.39:22.
      No route to host
      ERROR: Unexpected error in launching a slave. This is probably a bug in Jenkins.
      java.lang.IllegalStateException: Connection is not established!
      at com.trilead.ssh2.Connection.getRemainingAuthMethods(Connection.java:1030)
      at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.getRemainingAuthMethods(TrileadSSHPublicKeyAuthenticator.java:88)
      at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.canAuthenticate(TrileadSSHPublicKeyAuthenticator.java:80)
      at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:207)
      at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:169)
      at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1212)
      at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:711)
      at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:706)
      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)
      [04/05/16 17:09:05] Launch failed - cleaning up connection
      [04/05/16 17:09:05] [SSH] Connection closed.

      If I wait about a minute and click 'Launch Slave Agent' it works fine.

      The solution, it seems, would be to permit retries on a 'No route to host' error, rather than failing immediately. Also, this worked fine a few versions back. I don't know exactly when it broke.

          [JENKINS-34100] Launch of cloud slave fails with "No route to host"

          Adam Mendlik created issue -
          R. Tyler Croy made changes -
          Component/s New: ec2-plugin [ 15625 ]
          Component/s Original: core [ 21134 ]
          Key Original: INFRA-629 New: JENKINS-34100
          Workflow Original: classic default workflow [ 170129 ] New: JNJira [ 170129 ]
          Project Original: Infrastructure [ 10301 ] New: Jenkins [ 10172 ]
          R. Tyler Croy made changes -
          Component/s New: openstack-cloud-plugin [ 20631 ]
          Component/s Original: ec2-plugin [ 15625 ]
          R. Tyler Croy made changes -
          Assignee Original: R. Tyler Croy [ rtyler ] New: Marat Mavlyutov [ mavlyutov ]
          Oliver Gondža made changes -
          Assignee Original: Marat Mavlyutov [ mavlyutov ] New: Oliver Gondža [ olivergondza ]

          Hmm, there ware some changes to the code in 2.1 where I expected to improve the situation. Please have a look into the service log for messages involving the slave name. Also, what is in the $JENKINS_HOME/logs/slaves/$SLAVE_NAME? Usually, there is couple of logs tracking how several instances of "no route to host" / "connection refused" turned into successful connection.

          Oliver Gondža added a comment - Hmm, there ware some changes to the code in 2.1 where I expected to improve the situation. Please have a look into the service log for messages involving the slave name. Also, what is in the $JENKINS_HOME/logs/slaves/$SLAVE_NAME? Usually, there is couple of logs tracking how several instances of "no route to host" / "connection refused" turned into successful connection.

          Peter Hansen added a comment - - edited

          I experience the same problem here. The logfile says:
          [05/20/16 13:01:45] [SSH] Opening SSH connection to 192.168.1.36:22.
          No route to host
          ERROR: Unexpected error in launching a slave. This is probably a bug in Jenkins.
          ha:AAAAWB+LCAAAAAAAAP9b85aBtbiIQSmjNKU4P08vOT+vOD8nVc8DzHWtSE4tKMnMz/PLL0ldFVf2c+b/lb5MDAwVRQxSaBqcITRIIQMEMIIUFgAAckCEiWAAAAA=java.lang.IllegalStateException: Connection is not established!
          at com.trilead.ssh2.Connection.getRemainingAuthMethods(Connection.java:1030)
          at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.getRemainingAuthMethods(TrileadSSHPublicKeyAuthenticator.java:88)
          at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.canAuthenticate(TrileadSSHPublicKeyAuthenticator.java:80)
          at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:212)
          at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:172)
          at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1212)
          at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:711)
          at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:706)
          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)
          [05/20/16 13:01:48] Launch failed - cleaning up connection
          [05/20/16 13:01:48] [SSH] Connection closed.

          When manually launching the agent using the Jenkins UI after some minutes the problem does not occur.

          Is there any workaround? How to automatically reschedule the start of the agent?

          Peter Hansen added a comment - - edited I experience the same problem here. The logfile says: [05/20/16 13:01:45] [SSH] Opening SSH connection to 192.168.1.36:22. No route to host ERROR: Unexpected error in launching a slave. This is probably a bug in Jenkins. ha:AAAAWB+LCAAAAAAAAP9b85aBtbiIQSmjNKU4P08vOT+vOD8nVc8DzHWtSE4tKMnMz/PLL0ldFVf2c+b/lb5MDAwVRQxSaBqcITRIIQMEMIIUFgAAckCEiWAAAAA=java.lang.IllegalStateException: Connection is not established! at com.trilead.ssh2.Connection.getRemainingAuthMethods(Connection.java:1030) at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.getRemainingAuthMethods(TrileadSSHPublicKeyAuthenticator.java:88) at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.canAuthenticate(TrileadSSHPublicKeyAuthenticator.java:80) at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:212) at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:172) at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1212) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:711) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:706) 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) [05/20/16 13:01:48] Launch failed - cleaning up connection [05/20/16 13:01:48] [SSH] Connection closed. When manually launching the agent using the Jenkins UI after some minutes the problem does not occur. Is there any workaround? How to automatically reschedule the start of the agent?

          Roman Babyuk added a comment -

          I am expecting the same issue
          voting for resolving

          Thanks,
          Roman

          Roman Babyuk added a comment - I am expecting the same issue voting for resolving Thanks, Roman

          Peter Hansen added a comment -

          Hey Roman, This issue refers to the same problem as https://github.com/jenkinsci/openstack-cloud-plugin/issues/73.

          Peter Hansen added a comment - Hey Roman, This issue refers to the same problem as https://github.com/jenkinsci/openstack-cloud-plugin/issues/73 .

          Roman Babyuk added a comment -

          peterhansen42 Thx! voted there too

          Roman Babyuk added a comment - peterhansen42 Thx! voted there too

            olivergondza Oliver Gondža
            amendlik Adam Mendlik
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: