Skip to content

[JENKINS-26379] Jenkins - ssh connection exception #781

Closed

Description

@jenkins-infra-bot

I am trying to configure a slave for my jenkins Master but getting following exception:

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.TrileadSSHPasswordAuthenticator.canAuthenticate(TrileadSSHPasswordAuthenticator.java:82)
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$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
[01/07/15 16:51:10] Launch failed - cleaning up connection
[01/07/15 16:51:10] [SSH] Connection closed.
Any idea of what's the issue here?


Originally reported by magneto09, imported from: Jenkins - ssh connection exception
  • assignee: mc1arke
  • status: Resolved
  • priority: Major
  • component(s): ssh-credentials-plugin, ssh-slaves-plugin
  • label(s): exception, slave
  • resolution: Fixed
  • resolved: 2017-04-29T21:03:53+00:00
  • votes: 10
  • watchers: 27
  • imported: 20251212-090250
Raw content of original issue

I am trying to configure a slave for my jenkins Master but getting following exception:

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.TrileadSSHPasswordAuthenticator.canAuthenticate(TrileadSSHPasswordAuthenticator.java:82) 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$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) [01/07/15 16:51:10] Launch failed - cleaning up connection [01/07/15 16:51:10] [SSH] Connection closed. Any idea of what's the issue here?

environment
Master is Windows 7<br/>
Slave is Ubuntu Linux VM

