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

SSH plugin fails intermittently because of issue with JSch

      This is similar to an earlier bug https://issues.jenkins-ci.org/browse/JENKINS-24402?jql=text%20~%20%22jsch%22

       

      Same problem has resurfaced in the later releases of JSch, because of that we get failed builds intermittently with the below error.

       

      JSch has included a fix for this problem in the latest version , v0.1.55.

      Upgrading Jenkins SSH plugin to this version should fix this problem.

       

      These discussion forums provide the context

      discussion about the issues in JSch and fix https://sourceforge.net/p/jsch/bugs/111/

      discussion about previous fix in Jenkins SSH plugin and further recurrences https://stackoverflow.com/questions/12279836/ssh-using-jschexception-verify-false-sometimes-fails

       

      Stacktrace:

      [SSH] executing...
      [SSH] Exception:Session.connect: java.security.SignatureException: Invalid encoding for signature
      com.jcraft.jsch.JSchException: Session.connect: java.security.SignatureException: Invalid encoding for signature
      at com.jcraft.jsch.Session.connect(Session.java:565)
      at org.jvnet.hudson.plugins.CredentialsSSHSite.createSession(CredentialsSSHSite.java:132)
      at org.jvnet.hudson.plugins.CredentialsSSHSite.executeCommand(CredentialsSSHSite.java:208)
      at org.jvnet.hudson.plugins.SSHBuilder.perform(SSHBuilder.java:104)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
      at hudson.model.Build$BuildExecution.build(Build.java:206)
      at hudson.model.Build$BuildExecution.doRun(Build.java:163)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
      at hudson.model.Run.execute(Run.java:1798)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:429)

       

          [JENKINS-56031] SSH plugin fails intermittently because of issue with JSch

          Oleg Nenashev added a comment -

          CC jvz and jthompson just in case I am missing something

          Oleg Nenashev added a comment - CC jvz and jthompson just in case I am missing something

          Matt Sicker added a comment -

          Chances are that the old version of JSch was less restrictive about allowed key parameters and such. Do you have info about the server and client ciphers being used? Key sizes, algorithm choice, that sort of thing.

          Matt Sicker added a comment - Chances are that the old version of JSch was less restrictive about allowed key parameters and such. Do you have info about the server and client ciphers being used? Key sizes, algorithm choice, that sort of thing.

          Jeff Thompson added a comment -

          Looks correct to me. The 0.1.55 version is available and looks like it may fix the problem. The ssh-plugin should be updated to use the new dependency version.

          Jeff Thompson added a comment - Looks correct to me. The 0.1.55 version is available and looks like it may fix the problem. The ssh-plugin should be updated to use the new dependency version.

          Matt Sicker added a comment -

          But the jsch-plugin is already updated to JSCH 0.1.55. You made the release: https://github.com/jenkinsci/jsch-plugin/releases/tag/jsch-0.1.55

          Matt Sicker added a comment - But the jsch-plugin is already updated to JSCH 0.1.55. You made the release: https://github.com/jenkinsci/jsch-plugin/releases/tag/jsch-0.1.55

          Jeff Thompson added a comment -

          jvz, right. I released the jsch-plugin 0.1.55 containing the fix the for this. The ssh-plugin should be updated to reference the new jsch-plugin version. kusumanchi might be able to update the jsch-plugin version and test it out.

          Jeff Thompson added a comment - jvz , right. I released the jsch-plugin 0.1.55 containing the fix the for this. The ssh-plugin should be updated to reference the new jsch-plugin version. kusumanchi might be able to update the jsch-plugin version and test it out.

          V Kusumanchi added a comment -

          jthompson, jvz I have updated the pom.xml with the reference to 0.1.55 version of jsch plugin.

          Raised a PR for the change, https://github.com/dev-medha-io/ssh-plugin/pull/1

          Could anyone merge this? Thanks

          V Kusumanchi added a comment - jthompson , jvz I have updated the pom.xml with the reference to 0.1.55 version of jsch plugin. Raised a PR for the change, https://github.com/dev-medha-io/ssh-plugin/pull/1 Could anyone merge this? Thanks

          Jeff Thompson added a comment -

          kusumanchi, I think you want to change your pull request to merge into the master branch on jenkinsci/ssh-plugin. Otherwise, it looks good.

          Jeff Thompson added a comment - kusumanchi , I think you want to change your pull request to merge into the master branch on jenkinsci/ssh-plugin. Otherwise, it looks good.

          V Kusumanchi added a comment -

          Thank you  jthompson, I created a new PR merging into jenkinsci/ssh-plugin.

          kindly have another look  https://github.com/jenkinsci/ssh-plugin/pull/18

          If you are happy, please merge it.

           

          V Kusumanchi added a comment - Thank you  jthompson , I created a new PR merging into jenkinsci/ssh-plugin. kindly have another look  https://github.com/jenkinsci/ssh-plugin/pull/18 If you are happy, please merge it.  

          Would it be worth considering an update to this fork? https://github.com/mwiede/jsch

          Claudio Bantaloukas added a comment - Would it be worth considering an update to this fork? https://github.com/mwiede/jsch

          Please consider this PR that should solve the issue

          https://github.com/jenkinsci/jsch-plugin/pull/33

          Claudio Bantaloukas added a comment - Please consider this PR that should solve the issue https://github.com/jenkinsci/jsch-plugin/pull/33

            kusumanchi V Kusumanchi
            kusumanchi V Kusumanchi
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: