Repository navigation
Description
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
jenkins-infra-bot commentedon Jan 11, 2015
Raw content of original comment:
Looks like the password is wrong or something like that.
jenkins-infra-bot commentedon Jan 12, 2015
magneto09:
Raw content of original comment:
I am able to connect from other hosts using same ssh credentials
jenkins-infra-bot commentedon Jun 8, 2015
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.
jenkins-infra-bot commentedon Jun 8, 2015
Raw content of original comment:
magneto09 https://wiki.jenkins-ci.org/display/JENKINS/How+to+report+an+issue#Howtoreportanissue-WhatinformationtoprovideforEnvironmentandDescription
jenkins-infra-bot commentedon Jun 8, 2015
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-infra-bot commentedon Jun 9, 2015
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
jenkins-infra-bot commentedon Jun 9, 2015
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 ....
jenkins-infra-bot commentedon Jun 9, 2015
Raw content of original comment:
The man on my Ubuntu 14.04 server says :
jenkins-infra-bot commentedon Jun 9, 2015
Raw content of original comment:
Additional note on fdrouet case, the exception was :
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)
jenkins-infra-bot commentedon Jun 10, 2015
ryreitsma:
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.
jenkins-infra-bot commentedon Sep 17, 2015
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
jenkins-infra-bot commentedon Nov 23, 2015
oneiroi:
Raw content of original comment:
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.
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.
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.
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.
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.
jenkins-infra-bot commentedon Feb 3, 2016
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.
jenkins-infra-bot commentedon Feb 18, 2016
sebanism:
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-infra-bot commentedon Feb 18, 2016
Raw content of original comment:
Same here. Haven't got a clue why this suddenly started occurring. Worked fine for months...
24 remaining items
jenkins-infra-bot commentedon Apr 29, 2017
Raw content of original comment:
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-31549jenkins-infra-bot commentedon Apr 29, 2017
Raw content of original comment:
The fix has been integrated towards 2.58. It is not a backporting candidate
jenkins-infra-bot commentedon May 1, 2017
Raw content of original comment:
thanks a lot mc1arke !!!
jenkins-infra-bot commentedon Dec 12, 2025
[Original
relates_tofrom Jira: JENKINS-31549]jenkins-infra-bot commentedon Dec 12, 2025
[Original
relates_tofrom Jira: JENKINS-33021]