Activity

  1. jenkins-infra-bot commented on Jan 11, 2015

    @jenkins-infra-bot
    Author
    danielbeck:
    • Original comment link
    • Raw content of original comment:

      Looks like the password is wrong or something like that.

    Looks like the password is wrong or something like that.

  2. jenkins-infra-bot commented on Jan 12, 2015

    @jenkins-infra-bot
    Author
    magneto09:
    • Original comment link
    • Raw content of original comment:

      I am able to connect from other hosts using same ssh credentials

    I am able to connect from other hosts using same ssh credentials

  3. jenkins-infra-bot commented on Jun 8, 2015

    @jenkins-infra-bot
    Author
    fdrouet:
    • Original comment link
    • Raw content of original comment:

      magneto09 : any news about your problem ? did you succeed to solve it ? I have the same problem and even after double checked everything I can't fix my problem.

    magneto09 : any news about your problem ? did you succeed to solve it ? I have the same problem and even after double checked everything I can't fix my problem.

  4. jenkins-infra-bot commented on Jun 8, 2015

    @jenkins-infra-bot
    Author
    aheritier:
    • Original comment link
    • Raw content of original comment:

      For fdrouet the issue occurs when moving an agent from a server to another (same account, same ssh key). The main difference between servers hosting the agents : the old is an ubuntu 12.04 and the new one an ubuntu 14.04 Doing a diff between verbose connexion logs of a classical ssh gives :

      jenkins@master:~$ diff -u old new
      --- old	2015-06-08 22:38:39.000000000 +0200
      +++ new	2015-06-08 22:37:53.000000000 +0200
      @@ -1,7 +1,7 @@
       OpenSSH_5.9p1 Debian-5ubuntu1.4, OpenSSL 1.0.1 14 Mar 2012
       debug1: Reading configuration data /etc/ssh/ssh_config
       debug1: /etc/ssh/ssh_config line 19: Applying options for *
      -debug1: Connecting to old [A.B.C.D] port 22.
      +debug1: Connecting to new [E.F.G.H] port 22.
       debug1: Connection established.
       debug1: identity file /opt/jenkins/.ssh/id_rsa type 1
       debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
      @@ -11,20 +11,22 @@
       debug1: identity file /opt/jenkins/.ssh/id_dsa-cert type -1
       debug1: identity file /opt/jenkins/.ssh/id_ecdsa type -1
       debug1: identity file /opt/jenkins/.ssh/id_ecdsa-cert type -1
      -debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.4
      -debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.4 pat OpenSSH*
      +debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
      +debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH*
       debug1: Enabling compatibility mode for protocol 2.0
       debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.4
       debug1: SSH2_MSG_KEXINIT sent
       debug1: SSH2_MSG_KEXINIT received
      -debug1: kex: server->client aes128-ctr hmac-md5 none
      -debug1: kex: client->server aes128-ctr hmac-md5 none
      -debug1: sending SSH2_MSG_KEX_ECDH_INIT
      -debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
      -debug1: Server host key: ECDSA 7f:04:0f:f4:64:0c:82:8a:15:0a:2d:f9:d3:bf:8f:60
      -debug1: Host 'old' is known and matches the ECDSA host key.
      -debug1: Found key in /opt/jenkins/.ssh/known_hosts:10
      -debug1: ssh_ecdsa_verify: signature correct
      +debug1: kex: server->client aes128-ctr hmac-sha2-256 none
      +debug1: kex: client->server aes128-ctr hmac-sha2-256 none
      +debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<4096<8192) sent
      +debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
      +debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
      +debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
      +debug1: Server host key: RSA b8:92:db:37:ba:2d:c6:52:0e:82:da:6d:4b:2e:83:ca
      +debug1: Host 'new' is known and matches the RSA host key.
      +debug1: Found key in /opt/jenkins/.ssh/known_hosts:8
      +debug1: ssh_rsa_verify: signature correct
       debug1: SSH2_MSG_NEWKEYS sent
       debug1: expecting SSH2_MSG_NEWKEYS
       debug1: SSH2_MSG_NEWKEYS received
      @@ -37,7 +39,7 @@
       debug1: Server accepts key: pkalg ssh-rsa blen 279
       debug1: read PEM private key done: type RSA
       debug1: Authentication succeeded (publickey).
      -Authenticated to old ([A.B.C.D]:22).
      +Authenticated to new ([E.F.G.H]:22).
       debug1: channel 0: new [client-session]
       debug1: Requesting no-more-sessions@openssh.com
       debug1: Entering interactive session.
      @@ -45,3 +47,4 @@
       debug1: Sending env LC_ALL = en_US.UTF-8
       debug1: Sending env LANG = en_GB.UTF-8
       debug1: Sending env LC_CTYPE = UTF-8
      

    For fdrouet the issue occurs when moving an agent from a server to another (same account, same ssh key).
    The main difference between servers hosting the agents : the old is an ubuntu 12.04 and the new one an ubuntu 14.04
    Doing a diff between verbose connexion logs of a classical ssh gives :

    jenkins@​master:~$ diff -u old new
    --- old	2015-06-08 22:38:39.000000000 +0200
    +++ new	2015-06-08 22:37:53.000000000 +0200
    @@ -1,7 +1,7 @@
     OpenSSH_5.9p1 Debian-5ubuntu1.4, OpenSSL 1.0.1 14 Mar 2012
     debug1: Reading configuration data /etc/ssh/ssh_config
     debug1: /etc/ssh/ssh_config line 19: Applying options for *
    -debug1: Connecting to old [A.B.C.D] port 22.
    +debug1: Connecting to new [E.F.G.H] port 22.
     debug1: Connection established.
     debug1: identity file /opt/jenkins/.ssh/id_rsa type 1
     debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
    @@ -11,20 +11,22 @@
     debug1: identity file /opt/jenkins/.ssh/id_dsa-cert type -1
     debug1: identity file /opt/jenkins/.ssh/id_ecdsa type -1
     debug1: identity file /opt/jenkins/.ssh/id_ecdsa-cert type -1
    -debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.4
    -debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.4 pat OpenSSH*
    +debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
    +debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH*
     debug1: Enabling compatibility mode for protocol 2.0
     debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.4
     debug1: SSH2_MSG_KEXINIT sent
     debug1: SSH2_MSG_KEXINIT received
    -debug1: kex: server->client aes128-ctr hmac-md5 none
    -debug1: kex: client->server aes128-ctr hmac-md5 none
    -debug1: sending SSH2_MSG_KEX_ECDH_INIT
    -debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
    -debug1: Server host key: ECDSA 7f:04:0f:f4:64:0c:82:8a:15:0a:2d:f9:d3:bf:8f:60
    -debug1: Host 'old' is known and matches the ECDSA host key.
    -debug1: Found key in /opt/jenkins/.ssh/known_hosts:10
    -debug1: ssh_ecdsa_verify: signature correct
    +debug1: kex: server->client aes128-ctr hmac-sha2-256 none
    +debug1: kex: client->server aes128-ctr hmac-sha2-256 none
    +debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<4096<8192) sent
    +debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
    +debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
    +debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
    +debug1: Server host key: RSA b8:92:db:37:ba:2d:c6:52:0e:82:da:6d:4b:2e:83:ca
    +debug1: Host 'new' is known and matches the RSA host key.
    +debug1: Found key in /opt/jenkins/.ssh/known_hosts:8
    +debug1: ssh_rsa_verify: signature correct
     debug1: SSH2_MSG_NEWKEYS sent
     debug1: expecting SSH2_MSG_NEWKEYS
     debug1: SSH2_MSG_NEWKEYS received
    @@ -37,7 +39,7 @@
     debug1: Server accepts key: pkalg ssh-rsa blen 279
     debug1: read PEM private key done: type RSA
     debug1: Authentication succeeded (publickey).
    -Authenticated to old ([A.B.C.D]:22).
    +Authenticated to new ([E.F.G.H]:22).
     debug1: channel 0: new [client-session]
     debug1: Requesting no-more-sessions@​openssh.com
     debug1: Entering interactive session.
    @@ -45,3 +47,4 @@
     debug1: Sending env LC_ALL = en_US.UTF-8
     debug1: Sending env LANG = en_GB.UTF-8
     debug1: Sending env LC_CTYPE = UTF-8
    
  5. jenkins-infra-bot commented on Jun 9, 2015

    @jenkins-infra-bot
    Author
    fdrouet:
    • Original comment link
    • Raw content of original comment:

      I have found a workaround which allow my jenkins server (akka master) (Ubuntu 12.04 + jdk-oracle-7u67-x64) to start a Jenkins slave agent on the new server (Ubuntu 14.04) by commenting the MACs ... configuration line on the new server /etc/ssh/sshd_config file.

      After reloading SSH server, no more problem for jenkins master to establish a ssh connexion.

      For information, the MACs parameter of my new server was :

      MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160

    I have found a workaround which allow my jenkins server (akka master) (Ubuntu 12.04 + jdk-oracle-7u67-x64) to start a Jenkins slave agent on the new server (Ubuntu 14.04) by commenting the MACs ... configuration line on the new server /etc/ssh/sshd_config file.

    After reloading SSH server, no more problem for jenkins master to establish a ssh connexion.

    For information, the MACs parameter of my new server was :

    MACs hmac-sha2-512-etm@​openssh.com,hmac-sha2-256-etm@​openssh.com,umac-128-etm@​openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160

  6. jenkins-infra-bot commented on Jun 9, 2015

    @jenkins-infra-bot
    Author
    aheritier:
    • Original comment link
    • Raw content of original comment:

      fdrouet Can you tell us what is the default MACs value (man sshd_config must give you the list AFAIR) thus the one which is working ....

    fdrouet Can you tell us what is the default MACs value (man sshd_config must give you the list AFAIR) thus the one which is working ....

  7. jenkins-infra-bot commented on Jun 9, 2015

    @jenkins-infra-bot
    Author
    fdrouet:
    • Original comment link
    • Raw content of original comment:

      The man on my Ubuntu 14.04 server says :

           MACs    Specifies the available MAC (message authentication code) algorithms.  The MAC algorithm is used in protocol version 2 for data integrity protection.  Multiple algorithms must be comma-separated.  The algorithms that contain “-etm” calculate the MAC after encryption (encrypt-then-mac).  These are
                   considered safer and their use recommended.  The default is:
      
                         hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,
                         umac-64-etm@openssh.com,umac-128-etm@openssh.com,
                         hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
                         hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,
                         hmac-md5-96-etm@openssh.com,
                         hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,
                         hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,
                         hmac-sha1-96,hmac-md5-96
      

    The man on my Ubuntu 14.04 server says :

         MACs    Specifies the available MAC (message authentication code) algorithms.  The MAC algorithm is used in protocol version 2 for data integrity protection.  Multiple algorithms must be comma-separated.  The algorithms that contain “-etm” calculate the MAC after encryption (encrypt-then-mac).  These are
         considered safer and their use recommended.  The default is:
    
       hmac-md5-etm@​openssh.com,hmac-sha1-etm@​openssh.com,
       umac-64-etm@​openssh.com,umac-128-etm@​openssh.com,
       hmac-sha2-256-etm@​openssh.com,hmac-sha2-512-etm@​openssh.com,
       hmac-ripemd160-etm@​openssh.com,hmac-sha1-96-etm@​openssh.com,
       hmac-md5-96-etm@​openssh.com,
       hmac-md5,hmac-sha1,umac-64@​openssh.com,umac-128@​openssh.com,
       hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,
       hmac-sha1-96,hmac-md5-96
    
  8. jenkins-infra-bot commented on Jun 9, 2015

    @jenkins-infra-bot
    Author
    aheritier:
    • Original comment link
    • Raw content of original comment:

      Additional note on fdrouet case, the exception was :

      [06/09/15 00:36:25] [SSH] Opening SSH connection to new: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)
      [06/09/15 00:36:25] Launch failed - cleaning up connection
      [06/09/15 00:36:25] [SSH] Connection closed.
      

      The important error is Key exchange was not finished, connection is closed. I'm not sure if it couldn't be better to open a dedicated issue just for this problem. JERKINS-26379 is too generic and without enough details (or we change its subject but I'm not sure this is the problem that magneto09 had)

    Additional note on fdrouet case, the exception was :

    [06/09/15 00:36:25] [SSH] Opening SSH connection to new: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)
    [06/09/15 00:36:25] Launch failed - cleaning up connection
    [06/09/15 00:36:25] [SSH] Connection closed.
    

    The important error is Key exchange was not finished, connection is closed. I'm not sure if it couldn't be better to open a dedicated issue just for this problem. JERKINS-26379 is too generic and without enough details (or we change its subject but I'm not sure this is the problem that magneto09 had)

  9. jenkins-infra-bot commented on Jun 10, 2015

    @jenkins-infra-bot
    Author
    ryreitsma:
    • Original comment link
    • Raw content of original comment:

      I'm running into the same error as Frédéric when trying to connect to a slave with Jenkins 1.617 (both up-to-date CentOS 7 VM's) if I specify MACs as

      MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160

      If I remove the MACs config completely from /etc/ssh/sshd_config on the slave and it uses the default, it works. Trying to find out what the problem was has actually cost me a day, so please respond if you need more info to solve this issue. For the moment my workaround is to use default MACs on build node ssh config. But if you have any info on which MAC algorithm should work, I'd be glad to test it out.

    I'm running into the same error as Frédéric when trying to connect to a slave with Jenkins 1.617 (both up-to-date CentOS 7 VM's) if I specify MACs as

    MACs hmac-sha2-512-etm@​openssh.com,hmac-sha2-256-etm@​openssh.com,umac-128-etm@​openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160

    If I remove the MACs config completely from /etc/ssh/sshd_config on the slave and it uses the default, it works. Trying to find out what the problem was has actually cost me a day, so please respond if you need more info to solve this issue. For the moment my workaround is to use default MACs on build node ssh config. But if you have any info on which MAC algorithm should work, I'd be glad to test it out.

  10. jenkins-infra-bot commented on Sep 17, 2015

    @jenkins-infra-bot
    Author
    teilo:
    • Original comment link
    • Raw content of original comment:

      I saw the exception that aheritier listed above. The remote OS was not running (behind a firewall with port forwarding if it makes a difference.)

      credentials are set to use a private key.

      Jenkins 1.609.3 JDK 8 on Windows 8 64bit ssh-credentials 1.11 credentials plugin 1.23 ssh slaves 1.10

      [09/17/15 11:25:46] [SSH] Opening SSH connection to some.remote.host:22.
      Connection timed out: connect
      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)
      [09/17/15 11:26:07] Launch failed - cleaning up connection
      [09/17/15 11:26:07] [SSH] Connection closed.
      

    I saw the exception that aheritier listed above. The remote OS was not running (behind a firewall with port forwarding if it makes a difference.)

    credentials are set to use a private key.

    Jenkins 1.609.3
    JDK 8 on Windows 8 64bit
    ssh-credentials 1.11
    credentials plugin 1.23
    ssh slaves 1.10

    [09/17/15 11:25:46] [SSH] Opening SSH connection to some.remote.host:22.
    Connection timed out: connect
    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)
    [09/17/15 11:26:07] Launch failed - cleaning up connection
    [09/17/15 11:26:07] [SSH] Connection closed.
    
    
  11. jenkins-infra-bot commented on Nov 23, 2015

    @jenkins-infra-bot
    Author
    oneiroi:

    Limited Key Exchange Algorithms are supported

    https://github.com/jenkinsci/ssh-slaves-plugin/blob/master/src/main/java/hudson/plugins/sshslaves/SFTPClient.java references com.trilead.ssh2.Connection

    SSH Library in use therefor is https://github.com/jenkinsci/trilead-ssh2

    https://github.com/jenkinsci/trilead-ssh2/blob/master/src/com/trilead/ssh2/transport/KexManager.java#L416-L449 https://github.com/jenkinsci/trilead-ssh2/blob/master/src/com/trilead/ssh2/transport/KexManager.java#L326-L341

    Illustrate that only diffie-hellman-group-exchange-sha1 && diffie-hellman-group1-sha1 are supported for key exchange

    As noted by google sha1 is to be considered weak: https://googleonlinesecurity.blogspot.co.uk/2014/09/gradually-sunsetting-sha-1.html

    In short, the trilead-ssh2 library needs to be updated to add support for more current key exchange algorithms

    e.g.

    • curve25519-sha256@​libssh.org
    • diffie-hellman-group-exchange-sha256

    Limited MAC algortihms are supported

    https://github.com/jenkinsci/trilead-ssh2/blob/master/src/com/trilead/ssh2/crypto/digest/MAC.java#L19

    Shows support only for weaker MAC algorithms: "hmac-sha1-96", "hmac-sha1", "hmac-md5-96", "hmac-md5"

    More current algorithms should be considered and the library updated to support them.

    e.g.

    • hmac-sha2-512-etm@​openssh.com
    • hmac-sha2-256-etm@​openssh.com
    • hmac-ripemd160-etm@​openssh.com
    • umac-128-etm@​openssh.com
    • hmac-sha2-51
    • hmac-sha2-256
    • hmac-ripemd160
    • umac-128@​openssh.com

    Summary

    https://github.com/jenkinsci/trilead-ssh2 does not meet the more stringent requirements faced when used in a hardened SSH configuration envrionment; this is likely to become an increasing issue as more users move to a more secure configuration.

    As such the library must be updated or replaced to bring in support for more secure algorithms, otherwise users are forced to deploy a known weak configuration to continue using this feature.

  12. jenkins-infra-bot commented on Feb 3, 2016

    @jenkins-infra-bot
    Author
    lievencardoen:
    • Original comment link
    • Raw content of original comment:

      I'm having the same issue. The unix slave (cent os) has been running for months and suddenly, last week (January 30th), I have started to have the same issue described here. We probably did update some Jenkins plugins, but not Jenkins itself. I would need to ask the IT department if something has changed regarding firewalls, other security, ... but I doubt it.

    I'm having the same issue. The unix slave (cent os) has been running for months and suddenly, last week (January 30th), I have started to have the same issue described here. We probably did update some Jenkins plugins, but not Jenkins itself. I would need to ask the IT department if something has changed regarding firewalls, other security, ... but I doubt it.

  13. jenkins-infra-bot commented on Feb 18, 2016

    @jenkins-infra-bot
    Author
    sebanism:
    • Original comment link
    • Raw content of original comment:

      Jenkins folks, Is it possible to get an indication of when this issue might be resolved? We have a security requirement from our client that is impacting, and are keen to at least be able to report on when a resolution might be planned. Thanks!

    Jenkins folks, Is it possible to get an indication of when this issue might be resolved? We have a security requirement from our client that is impacting, and are keen to at least be able to report on when a resolution might be planned. Thanks!

  14. jenkins-infra-bot commented on Feb 18, 2016

    @jenkins-infra-bot
    Author
    lievencardoen:
    • Original comment link
    • Raw content of original comment:

      Same here. Haven't got a clue why this suddenly started occurring. Worked fine for months...

    Same here. Haven't got a clue why this suddenly started occurring. Worked fine for months...

  15. 24 remaining items

  16. jenkins-infra-bot commented on Apr 29, 2017

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Michael Clarke
    Path:
    core/pom.xml
    http://jenkins-ci.org/commit/jenkins/b17d0763709be35d39f16d6af7afaf765ac6cf92
    Log:
    Bump Trilead version to receive a number of security enhancements
    JENKINS-41606">JENKINS-41606JENKINS-33021">JENKINS-33021JENKINS-26379">JENKINS-26379JENKINS-31549">JENKINS-31549

  17. jenkins-infra-bot commented on Apr 29, 2017

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Original comment link
    • Raw content of original comment:

      The fix has been integrated towards 2.58. It is not a backporting candidate

    The fix has been integrated towards 2.58. It is not a backporting candidate

  18. jenkins-infra-bot commented on May 1, 2017

    @jenkins-infra-bot
    Author
    aheritier:

    thanks a lot mc1arke !!!

  19. jenkins-infra-bot commented on Dec 12, 2025

    @jenkins-infra-bot
    Author

    [Original relates_to from Jira: JENKINS-31549]

  20. jenkins-infra-bot commented on Dec 12, 2025

    @jenkins-infra-bot
    Author

    [Original relates_to from Jira: JENKINS-33021]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions