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

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

    • 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.

       

          [JENKINS-54724] ssh-credentials-plugin broken when using ssh-slaves-plugin 1.29.0

          Devin Nusbaum added a comment -

          Based on this post by ifernandezcalvo, I think this should be fixed in the 1.29.1 release of ssh-slaves.

          Devin Nusbaum added a comment - Based on this post by ifernandezcalvo , I think this should be fixed in the 1.29.1 release of ssh-slaves.

          Ivan Fernandez Calvo added a comment - - edited

          yep, it is caused by JENKINS-54686, I have fixed it this morning on ssh-slaves 1.29.1

          Ivan Fernandez Calvo added a comment - - edited yep, it is caused by JENKINS-54686 , I have fixed it this morning on ssh-slaves 1.29.1

          I still see the issue with 1.29.1

          arrigo zanette added a comment - I still see the issue with 1.29.1

          Could you please execute the following script in your Jenkins console and attach the result? it will generate the list of installed plugins, this will allow me to try to replicate the issue.

          result = ''
          for (plugin in Jenkins.instance.pluginManager.plugins) {
          	result = result + "${plugin.displayName}" + ',' + "${plugin.version}\n"
          }
          return result
          

          Ivan Fernandez Calvo added a comment - Could you please execute the following script in your Jenkins console and attach the result? it will generate the list of installed plugins, this will allow me to try to replicate the issue. result = '' for (plugin in Jenkins.instance.pluginManager.plugins) { result = result + "${plugin.displayName}" + ',' + "${plugin.version}\n" } return result

          I did fix it cleaning the plugin folder and reinstalling 1.29.1 from scratch. Now it works.

          arrigo zanette added a comment - I did fix it cleaning the plugin folder and reinstalling 1.29.1 from scratch. Now it works.

          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!

          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!

          Nenad Miksa added a comment -

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

          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

          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 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 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 added a comment -

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

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

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

              Created:
              Updated:
              Resolved: