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

Use trilead-api plugin instead trilead-ssh2 from core

    • ssh-slaves-1.29.1

      Remove the dependency of the Trilead-ssh2 plugin and use the Trilead-api plugins instead, this means that ssh-slaves plugins no longer uses the trilead-ssh2 plugin provider by the Jenkins core, it will use the Trilead-api version, so now it is possible to upgrade the plugin ssh library without to upgrade the core.

          [JENKINS-54686] Use trilead-api plugin instead trilead-ssh2 from core

          John Zila added a comment -

          FYI this breaks the ec2-fleet plugin.

          John Zila added a comment - FYI this breaks the ec2-fleet plugin.

          John Zila added a comment -
          SSHLauncher{host='10.0.0.21', port=22, credentialsId='b6a4fe2c-9ba5-4052-b91c-7a15e913df37', jvmOptions='-Xmx8192m', javaPath='', prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=210, maxNumRetries=10, retryWaitTime=15, sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.ManuallyTrustedKeyVerificationStrategy, tcpNoDelay=true, trackCredentials=false}
          [11/20/18 00:29:56] [SSH] Opening SSH connection to 10.0.0.21:22.
          [11/20/18 00:29:57] [SSH] SSH host key matches key seen previously for this host. Connection will be allowed.
          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 00:29:57] Launch failed - cleaning up connection
          [11/20/18 00:29:57] [SSH] Connection closed. 

          John Zila added a comment - SSHLauncher{host='10.0.0.21', port=22, credentialsId='b6a4fe2c-9ba5-4052-b91c-7a15e913df37', jvmOptions='-Xmx8192m', javaPath='', prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=210, maxNumRetries=10, retryWaitTime=15, sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.ManuallyTrustedKeyVerificationStrategy, tcpNoDelay=true, trackCredentials=false} [11/20/18 00:29:56] [SSH] Opening SSH connection to 10.0.0.21:22. [11/20/18 00:29:57] [SSH] SSH host key matches key seen previously for this host. Connection will be allowed. 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 00:29:57] Launch failed - cleaning up connection [11/20/18 00:29:57] [SSH] Connection closed.

          Mike Corum added a comment -

          This "fix" busted all my jobs that use SSH slaves - they all get a classNotFoundException on the trilead/ssh2/Base64 class.  I assumed there was some other dependency that this required so I made sure to be on the very latest Jenkins and the very latest of all my plugins.  It still broke everything.  

          What do we have to do in order to make this version work?  It's seriously busted.

          Mike Corum added a comment - This "fix" busted all my jobs that use SSH slaves - they all get a classNotFoundException on the trilead/ssh2/Base64 class.  I assumed there was some other dependency that this required so I made sure to be on the very latest Jenkins and the very latest of all my plugins.  It still broke everything.   What do we have to do in order to make this version work?  It's seriously busted.

          Mike Corum added a comment -

          Can this "fix" be reversed?  It completely breaks all uses of the SSH Slaves plugin.  Any job using this plugin immediately gets a stack trace with a ClassNotFoundException with the trilead ssh2 Base64 class.  This includes being at the very latest release of Jenkins and the latest of all other plugins.  I tried reverting the Jenkins to the previous release but it didn't help.

          Mike Corum added a comment - Can this "fix" be reversed?  It completely breaks all uses of the SSH Slaves plugin.  Any job using this plugin immediately gets a stack trace with a ClassNotFoundException with the trilead ssh2 Base64 class.  This includes being at the very latest release of Jenkins and the latest of all other plugins.  I tried reverting the Jenkins to the previous release but it didn't help.

          king arthur added a comment -

          did someone help to fix it, my jenkins has down for 1 day

          king arthur added a comment - did someone help to fix it, my jenkins has down for 1 day

          ye yulei added a comment -

          I also have the same problem. I have rolled back the SSH slave plug-in to the previous version, waiting for repair.

          ye yulei added a comment - I also have the same problem. I have rolled back the SSH slave plug-in to the previous version, waiting for repair.

          ye yulei added a comment -

          Using SSH Slaves 1.29.0 to configure the slave page, you can add credentials, but you can't choose. By default, you limit the current and only the current

          ye yulei added a comment - Using SSH Slaves 1.29.0 to configure the slave page, you can add credentials, but you can't choose. By default, you limit the current and only the current

          king arthur added a comment -

          thank you, yyl1007, jenkins is back!

          king arthur added a comment - thank you, yyl1007 , jenkins is back!

          Mejdoub Mejdi added a comment -

          The rollback work fine. Thanks guys.

          Mejdoub Mejdi added a comment - The rollback work fine. Thanks guys.

          Ivan Fernandez Calvo added a comment - - edited

          I added a section on the troubleshooting guide about this issue 1.29.0 Breaks compatibility with Cloud plugins that do not use trilead-api plugin as dependency, also added to the breaking changes that this version breaks backward with Cloud plugins. I will manage to make PRs to all the plugins that have ssh-slaves as a dependency to move forward and remove trilead-ssh2 core library as dependency on plugins.

          Ivan Fernandez Calvo added a comment - - edited I added a section on the troubleshooting guide about this issue 1.29.0 Breaks compatibility with Cloud plugins that do not use trilead-api plugin as dependency , also added to the breaking changes that this version breaks backward with Cloud plugins. I will manage to make PRs to all the plugins that have ssh-slaves as a dependency to move forward and remove trilead-ssh2 core library as dependency on plugins.

          I also commented about the issue in the developers google group https://groups.google.com/forum/#!topic/jenkinsci-dev/Ba69w3M-jX0

          Ivan Fernandez Calvo added a comment - I also commented about the issue in the developers google group https://groups.google.com/forum/#!topic/jenkinsci-dev/Ba69w3M-jX0

          David Aldrich added a comment -

          This is pretty nasty. I am running Jenkins 2.138.3 LTS and updated to SSH Slaves 1.29.0 this morning. Restarting Jenkins resulted in an exception on the entire browser window. Jenkins UI was blocked. Had to rollback the plugin manually from the command line.

          David Aldrich added a comment - This is pretty nasty. I am running Jenkins 2.138.3 LTS and updated to SSH Slaves 1.29.0 this morning. Restarting Jenkins resulted in an exception on the entire browser window. Jenkins UI was blocked. Had to rollback the plugin manually from the command line.

          Ivan Fernandez Calvo added a comment - - edited

          if this PR passes the CI I will merge and release a new version without mask the core classes this fix the issue, then I will include the dependency on all plugins that depends on ssh-slaves-plugin, finally, I will mask the dependency on trilead-api plugin

          Ivan Fernandez Calvo added a comment - - edited if this PR passes the CI I will merge and release a new version without mask the core classes this fix the issue, then I will include the dependency on all plugins that depends on ssh-slaves-plugin, finally, I will mask the dependency on trilead-api plugin

          I just upgraded the ssh-slave from 1.28.1 to 1.29.1, and immediately got the same stack-trace.

          Downgrading to 1.29.0 also produced the stack-trace.

           

          Finally, back on 1.28.1, everything is back to normal.

           

          On each of the above mentioned versions, I've tested both trilead-api 1.0.0 and 1.0.1 - but this plugin version does not seem to affect the problem.

           

          Flemming Steffensen added a comment - I just upgraded the ssh-slave from 1.28.1 to 1.29.1 , and immediately got the same stack-trace. Downgrading to 1.29.0 also produced the stack-trace.   Finally, back on 1.28.1 , everything is back to normal.   On each of the above mentioned versions, I've tested both trilead-api 1.0.0 and 1.0.1 - but this plugin version does not seem to affect the problem.  

          Ivan Fernandez Calvo added a comment - - edited

          I have confirmation on a few issues that the upgrade to 1.29.1 fix the issue, it required a restart if not yo do not change the plugin, check that you are using the right version of the plugin by executing the following script in the Jenkins script console

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

          JENKINS-54061
          JENKINS-54713

          Ivan Fernandez Calvo added a comment - - edited I have confirmation on a few issues that the upgrade to 1.29.1 fix the issue, it required a restart if not yo do not change the plugin, check that you are using the right version of the plugin by executing the following script in the Jenkins script console result = '' for (plugin in Jenkins.instance.pluginManager.plugins) { result = result + "${plugin.displayName}" + ',' + "${plugin.version}\n" } return result JENKINS-54061 JENKINS-54713

          ifernandezcalvo

          I were manually installing the plugins, and stopping the Jenkins service before each installation.

          The only two plugins changed on my system were ssh-slave and trilead-api.

          I manually tried these combinations (in this order), before I wrote here:

           

          1.29.1 + 1.0.1 = Stacktrace on boot

           1.29.1 + 1.0.0 = Stacktrace on boot

          1.29.0 + 1.0.0 = Stacktrace on boot

          1.28.1 + 1.0.0 = Works

          1.28.1 + 1.0.1 = Works

          1.29.0 + 1.0.1 = Stacktrace on boot

           

          Ended up using this combination:

          1.28.1 + 1.0.1 = Works

           

           

          Flemming Steffensen added a comment - ifernandezcalvo I were manually installing the plugins, and stopping the Jenkins service before each installation. The only two plugins changed on my system were ssh-slave and trilead-api. I manually tried these combinations (in this order), before I wrote here:   1.29.1 + 1.0.1 = Stacktrace on boot  1.29.1 + 1.0.0 = Stacktrace on boot 1.29.0 + 1.0.0 = Stacktrace on boot 1.28.1 + 1.0.0 = Works 1.28.1 + 1.0.1 = Works 1.29.0 + 1.0.1 = Stacktrace on boot   Ended up using this combination: 1.28.1 + 1.0.1 = Works    

          Csaba Sari added a comment -

          Hi ifernandezcalvo

          I can confirm fsteff's report, exactly the same issue on CentOS 7, with Jenkins LTS 2.138.3. Only the 1.28.1 works for me. 

          regards,

          Csaba

          Csaba Sari added a comment - Hi ifernandezcalvo ,  I can confirm fsteff 's report, exactly the same issue on CentOS 7, with Jenkins LTS 2.138.3. Only the 1.28.1 works for me.  regards, Csaba

          Ivan Fernandez Calvo added a comment - - edited

          ssh-slaves 1.28.1 does not use trilead-api, it was introduced in 1.29.0.

          I have tested a few stuff

          • A fresh installation of Jenkins 2.152, I do not see the issue
          • A fresh installation of Jenkins 2.73.3(I choose this because you can not install 1.29.X), then upgrade to 2.152 and upgrade the plugins, I do not see the issue

          You can test the same if you want:

          • Copy your JENKINS_HOME and your jenkins.war to a test machine
          • Go to the test machine
          • Go to the JENKINS_HOME folder
          • Remove the plugin from the plugins folder rm -fr plugins/ssh-slaves* (the asterisk matters)
          • Start Jenkins 'JENKINS_HOME=$(pwd) java -jar jenkins.war'
          • Enter in the test instance on port 8080 'http://test.exampl.com:8080'
          • Upgrade the plugin
          • Restart

          Ivan Fernandez Calvo added a comment - - edited ssh-slaves 1.28.1 does not use trilead-api, it was introduced in 1.29.0. I have tested a few stuff A fresh installation of Jenkins 2.152, I do not see the issue A fresh installation of Jenkins 2.73.3(I choose this because you can not install 1.29.X), then upgrade to 2.152 and upgrade the plugins, I do not see the issue You can test the same if you want: Copy your JENKINS_HOME and your jenkins.war to a test machine Go to the test machine Go to the JENKINS_HOME folder Remove the plugin from the plugins folder rm -fr plugins/ssh-slaves * (the asterisk matters) Start Jenkins 'JENKINS_HOME=$(pwd) java -jar jenkins.war' Enter in the test instance on port 8080 'http://test.exampl.com:8080' Upgrade the plugin Restart

            ifernandezcalvo Ivan Fernandez Calvo
            ifernandezcalvo Ivan Fernandez Calvo
            Votes:
            1 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved: