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

checkout fails due to issue with JGit 5.0.2 (in 3.0.0.beta-5)

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      when running checkout scm I get the error:

      java.lang.NoSuchMethodError: org.eclipse.jgit.lib.Repository.getRef(Ljava/lang/String;)Lorg/eclipse/jgit/lib/Ref;
       at jenkins.plugins.git.GitSCMFileSystem$1.invoke(GitSCMFileSystem.java:117)
       at jenkins.plugins.git.GitSCMFileSystem$1.invoke(GitSCMFileSystem.java:114)
       at jenkins.plugins.git.GitSCMFileSystem$3.invoke(GitSCMFileSystem.java:193)
       at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:28)
       at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:75)
       at jenkins.plugins.git.GitSCMFileSystem.invoke(GitSCMFileSystem.java:189)
       at jenkins.plugins.git.GitSCMFileSystem.<init>(GitSCMFileSystem.java:114)
       at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:353)
       at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:196)
       at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:172)
       at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:108)
       at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
       at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:303)
       at hudson.model.ResourceController.execute(ResourceController.java:97)
       at hudson.model.Executor.run(Executor.java:429)
      Finished: FAILURE
      

      I suspect this is related to introducing JGit5.02 in 3.0.0.beta-5 When I step back to 2.7.3 it all works fine.

      I'd like to use the new beta because shallow clone of submodules is supported.

        Attachments

          Activity

          Hide
          xmj Johannes Meixner added a comment -

          What I did was

          • Upgraded Jenkins from 2.138.3 to 2.150.2
          • Upgraded git client to 3.0.0-rc
          • Upgraded git plugin to 4.0.0-rc
          • Restarted Jenkins
          • Restarted Jenkins nodes
          • Nodes wouldn't be able to run most jobs

          I then downgraded to 2.138.3 again, to see if it was the Jenkins version update gone wrong ... it wasn't.

          Then did some back and forth (including multiple restarts) until I noticed this issue on Google.

          Show
          xmj Johannes Meixner added a comment - What I did was Upgraded Jenkins from 2.138.3 to 2.150.2 Upgraded git client to 3.0.0-rc Upgraded git plugin to 4.0.0-rc Restarted Jenkins Restarted Jenkins nodes Nodes wouldn't be able to run most jobs I then downgraded to 2.138.3 again, to see if it was the Jenkins version update gone wrong ... it wasn't. Then did some back and forth (including multiple restarts) until I noticed this issue on Google.
          Hide
          hamzb Hamza Boulaares added a comment - - edited

          I am having the same issue as Johannes Meixner. I am running Jenkins 2.150.2  and today I upgraded:

          • Git client to 3.0.0-rc
          • Git plugin to 4.0.0-rc

          I had the following behavior:

          • Bitbucket Build Status Notifier Plugin no longer updating branches with build status. This plugin depends on Git plugin and after downgrading Git plugin to 3.9.1, build status started showing on branches again
          • Some builds started failing with the following error. Downgrading Git client plugin to 2.7.6 fixed the issue
          java.lang.NoSuchMethodError: org.eclipse.jgit.lib.Repository.getRef(Ljava/lang/String;)Lorg/eclipse/jgit/lib/Ref;
           at jenkins.plugins.git.GitSCMFileSystem$1.invoke(GitSCMFileSystem.java:117)
           at jenkins.plugins.git.GitSCMFileSystem$1.invoke(GitSCMFileSystem.java:114)
           at jenkins.plugins.git.GitSCMFileSystem$3.invoke(GitSCMFileSystem.java:193)
           at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
           at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:81)
           at jenkins.plugins.git.GitSCMFileSystem.invoke(GitSCMFileSystem.java:189)
           at jenkins.plugins.git.GitSCMFileSystem.<init>(GitSCMFileSystem.java:114)
           at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:353)
           at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:198)
           at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:174)
           at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:108)
           at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
           at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293)
           at hudson.model.ResourceController.execute(ResourceController.java:97)
           at hudson.model.Executor.run(Executor.java:429)
           Finished: FAILURE
          
          
          Show
          hamzb Hamza Boulaares added a comment - - edited I am having the same issue as Johannes Meixner . I am running Jenkins  2.150.2   and today I upgraded: Git client to 3.0.0-rc Git plugin to 4.0.0-rc I had the following behavior: Bitbucket Build Status Notifier Plugin no longer updating branches with build status. This plugin depends on Git plugin and after downgrading Git plugin to 3.9.1, build status started showing on branches again Some builds started failing with the following error. Downgrading Git client plugin to 2.7.6 fixed the issue java.lang.NoSuchMethodError: org.eclipse.jgit.lib.Repository.getRef(Ljava/lang/String;)Lorg/eclipse/jgit/lib/Ref; at jenkins.plugins.git.GitSCMFileSystem$1.invoke(GitSCMFileSystem.java:117) at jenkins.plugins.git.GitSCMFileSystem$1.invoke(GitSCMFileSystem.java:114) at jenkins.plugins.git.GitSCMFileSystem$3.invoke(GitSCMFileSystem.java:193) at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:81) at jenkins.plugins.git.GitSCMFileSystem.invoke(GitSCMFileSystem.java:189) at jenkins.plugins.git.GitSCMFileSystem.<init>(GitSCMFileSystem.java:114) at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:353) at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:198) at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:174) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:108) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Finished: FAILURE
          Hide
          drutherford David Rutherford added a comment -

          I'm getting the same issue using the Artifactory plugin.  Upgraded Jenkins to latest LTS (2.150.2) & updated all my out of date plugins and all of a sudden the rtGradleRun pipeline task just hangs eternally with no logs in job console or Jenkins logs indicating anything wrong.  Downloaded & debugged the artifactory plugin source & managed to uncover this same NoMethodFoundError. 

          This ticket is marked fixed but I see no commits in the Git-client-plugins github repo that reference it and the 3.0.0-rc version of the plugin was published to https://plugins.jenkins.io/git-client on Jan 30.  Rolling back the Git & Git-client plugins to the non-rc versions fixed the issue.

          Is there a timeline for when we can expect the fix to actually get built & pushed to the https://plugins.jenkins.io?

          Show
          drutherford David Rutherford added a comment - I'm getting the same issue using the Artifactory plugin.  Upgraded Jenkins to latest LTS (2.150.2) & updated all my out of date plugins and all of a sudden the rtGradleRun pipeline task just hangs eternally with no logs in job console or Jenkins logs indicating anything wrong.  Downloaded & debugged the artifactory plugin source & managed to uncover this same NoMethodFoundError.  This ticket is marked fixed but I see no commits in the Git-client-plugins github repo that reference it and the 3.0.0-rc version of the plugin was published to https://plugins.jenkins.io/git-client  on Jan 30.  Rolling back the Git & Git-client plugins to the non-rc versions fixed the issue. Is there a timeline for when we can expect the fix to actually get built & pushed to the  https://plugins.jenkins.io?
          Hide
          markewaite Mark Waite added a comment -

          David Rutherford, the problem you're seeing is a problem in the artifactory plugin, not a problem in the git client plugin.

          The artifactory plugin depends on JGit version 3. Git client plugin 2.x delivered JGit version 4 which was largely compatible with JGit version 3 but deprecates some API's that were part of JGit 3. Git client plugin 3.x will deliver JGit 5 which removes at least one of the deprecated APIs.

          The artifactory plugin developers have created a pre-release of their plugin that uses the JGit 4 and JGit 5 API instead of the JGit 3 API.

          Your best near term solution is to downgrade to git client plugin 2.7.x. The git client plugin 3.0.0-rc and git plugin 4.0.0-rc were intended to be release candidate builds for further testing in the experimental update center. They were not intended to be production releases for general availability. I made a serious mistake when I chose the "-rc" suffix for the release.

          The update center will soon hide the git client plugin 3.0.0-rc and git plugin 4.0.0-rc release

          Show
          markewaite Mark Waite added a comment - David Rutherford, the problem you're seeing is a problem in the artifactory plugin, not a problem in the git client plugin. The artifactory plugin depends on JGit version 3. Git client plugin 2.x delivered JGit version 4 which was largely compatible with JGit version 3 but deprecates some API's that were part of JGit 3. Git client plugin 3.x will deliver JGit 5 which removes at least one of the deprecated APIs. The artifactory plugin developers have created a pre-release of their plugin that uses the JGit 4 and JGit 5 API instead of the JGit 3 API. Your best near term solution is to downgrade to git client plugin 2.7.x. The git client plugin 3.0.0-rc and git plugin 4.0.0-rc were intended to be release candidate builds for further testing in the experimental update center. They were not intended to be production releases for general availability. I made a serious mistake when I chose the "-rc" suffix for the release. The update center will soon hide the git client plugin 3.0.0-rc and git plugin 4.0.0-rc release
          Hide
          drutherford David Rutherford added a comment -

          My apologies Mark Waite, I naturally should have thought about the problem from the "opposite direction".  I made the mistake of updating my test Jenkins instance plugins wholesale without taking a backup of the plugins dir first and went into panic-mode once my pipeline job started hanging without any sort of logs indicating errors.  Then I managed to crater my entire install & had to restart from a completely clean install making it even harder to figure out where the problem plugin was.  I was certain the issue was somewhere in the recently updated Pipeline: step api plugins until I encountered this error in the debugger.  On the plus side, this was just a test instance running on my local machine & it forced me to learn how to debug Jenkins plugins but I was definitely pulling my hair out for a bit there. 

          Show
          drutherford David Rutherford added a comment - My apologies Mark Waite , I naturally should have thought about the problem from the "opposite direction".  I made the mistake of updating my test Jenkins instance plugins wholesale without taking a backup of the plugins dir first and went into panic-mode once my pipeline job started hanging without any sort of logs indicating errors.  Then I managed to crater my entire install & had to restart from a completely clean install making it even harder to figure out where the problem plugin was.  I was certain the issue was somewhere in the recently updated Pipeline: step api plugins until I encountered this error in the debugger.  On the plus side, this was just a test instance running on my local machine & it forced me to learn how to debug Jenkins plugins but I was definitely pulling my hair out for a bit there. 

            People

            • Assignee:
              Unassigned
              Reporter:
              sa_git sa_git Strukton
            • Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: