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

Getting java.lang.ClassNotFoundException: com.jcraft.jsch.Buffer while using git with https

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Blocker Blocker
    • core
    • redhat linux, using jdk7, jenkins.war (1.633) with latest plugins

      I wanted to update latest jenkins and plugins, but I am getting the following exception when checking out any project from our stash server via https.

      I have checked the plugins folder, jsch is available in the following places:

      _./scp/WEB-INF/lib/jsch-0.1.42.jar
      ./maven-plugin/WEB-INF/lib/jsch-0.1.44-1.jar
      ./ssh/WEB-INF/lib/jsch-0.1.42.jar
      ./git-changelog/WEB-INF/lib/jsch-0.1.53.jar
      ./git-client/WEB-INF/lib/jsch-0.1.50.jar
      ./cvs/WEB-INF/lib/jsch-0.1.50.jar
      _
      So you see jsch is available in git-client-plugin, but somehow it can not be loaded.
      For us this is blocker, because we have to update to new versions due to another reason and are not able to.

      hudson.plugins.git.GitException: Failed to fetch from https://stash.ourcompany.de/scm/project/repo.git
      at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:763)
      at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1012)
      at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1043)
      at hudson.scm.SCM.checkout(SCM.java:485)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1277)
      at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
      at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
      at hudson.model.Run.execute(Run.java:1741)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:408)
      Caused by: hudson.plugins.git.GitException: java.io.IOException: Remote call on diva-vtdivaci01-x failed
      at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:172)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:94)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
      at java.lang.reflect.Method.invoke(Method.java:619)
      at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:131)
      at com.sun.proxy.$Proxy55.execute(Unknown Source)
      at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:761)
      ... 11 more
      Caused by: java.io.IOException: Remote call on diva-vtdivaci01-x failed
      at hudson.remoting.Channel.call(Channel.java:786)
      at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:145)
      ... 18 more
      Caused by: java.lang.ExceptionInInitializerError
      at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:120)
      at org.jenkinsci.plugins.gitclient.JGitAPIImpl$2.execute(JGitAPIImpl.java:631)
      at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
      at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
      at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      at hudson.remoting.Request$2.run(Request.java:328)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at hudson.remoting.Engine$1$1.run(Engine.java:63)
      at java.lang.Thread.run(Thread.java:745)
      at ......remote call to diva-vtdivaci01-x(Native Method)
      at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1413)
      at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
      at hudson.remoting.Channel.call(Channel.java:778)
      ... 19 more
      Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.jcraft.jsch.Buffer
      at org.kohsuke.asm5.ClassWriter.getCommonSuperClass(ClassWriter.java:1684)
      at org.kohsuke.asm5.ClassWriter.getMergedType(ClassWriter.java:1654)
      at org.kohsuke.asm5.Frame.merge(Frame.java:1426)
      at org.kohsuke.asm5.Frame.merge(Frame.java:1325)
      at org.kohsuke.asm5.MethodWriter.visitMaxs(MethodWriter.java:1475)
      at org.kohsuke.asm5.tree.MethodNode.accept(MethodNode.java:833)
      at org.kohsuke.asm5.commons.JSRInlinerAdapter.visitEnd(JSRInlinerAdapter.java:187)
      at org.kohsuke.asm5.MethodVisitor.visitEnd(MethodVisitor.java:877)
      at org.kohsuke.asm5.ClassReader.readMethod(ClassReader.java:1021)
      at org.kohsuke.asm5.ClassReader.accept(ClassReader.java:693)
      at org.kohsuke.asm5.ClassReader.accept(ClassReader.java:506)
      at org.jenkinsci.bytecode.Transformer.transform(Transformer.java:76)
      at hudson.ClassicPluginStrategy$AntClassLoader2.defineClassFromData(ClassicPluginStrategy.java:800)
      at jenkins.util.AntClassLoader.getClassFromStream(AntClassLoader.java:1310)
      at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1366)
      at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326)
      at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:707)
      at hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch4(RemoteClassLoader.java:761)
      at hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch3(RemoteClassLoader.java:818)
      at sun.reflect.GeneratedMethodAccessor129.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
      at java.lang.reflect.Method.invoke(Method.java:619)
      at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:608)
      at hudson.remoting.Request$2.run(Request.java:326)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
      at java.util.concurrent.FutureTask.run(FutureTask.java:273)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1176)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
      at java.lang.Thread.run(Thread.java:795)

          [JENKINS-30994] Getting java.lang.ClassNotFoundException: com.jcraft.jsch.Buffer while using git with https

          Mark Waite added a comment -

          You said that you're running "latest version". Does that mean that you really must upgrade to the latest weekly Jenkins build, or have you attempted to upgrade to the latest long term support release (1.625.1)? If you must upgrade to the latest weekly, please share the specific things you need in latest weekly that are not available in the most recent long term support release.

          You said that you're running "latest version", so I assume that means git plugin 2.4.0 and git client plugin 1.19.0. Can you confirm those are the versions you're running?

          You mentioned that the problem happens on a slave, but didn't provide information about the slave environment. Is it also a Red Hat machine, and if so, what version of Red Hat, what Java version, what Java vendor, etc.?

          Does the same problem appear if the job is forced to execute on the master rather than on a slave? Nicolas Deloof found (and applied a work around) for a class not found exception in the git client plugin 1.19.0 or the git plugin 2.4.0 (or both). You could review the change log of those two plugins to see if they give any hints that might be helpful in your investigation.

          Mark Waite added a comment - You said that you're running "latest version". Does that mean that you really must upgrade to the latest weekly Jenkins build, or have you attempted to upgrade to the latest long term support release (1.625.1)? If you must upgrade to the latest weekly, please share the specific things you need in latest weekly that are not available in the most recent long term support release. You said that you're running "latest version", so I assume that means git plugin 2.4.0 and git client plugin 1.19.0. Can you confirm those are the versions you're running? You mentioned that the problem happens on a slave, but didn't provide information about the slave environment. Is it also a Red Hat machine, and if so, what version of Red Hat, what Java version, what Java vendor, etc.? Does the same problem appear if the job is forced to execute on the master rather than on a slave? Nicolas Deloof found (and applied a work around) for a class not found exception in the git client plugin 1.19.0 or the git plugin 2.4.0 (or both). You could review the change log of those two plugins to see if they give any hints that might be helpful in your investigation.

          Markus Oley added a comment -

          Hi Mark,

          sorry - this was written unclear. With latest version I mean version 1.633 of jenkins.war. I used this version and not the LTS version, because I am using web client to update. And there I don't have any choice which version to use. In addition to that I use:

          • Git-Plugin 2.4.0
          • Git-Client 1.1.19, you are right.

          I didn't think that the slave environment is relevant for this ClassNotFoundException, but voila:

          java.runtime.version 1.7.0_80-b15
          java.specification.name Java Platform API Specification
          java.specification.vendor Oracle Corporation
          java.specification.version 1.7

          The os is:
          CentOS release 6.6 (Final)
          LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch

          Sorry, the master is:
          SUSE Linux Enterprise Server 11 (x86_64)
          VERSION = 11
          PATCHLEVEL = 3
          And the problem occurs on this machine too.

          The workaround with copying the jsch.jar fixes the problem, but we don't know if this has side effects maybe on other plugins, because we are using different plugins, which use jsch as well, but in different versions.

          When I build this git job on master it doesn't work, too, but - surprise - I get a different exception :
          java.lang.NoClassDefFoundError: org.eclipse.jgit.transport.Transport (initialization failure)
          at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
          at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:120)
          at org.jenkinsci.plugins.gitclient.JGitAPIImpl$5.execute(JGitAPIImpl.java:1440)
          at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1003)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1043)
          at hudson.scm.SCM.checkout(SCM.java:485)
          at hudson.model.AbstractProject.checkout(AbstractProject.java:1277)
          at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
          at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
          at hudson.model.Run.execute(Run.java:1741)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:98)
          at hudson.model.Executor.run(Executor.java:408)
          Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.eclipse.jgit.lib.ObjectIdRef$Unpeeled
          at org.kohsuke.asm5.ClassWriter.getCommonSuperClass(ClassWriter.java:1684)
          at org.kohsuke.asm5.ClassWriter.getMergedType(ClassWriter.java:1654

          Thank you for your help
          Cheers
          Markus

          Markus Oley added a comment - Hi Mark, sorry - this was written unclear. With latest version I mean version 1.633 of jenkins.war. I used this version and not the LTS version, because I am using web client to update. And there I don't have any choice which version to use. In addition to that I use: Git-Plugin 2.4.0 Git-Client 1.1.19, you are right. I didn't think that the slave environment is relevant for this ClassNotFoundException, but voila: java.runtime.version 1.7.0_80-b15 java.specification.name Java Platform API Specification java.specification.vendor Oracle Corporation java.specification.version 1.7 The os is: CentOS release 6.6 (Final) LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch Sorry, the master is: SUSE Linux Enterprise Server 11 (x86_64) VERSION = 11 PATCHLEVEL = 3 And the problem occurs on this machine too. The workaround with copying the jsch.jar fixes the problem, but we don't know if this has side effects maybe on other plugins, because we are using different plugins, which use jsch as well, but in different versions. When I build this git job on master it doesn't work, too, but - surprise - I get a different exception : java.lang.NoClassDefFoundError: org.eclipse.jgit.transport.Transport (initialization failure) at java.lang.J9VMInternals.initialize(J9VMInternals.java:177) at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:120) at org.jenkinsci.plugins.gitclient.JGitAPIImpl$5.execute(JGitAPIImpl.java:1440) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1003) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1043) at hudson.scm.SCM.checkout(SCM.java:485) at hudson.model.AbstractProject.checkout(AbstractProject.java:1277) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532) at hudson.model.Run.execute(Run.java:1741) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:408) Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.eclipse.jgit.lib.ObjectIdRef$Unpeeled at org.kohsuke.asm5.ClassWriter.getCommonSuperClass(ClassWriter.java:1684) at org.kohsuke.asm5.ClassWriter.getMergedType(ClassWriter.java:1654 Thank you for your help Cheers Markus

          Mark Waite added a comment -

          If it is failing on both the master and the slave, you might want to check that the plugins are all enabled. For example, if the ssh-credentials plugin is installed, but not enabled, that might cause the type of message you're seeing. Look also that the credentials plugin is enabled.

          Mark Waite added a comment - If it is failing on both the master and the slave, you might want to check that the plugins are all enabled. For example, if the ssh-credentials plugin is installed, but not enabled, that might cause the type of message you're seeing. Look also that the credentials plugin is enabled.

          Markus Oley added a comment -

          Hi Mark,

          thank you for your answer,

          both ssh-credentials (1.11) and credentials(1.24) are installed and enabled.
          As well ssh-plugin 2.4, ssh slaves plugin 1.10, plain credentials plugin 1.1.

          Best regards
          Markus

          Markus Oley added a comment - Hi Mark, thank you for your answer, both ssh-credentials (1.11) and credentials(1.24) are installed and enabled. As well ssh-plugin 2.4, ssh slaves plugin 1.10, plain credentials plugin 1.1. Best regards Markus

          Markus Oley added a comment -

          Hi again,

          sorry, but as 3 weeks passed with no actions on the bug, I justed wanted to ask if there are any ideas why this problem occurs?
          Does another one have this problems?

          Markus Oley added a comment - Hi again, sorry, but as 3 weeks passed with no actions on the bug, I justed wanted to ask if there are any ideas why this problem occurs? Does another one have this problems?

          Markus Oley added a comment -

          Hi guys,

          I have to say sorry - I have done a little bit of investigation and noticed that a plugin of our own made gitclient-plugin fail.

          Sorry,

          Cheers
          Markus

          Markus Oley added a comment - Hi guys, I have to say sorry - I have done a little bit of investigation and noticed that a plugin of our own made gitclient-plugin fail. Sorry, Cheers Markus

            Unassigned Unassigned
            moley77 Markus Oley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: