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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • 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

    Description

      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.

       

      Attachments

        Issue Links

          Activity

            tomdev Tom de Vries added a comment -

            Yesterday I downgraded the plugin to 1.28.x. Today upgraded to 1.29.1 and that seems to be working fine!

            tomdev Tom de Vries added a comment - Yesterday I downgraded the plugin to 1.28.x. Today upgraded to 1.29.1 and that seems to be working fine!
            dodoent Nenad Miksa added a comment -

            This resurfaces back in 1.29.2. Downgrading to 1.29.1 solves the issue for me.

            dodoent Nenad Miksa added a comment - This resurfaces back in 1.29.2. Downgrading to 1.29.1 solves the issue for me.

            if you upgrade from 1.29.X, you would have to uninstall trilead-api plugin is no longer used and it is the source of the classpath error

            ifernandezcalvo Ivan Fernandez Calvo added a comment - if you upgrade from 1.29.X, you would have to uninstall trilead-api plugin is no longer used and it is the source of the classpath error
            cowwoc cowwoc added a comment -

            ifernandezcalvo I don't have trilead-api plugin installed and yet I am getting this error in version 1.29.2 of this plugin. Please reopen this bug. It is not fixed.

            cowwoc cowwoc added a comment - ifernandezcalvo I don't have trilead-api plugin installed and yet I am getting this error in version 1.29.2 of this plugin. Please reopen this bug. It is not fixed.
            cowwoc cowwoc added a comment -

            Nevermind. Upgrading to version 1.29.4 of this plugin fixes the problem. Thank you.

            cowwoc cowwoc added a comment - Nevermind. Upgrading to version 1.29.4 of this plugin fixes the problem. Thank you.

            People

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

              Dates

                Created:
                Updated:
                Resolved: