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

org.eclipse.jgit.errors.MissingObjectException: Missing commit

    • tasman, Blue Ocean 1.3

      Upgrading the git-client plugin and noticed that pull request builds behind our GitHub Organization Folders started to fail across the board with the following exception:

      Caught: hudson.plugins.git.GitException: org.eclipse.jgit.errors.MissingObjectException: Missing commit 06f18bc86352142786ef533c91350863b382631c
      

      Full log from one such build.

      Branch indexing
      Connecting to https://api.github.com using jenkinsadmin/****** (GitHub access token for jenkinsadmin)
      Cloning the remote Git repository
      remote: Counting objects
      remote: Compressing objects
      Receiving objects
      Resolving deltas
      Updating references
      Merging master commit 3d19d905686b173b8916ee0247d906f536429621 into PR head commit 06f18bc86352142786ef533c91350863b382631c
      Merge succeeded, producing 06f18bc86352142786ef533c91350863b382631c
      Checking out Revision 06f18bc86352142786ef533c91350863b382631c (PR-458)
      First time build. Skipping changelog.
      [Pipeline] properties
      [Pipeline] node
      Running on celery in /home/jenkins/agent-workspace/workspace/Infra_jenkins.io_PR-458-WGT3J3NBHKU6J2KK5XLMWWKKN2CDZN42K6EQVSUQWUMNA4CYPZQA
      [Pipeline] {
      [Pipeline] stage (Clean workspace)
      Using the ‘stage’ step without a block argument is deprecated
      Entering stage Clean workspace
      Proceeding
      [Pipeline] deleteDir
      [Pipeline] sh
      [Infra_jenkins.io_PR-458-WGT3J3NBHKU6J2KK5XLMWWKKN2CDZN42K6EQVSUQWUMNA4CYPZQA] Running shell script
      + ls -lah
      total 24K
      drwxrwxr-x  2 jenkins jenkins 4.0K Nov 17 14:37 .
      drwxrwxr-x 94 jenkins jenkins  20K Nov 17 14:37 ..
      [Pipeline] stage (Checkout source)
      Using the ‘stage’ step without a block argument is deprecated
      Entering stage Checkout source
      Proceeding
      [Pipeline] checkout
      Cloning the remote Git repository
      remote: Counting objects
      remote: Compressing objects
      Receiving objects
      Resolving deltas
      Updating references
      Merging master commit 3d19d905686b173b8916ee0247d906f536429621 into PR head commit 06f18bc86352142786ef533c91350863b382631c
      Merge succeeded, producing 06f18bc86352142786ef533c91350863b382631c
      Checking out Revision 06f18bc86352142786ef533c91350863b382631c (PR-458)
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] echo
      Caught: hudson.plugins.git.GitException: org.eclipse.jgit.errors.MissingObjectException: Missing commit 06f18bc86352142786ef533c91350863b382631c
      [Pipeline] mail
      [Pipeline] End of Pipeline
      

          [JENKINS-39832] org.eclipse.jgit.errors.MissingObjectException: Missing commit

          R. Tyler Croy created issue -

          Mark Waite added a comment -

          Unfortunately, I don't find the strings "Merging " or "Merge succeeded" in either the git plugin or the git client plugin. I would speculate that some other plugin is using the JGit library provided by the git client plugin, and is performing the merge.

          The message from the merge is surprising, since it says that it is merging a commit from the master branch (3d19d9) into the PR head commit (06f18bc) for PR-458. It is odd that it then reports that it is "checking out the PR head commit" (06f18bc). I would have expected it to checkout the results of merging the PR head commit into the master branch (with a resulting new commit) or to checkout the results of merging the master branch into the PR head commit.

          Mark Waite added a comment - Unfortunately, I don't find the strings "Merging " or "Merge succeeded" in either the git plugin or the git client plugin. I would speculate that some other plugin is using the JGit library provided by the git client plugin, and is performing the merge. The message from the merge is surprising, since it says that it is merging a commit from the master branch (3d19d9) into the PR head commit (06f18bc) for PR-458. It is odd that it then reports that it is "checking out the PR head commit" (06f18bc). I would have expected it to checkout the results of merging the PR head commit into the master branch (with a resulting new commit) or to checkout the results of merging the master branch into the PR head commit.
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]

          R. Tyler Croy added a comment -

          Hrm, perhaps this is something in the Branch API plugin or GitHub Branch Source plugin then? I encountered the issue with 2.1.0 of the git-client issue installed, downgraded to 2.0.0 and then restarted, which seemed to fix the issue.

          Perhaps there's some weird behavior being exercised in one of the plugins on top of git-client :/

          R. Tyler Croy added a comment - Hrm, perhaps this is something in the Branch API plugin or GitHub Branch Source plugin then? I encountered the issue with 2.1.0 of the git-client issue installed, downgraded to 2.0.0 and then restarted, which seemed to fix the issue. Perhaps there's some weird behavior being exercised in one of the plugins on top of git-client :/
          R. Tyler Croy made changes -
          Assignee New: Stephen Connolly [ stephenconnolly ]

          Mark Waite added a comment -

          I suspect it is in the git client plugin, though I don't understand precisely what it is in the changes from 2.0.0 to 2.1.0.

          Some possibilities might include:

          • 4a84b7a Upgrade from JGit 4.4.1 to JGit 4.5.0
          • 2c0e732 JGit ignored tag names containing '/'

          I'm sure there are others, but those seem most likely to me.

          If I built a 2.1.0 variant without JGit 4.5.0, could you deploy it as a test?

          Mark Waite added a comment - I suspect it is in the git client plugin, though I don't understand precisely what it is in the changes from 2.0.0 to 2.1.0. Some possibilities might include: 4a84b7a Upgrade from JGit 4.4.1 to JGit 4.5.0 2c0e732 JGit ignored tag names containing '/' I'm sure there are others, but those seem most likely to me. If I built a 2.1.0 variant without JGit 4.5.0, could you deploy it as a test?

          Mark Waite added a comment -

          I suspect it is in the git client plugin, though I don't understand precisely what it is in the changes from 2.0.0 to 2.1.0.

          Some possibilities might include:

          • 4a84b7a Upgrade from JGit 4.4.1 to JGit 4.5.0
          • 2c0e732 JGit ignored tag names containing '/'

          I'm sure there are others, but those seem most likely to me.

          If I built a 2.1.0 variant without JGit 4.5.0, could you deploy it as a test?

          Mark Waite added a comment - I suspect it is in the git client plugin, though I don't understand precisely what it is in the changes from 2.0.0 to 2.1.0. Some possibilities might include: 4a84b7a Upgrade from JGit 4.4.1 to JGit 4.5.0 2c0e732 JGit ignored tag names containing '/' I'm sure there are others, but those seem most likely to me. If I built a 2.1.0 variant without JGit 4.5.0, could you deploy it as a test?

          Jonas added a comment - - edited

          I am experiencing the same bug, I think:

          hudson.plugins.git.GitException: org.eclipse.jgit.errors.MissingObjectException: Missing commit eef01d322c4d33827a7dafa888050b647563bc34
          at org.jenkinsci.plugins.gitclient.JGitAPIImpl$4.includes(JGitAPIImpl.java:1005)
          at io.jenkins.blueocean.autofavorite.FavoritingScmListener.onCheckout(FavoritingScmListener.java:58)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:123)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:83)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:73)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:52)
          at hudson.security.ACL.impersonate(ACL.java:221)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:49)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          at java.lang.Thread.run(Thread.java:745)
          Caused by: org.eclipse.jgit.errors.MissingObjectException: Missing commit eef01d322c4d33827a7dafa888050b647563bc34
          at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:159)
          at org.eclipse.jgit.revwalk.RevWalk.getCachedBytes(RevWalk.java:903)
          at org.eclipse.jgit.revwalk.RevCommit.parseHeaders(RevCommit.java:155)
          at org.eclipse.jgit.revwalk.RevWalk.markStart(RevWalk.java:293)
          at org.jenkinsci.plugins.gitclient.JGitAPIImpl$4.includes(JGitAPIImpl.java:1001)

          I am using "git client plugin 2.0.0". It happens on a multibranch pipeline, first time I build the branch. If I re-run the build, it works.

          I am using the following command to checkout:

          checkout(
          [
          $class: 'GitSCM',
          branches: [[name: "origin/branch"]],
          doGenerateSubmoduleConfigurations: false,
          extensions: [[$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: true]],
          submoduleCfg: [],
          userRemoteConfigs:
          [
          [credentialsId: '<credentialsId>', url: '<url>']
          ]
          ])

          Jonas added a comment - - edited I am experiencing the same bug, I think: hudson.plugins.git.GitException: org.eclipse.jgit.errors.MissingObjectException: Missing commit eef01d322c4d33827a7dafa888050b647563bc34 at org.jenkinsci.plugins.gitclient.JGitAPIImpl$4.includes(JGitAPIImpl.java:1005) at io.jenkins.blueocean.autofavorite.FavoritingScmListener.onCheckout(FavoritingScmListener.java:58) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:123) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:83) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:73) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:52) at hudson.security.ACL.impersonate(ACL.java:221) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:49) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.eclipse.jgit.errors.MissingObjectException: Missing commit eef01d322c4d33827a7dafa888050b647563bc34 at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:159) at org.eclipse.jgit.revwalk.RevWalk.getCachedBytes(RevWalk.java:903) at org.eclipse.jgit.revwalk.RevCommit.parseHeaders(RevCommit.java:155) at org.eclipse.jgit.revwalk.RevWalk.markStart(RevWalk.java:293) at org.jenkinsci.plugins.gitclient.JGitAPIImpl$4.includes(JGitAPIImpl.java:1001) I am using "git client plugin 2.0.0". It happens on a multibranch pipeline, first time I build the branch. If I re-run the build, it works. I am using the following command to checkout: checkout( [ $class: 'GitSCM', branches: [ [name: "origin/branch"] ], doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: true] ], submoduleCfg: [], userRemoteConfigs: [ [credentialsId: '<credentialsId>', url: '<url>'] ] ])

          Mark Waite added a comment - - edited

          jones if you're seeing that exception on git client plugin 2.0.0 and if your condition is the same as the condition seen by 201604291_tyler, then the problem is not related to the transition from JGit 2.4 to JGit 2.5. Unfortunately, I don't know how to duplicate the problem you're seeing.

          I am a little surprised by one of the entries in your Jenkinsfile checkout definition. You declare that the checkout should be shallow, but declare the depth of the shallow clone to be 0, which would normally mean "don't do a shallow clone". If you intend to use a shallow clone, you probably want a small, positive, non-zero integer for the depth value (like 1). Further, if JGit is used for that clone, then that should result in a warning in the log which says that JGit does not support shallow clone (which it doesn't).

          Mark Waite added a comment - - edited jones if you're seeing that exception on git client plugin 2.0.0 and if your condition is the same as the condition seen by 201604291_tyler , then the problem is not related to the transition from JGit 2.4 to JGit 2.5. Unfortunately, I don't know how to duplicate the problem you're seeing. I am a little surprised by one of the entries in your Jenkinsfile checkout definition. You declare that the checkout should be shallow, but declare the depth of the shallow clone to be 0, which would normally mean "don't do a shallow clone". If you intend to use a shallow clone, you probably want a small, positive, non-zero integer for the depth value (like 1). Further, if JGit is used for that clone, then that should result in a warning in the log which says that JGit does not support shallow clone (which it doesn't).

          Jonas added a comment -

          Yeah, it was mainly to let you know that it was not useful to build a 2.1.0 variant without JGit 4.5.0 .

          Looking at my plugins, I realized that the pipeline-multibranch-plugin (https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Multibranch+Plugin) was talking about SCM ("In cases where the SCM source does not recognize a branch and fails to determine its tip revision, fail with a clearer message.") in a recent update. I updated to 2.9.2, and it seems to work, now.

          I hope it can help rtyler.

          Jonas added a comment - Yeah, it was mainly to let you know that it was not useful to build a 2.1.0 variant without JGit 4.5.0 . Looking at my plugins, I realized that the pipeline-multibranch-plugin ( https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Multibranch+Plugin ) was talking about SCM ("In cases where the SCM source does not recognize a branch and fails to determine its tip revision, fail with a clearer message.") in a recent update. I updated to 2.9.2, and it seems to work, now. I hope it can help rtyler .

            Unassigned Unassigned
            rtyler R. Tyler Croy
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: