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

ssh-credentials-plugin broken when using ssh-slaves-plugin 1.29.0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • ssh-credentials-plugin
    • Jenkins v2.138.2
      ssh-credentials-plugin version 1.14
      ssh-slaves-plugin version 1.29.0
    • ssh-slaves-1.29.1

      Jenkins fails to launch agents when using the following combination of plugins:

      • ssh-credentials-plugin version 1.14
      • ssh-slaves-plugin version 1.29.0

      This results in the following error:

      SSHLauncher{host='jenkins-worker.example.com', port=22, credentialsId='bc123fc4-0123-4123-9123-81230e2d0e4d', jvmOptions='', javaPath='', prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=210, maxNumRetries=80, retryWaitTime=15, sshHostKeyVerificationStrategy=None, tcpNoDelay=true, trackCredentials=true}
      [11/20/18 10:47:48] [SSH] Opening SSH connection to jenkins-worker.example.com:22.
      [11/20/18 10:47:49] [SSH] WARNING: SSH Host Keys are not being verified. Man-in-the-middle attacks may be possible against this connection.
      ERROR: Unexpected error in launching a agent. This is probably a bug in Jenkins.
      java.lang.NoClassDefFoundError: com/trilead/ssh2/Connection
        at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPasswordAuthenticator$Factory.supports(TrileadSSHPasswordAuthenticator.java:194)
        at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPasswordAuthenticator$Factory.newInstance(TrileadSSHPasswordAuthenticator.java:181)
        at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:216)
        at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:170)
        at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1213)
        at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:846)
        at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:833)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
      [11/20/18 10:47:50] Launch failed - cleaning up connection
      [11/20/18 10:47:50] [SSH] Connection closed.

      Cause

      This issue is caused by the ssh-slaves-plugin not longer using the trilead-ssh2 module from the Jenkins core. However, ssh-credentials-plugin still requires this. See: https://github.com/jenkinsci/ssh-slaves-plugin/blob/master/doc/TROUBLESHOOTING.md#1290-breaks-compatibility-with-cloud-plugins-that-do-not-use-trilead-api-plugin-as-dependency

      Workaround

      Current workaround is to downgrade the ssh-slaves-plugin to version 1.28.1.

       

            ifernandezcalvo Ivan Fernandez Calvo
            tomdev Tom de Vries
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: