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

SSH Key Exchange not finished

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed

    Description

      Setting up a VM with VirtualBox fails with ssh issues. I have confirmed it is not an issue with my key by logging into the Jenkins install and using the same user it does was able to ssh to the VirtualBox machine without any issue. I tried an ssh key with and without a password both fail in jenkins the same way. Both ways work if manually done as the jenkins user to login through ssh to the running vm.

      The key size and type
      rsa 16384 with no rounds on password.

      error:
      [VirtualBox] Launching node testbox
      [VirtualBox] Powering up VirtualBoxMachine{host=VirtualBoxHost

      {url='http://vboxmain:18083', username=''}

      ,name='testbox'}...
      [VirtualBox] Lost connection to http://vboxmain:18083, reconnecting
      [VirtualBox] Trying to connect to http://vboxmain:18083, user
      [VirtualBox] Creating connection to VirtualBox version 4.3.20_OSE
      [VirtualBox] Connected to VirtualBox version 4.3.20_OSE on host http://vboxmain:18083
      [VirtualBox] node testbox in state Running
      [VirtualBox] node testbox started
      [VirtualBox] Sleep before stage 2 launcher, attempt 1
      [VirtualBox] Starting stage 2 launcher (SSHLauncher)
      [01/19/15 17:17:13] [SSH] Opening SSH connection to :22.
      Key exchange was not finished, connection is closed.
      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:1173)
      at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:701)
      at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:696)
      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)
      [01/19/15 17:17:13] Launch failed - cleaning up connection
      [01/19/15 17:17:13] [SSH] Connection closed.

      Attachments

        Issue Links

          Activity

            jenkdonk p r added a comment -

            Just tested on 1.597 as well and the same issue and error message is present

            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:1173)
            at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:701)
            at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:696)
            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)
            [01/19/15 18:49:56] Launch failed - cleaning up connection

            jenkdonk p r added a comment - Just tested on 1.597 as well and the same issue and error message is present 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:1173) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:701) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:696) 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) [01/19/15 18:49:56] Launch failed - cleaning up connection

            Have you installed the unrestricted policy into your Jenkins JVM?

            By default it limits the maximum RSA key size to something like 2048 or 4096

            stephenconnolly Stephen Connolly added a comment - Have you installed the unrestricted policy into your Jenkins JVM? By default it limits the maximum RSA key size to something like 2048 or 4096
            jenkdonk p r added a comment -

            Thanks stepenconnolly my searching before posting was not turning up anything useful. That was exactly the issue and works now as expected. I will close this out.

            jenkdonk p r added a comment - Thanks stepenconnolly my searching before posting was not turning up anything useful. That was exactly the issue and works now as expected. I will close this out.
            jenkdonk p r added a comment -

            Was my mistake was missing Java Cryptography Extension (JCE) installed and all worked as expected. Sorry for the noise.

            jenkdonk p r added a comment - Was my mistake was missing Java Cryptography Extension (JCE) installed and all worked as expected. Sorry for the noise.

            People

              stephenconnolly Stephen Connolly
              jenkdonk p r
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: