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

git jgit missing object exception

    Details

    • Similar Issues:

      Description

       

      org.eclipse.jgit.errors.MissingObjectException: Missing unknown c67d289233e6413f25f25464270f571ef716d757
      at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:158)
      at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:227)
      at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:859)
      at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:772)
      at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:25)
      at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:13)
      at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:71)
      at sun.reflect.GeneratedMethodAccessor471.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:320)
      at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:295)
      at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:254)
      at hudson.remoting.UserRequest.perform(UserRequest.java:121)
      at hudson.remoting.UserRequest.perform(UserRequest.java:49)
      at hudson.remoting.Request$2.run(Request.java:324)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      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 hudson.remoting.Engine$1$1.run(Engine.java:63)
      at java.lang.Thread.run(Thread.java:748)
      at ......remote call to Channel to /10.166.29.53(Native Method)
      at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1545)
      at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
      at hudson.remoting.Channel.call(Channel.java:830)
      at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:257)
      at com.sun.proxy.$Proxy77.withRepository(Unknown Source)
      at org.jenkinsci.plugins.gitclient.RemoteGitImpl.withRepository(RemoteGitImpl.java:235)
      at hudson.plugins.git.GitSCM.printCommitMessageToLog(GitSCM.java:1189)
      at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1153)
      at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109)
      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:47)
      at hudson.security.ACL.impersonate(ACL.java:260)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
      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)
      Finished: FAILURE

      I see the above exception which continuously fails the job. I am able to successfully clone the repository in question outside of Jenkins, and I have since tried deleting the entire workspace of the Jenkins job, as well as completely re-cloned and re-uploaded the repository in question, other instances of jobs which pull this change and test appear to work as expected.

        Attachments

          Issue Links

            Activity

            jekeller Jacob Keller created issue -
            Hide
            jekeller Jacob Keller added a comment -

            I can go into the workspace and use cli git to checkout the commit, and everything appears just fine. "git fsck" reports a dangling commit, but this is expected since we fetched refs/changes/<blah> directly into FETCH_HEAD so the commit should be dangling.

            Show
            jekeller Jacob Keller added a comment - I can go into the workspace and use cli git to checkout the commit, and everything appears just fine. "git fsck" reports a dangling commit, but this is expected since we fetched refs/changes/<blah> directly into FETCH_HEAD so the commit should be dangling.
            Hide
            jekeller Jacob Keller added a comment -

            The following stack overflow article may provide more insight:

            https://stackoverflow.com/questions/26090139/jgit-reading-commits-from-a-submodule

            Specifically, I have a job with one parent repository, and two submodule repositories, where I update the submodule using a separate "checkout[]" step in order to test the entire parent project with a gerrit reference of a submodule.

             

            This used to work, I'm not sure which version of Git-plugin I was using, investigating now. I suspect that FileRepositoryBuilder no longer correctly obtains the git repository if given a path to submodule/.git.....

            Show
            jekeller Jacob Keller added a comment - The following stack overflow article may provide more insight: https://stackoverflow.com/questions/26090139/jgit-reading-commits-from-a-submodule Specifically, I have a job with one parent repository, and two submodule repositories, where I update the submodule using a separate "checkout[]" step in order to test the entire parent project with a gerrit reference of a submodule.   This used to work, I'm not sure which version of Git-plugin I was using, investigating now. I suspect that FileRepositoryBuilder no longer correctly obtains the git repository if given a path to submodule/.git.....
            Hide
            jekeller Jacob Keller added a comment -

            Actually, this started since commit 171c81911472 ("Print commit short message to log", 2017-04-21), which is when this new commit message bit was added. Unfortunately, that breaks for this use-case, because Jgit does not open the repository object correctly.

             

            I found this, I'm not sure if it should be considered a bug in the JGit, or in how we implement the repository. We're effectively directly setting the git directory when we obtain a Repository object. I'm not sure what the best way to fix this is yet, but I'll have a proposal soon.

            Show
            jekeller Jacob Keller added a comment - Actually, this started since commit 171c81911472 ("Print commit short message to log", 2017-04-21), which is when this new commit message bit was added. Unfortunately, that breaks for this use-case, because Jgit does not open the repository object correctly.   I found this, I'm not sure if it should be considered a bug in the JGit, or in how we implement the repository. We're effectively directly setting the git directory when we obtain a Repository object. I'm not sure what the best way to fix this is yet, but I'll have a proposal soon.
            Hide
            jekeller Jacob Keller added a comment -

            I added a test case for this issue and a potential solution/workaround to the git-client-plugin https://github.com/jenkinsci/git-client-plugin/pull/253

             

            I'm also proposing a solution that fixes FileRepositoryBuilder.create() in JGit

             

            Show
            jekeller Jacob Keller added a comment - I added a test case for this issue and a potential solution/workaround to the git-client-plugin https://github.com/jenkinsci/git-client-plugin/pull/253   I'm also proposing a solution that fixes FileRepositoryBuilder.create() in JGit  
            markewaite Mark Waite made changes -
            Field Original Value New Value
            Assignee Mark Waite [ markewaite ] Jacob Keller [ jekeller ]
            Hide
            markewaite Mark Waite added a comment -

            Will be included in next git client plugin release after 2.4.6.

            Show
            markewaite Mark Waite added a comment - Will be included in next git client plugin release after 2.4.6.
            markewaite Mark Waite made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Hide
            markewaite Mark Waite added a comment -

            Git client plugin 2.5.0 released 27 Jul 2017 includes this fix

            Show
            markewaite Mark Waite added a comment - Git client plugin 2.5.0 released 27 Jul 2017 includes this fix
            jekeller Jacob Keller made changes -
            Description Triggered by Gerrit:
            [https://git-amr-1.devtools.intel.com/gerrit/168044]
            Checking out groovy pipeline code to read HOOKS/jenkins/pipeline/ifc.groovy
             > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
             > git config remote.origin.url ssh://jbrandeb-host.jf.intel.com/home/jenkins/mirrors/nd_linux-hooks # timeout=10
            Fetching upstream changes from ssh://jbrandeb-host.jf.intel.com/home/jenkins/mirrors/nd_linux-hooks
             > git --version # timeout=10
            using GIT_SSH to set credentials ND Linux CI Server
             > git fetch --tags --progress ssh://jbrandeb-host.jf.intel.com/home/jenkins/mirrors/nd_linux-hooks +refs/heads/*:refs/remotes/origin/*
             > git rev-parse refs/remotes/origin/master^\{commit} # timeout=10
             > git rev-parse refs/remotes/origin/origin/master^\{commit} # timeout=10
            Checking out Revision 1a2eac01cba8f94779f5528e9692ac489f27114c (refs/remotes/origin/master)
            Commit message: "sync-gerrit-mirrors: add additional channel transport check"
             > git config core.sparsecheckout # timeout=10
             > git checkout -f 1a2eac01cba8f94779f5528e9692ac489f27114c
             > git rev-list 1a2eac01cba8f94779f5528e9692ac489f27114c # timeout=10
            Loading library GroovyLib@master
             > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
             > git config remote.origin.url
            [http://gitbucket.jf.intel.com/git/jekeller/jenkins-groovy-lib.git]
             # timeout=10
            Fetching upstream changes from
            [http://gitbucket.jf.intel.com/git/jekeller/jenkins-groovy-lib.git]
             > git --version # timeout=10
            Setting http proxy: proxy-chain.intel.com:911
             > git fetch --tags --progress
            [http://gitbucket.jf.intel.com/git/jekeller/jenkins-groovy-lib.git]
             +refs/heads/*:refs/remotes/origin/*
             > git rev-parse refs/remotes/origin/master^\{commit} # timeout=10
             > git rev-parse refs/remotes/origin/origin/master^\{commit} # timeout=10
            Checking out Revision b10e58acde484439b09bea0efe8e3ed6db44f2b8 (refs/remotes/origin/master)
            Commit message: "gerritSubmodule: document the gerritSubmodule function"
             > git config core.sparsecheckout # timeout=10
             > git checkout -f b10e58acde484439b09bea0efe8e3ed6db44f2b8
             > git rev-list b10e58acde484439b09bea0efe8e3ed6db44f2b8 # timeout=10
            [Pipeline] node
            Running on fedora-rawhide-47dfd82d in /home/jenkins/workspace/ifc/pipeline@2
            [Pipeline] \{
            [Pipeline] stage
            [Pipeline] \{ (git)
            [Pipeline] checkout
            Cloning the remote Git repository
            Cloning repository ssh://jbrandeb-host.jf.intel.com/home/jenkins/mirrors/nd_sw_cloud-ifc_linux
             > git init /home/jenkins/workspace/ifc/pipeline@2 # timeout=10
            Fetching upstream changes from ssh://jbrandeb-host.jf.intel.com/home/jenkins/mirrors/nd_sw_cloud-ifc_linux
             > git --version # timeout=10
            using GIT_SSH to set credentials ND Linux CI Server
             > git fetch --tags --progress ssh://jbrandeb-host.jf.intel.com/home/jenkins/mirrors/nd_sw_cloud-ifc_linux +refs/heads/*:refs/remotes/origin/*
             > git config remote.origin.url ssh://jbrandeb-host.jf.intel.com/home/jenkins/mirrors/nd_sw_cloud-ifc_linux # timeout=10
             > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
             > git config remote.origin.url ssh://jbrandeb-host.jf.intel.com/home/jenkins/mirrors/nd_sw_cloud-ifc_linux # timeout=10
            Fetching upstream changes from ssh://jbrandeb-host.jf.intel.com/home/jenkins/mirrors/nd_sw_cloud-ifc_linux
            using GIT_SSH to set credentials ND Linux CI Server
             > git fetch --tags --progress ssh://jbrandeb-host.jf.intel.com/home/jenkins/mirrors/nd_sw_cloud-ifc_linux +refs/heads/*:refs/remotes/origin/*
             > git rev-parse origin/master^\{commit} # timeout=10
            Checking out Revision ac79b0c304997975d6badb05558fbed77c245050 (origin/master)
            Commit message: "ifc: Update compat reference"
             > git config core.sparsecheckout # timeout=10
             > git checkout -f ac79b0c304997975d6badb05558fbed77c245050
             > git rev-list ac79b0c304997975d6badb05558fbed77c245050 # timeout=10
            Cleaning workspace
             > git rev-parse --verify HEAD # timeout=10
            Resetting working tree
             > git reset --hard # timeout=10
             > git clean -fdx # timeout=10
             > git submodule foreach --recursive git reset --hard # timeout=10
             > git submodule foreach --recursive git clean -fdx # timeout=10
             > git remote # timeout=10
             > git submodule init # timeout=10
             > git submodule sync # timeout=10
             > git config --get remote.origin.url # timeout=10
             > git submodule init # timeout=10
             > git config -f .gitmodules --get-regexp ^submodule\.(.*)\.url # timeout=10
             > git config --get submodule.src/SHARED.url # timeout=10
             > git remote # timeout=10
             > git config --get remote.origin.url # timeout=10
             > git config -f .gitmodules --get submodule.src/SHARED.path # timeout=10
            using GIT_SSH to set credentials ND Linux CI Server
             > git submodule update --init --recursive src/SHARED
             > git config --get submodule.src/COMPAT.url # timeout=10
             > git remote # timeout=10
             > git config --get remote.origin.url # timeout=10
             > git config -f .gitmodules --get submodule.src/COMPAT.path # timeout=10
            using GIT_SSH to set credentials ND Linux CI Server
             > git submodule update --init --recursive src/COMPAT
            [Pipeline] checkout
             > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
             > git config remote.origin.url ssh://jbrandeb-host.jf.intel.com/home/jenkins/mirrors/nd_linux-compat # timeout=10
            Fetching upstream changes from ssh://jbrandeb-host.jf.intel.com/home/jenkins/mirrors/nd_linux-compat
             > git --version # timeout=10
            using GIT_SSH to set credentials ND Linux CI Server
             > git fetch --tags --progress ssh://jbrandeb-host.jf.intel.com/home/jenkins/mirrors/nd_linux-compat refs/changes/44/168044/4
             > git rev-parse c67d289233e6413f25f25464270f571ef716d757^\{commit} # timeout=10
            Checking out Revision c67d289233e6413f25f25464270f571ef716d757 (refs/changes/44/168044/4)
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            org.eclipse.jgit.errors.MissingObjectException: Missing unknown c67d289233e6413f25f25464270f571ef716d757
            at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:158)
            at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:227)
            at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:859)
            at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:772)
            at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:25)
            at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:13)
            at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
            at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:71)
            at sun.reflect.GeneratedMethodAccessor471.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:320)
            at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:295)
            at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:254)
            at hudson.remoting.UserRequest.perform(UserRequest.java:121)
            at hudson.remoting.UserRequest.perform(UserRequest.java:49)
            at hudson.remoting.Request$2.run(Request.java:324)
            at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
            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 hudson.remoting.Engine$1$1.run(Engine.java:63)
            at java.lang.Thread.run(Thread.java:748)
            at ......remote call to Channel to /10.166.29.53(Native Method)
            at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1545)
            at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
            at hudson.remoting.Channel.call(Channel.java:830)
            at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:257)
            at com.sun.proxy.$Proxy77.withRepository(Unknown Source)
            at org.jenkinsci.plugins.gitclient.RemoteGitImpl.withRepository(RemoteGitImpl.java:235)
            at hudson.plugins.git.GitSCM.printCommitMessageToLog(GitSCM.java:1189)
            at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1153)
            at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109)
            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:47)
            at hudson.security.ACL.impersonate(ACL.java:260)
            at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
            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)
            Finished: FAILURE

            I see the above exception which continuously fails the job. I am able to successfully clone the repository in question outside of Jenkins, and I have since tried deleting the entire workspace of the Jenkins job, as well as completely re-cloned and re-uploaded the repository in question, other instances of jobs which pull this change and test appear to work as expected.
             

            org.eclipse.jgit.errors.MissingObjectException: Missing unknown c67d289233e6413f25f25464270f571ef716d757
             at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:158)
             at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:227)
             at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:859)
             at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:772)
             at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:25)
             at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:13)
             at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
             at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:71)
             at sun.reflect.GeneratedMethodAccessor471.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
             at java.lang.reflect.Method.invoke(Method.java:498)
             at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:320)
             at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:295)
             at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:254)
             at hudson.remoting.UserRequest.perform(UserRequest.java:121)
             at hudson.remoting.UserRequest.perform(UserRequest.java:49)
             at hudson.remoting.Request$2.run(Request.java:324)
             at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
             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 hudson.remoting.Engine$1$1.run(Engine.java:63)
             at java.lang.Thread.run(Thread.java:748)
             at ......remote call to Channel to /10.166.29.53(Native Method)
             at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1545)
             at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
             at hudson.remoting.Channel.call(Channel.java:830)
             at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:257)
             at com.sun.proxy.$Proxy77.withRepository(Unknown Source)
             at org.jenkinsci.plugins.gitclient.RemoteGitImpl.withRepository(RemoteGitImpl.java:235)
             at hudson.plugins.git.GitSCM.printCommitMessageToLog(GitSCM.java:1189)
             at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1153)
             at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109)
             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:47)
             at hudson.security.ACL.impersonate(ACL.java:260)
             at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
             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)
             Finished: FAILURE

            I see the above exception which continuously fails the job. I am able to successfully clone the repository in question outside of Jenkins, and I have since tried deleting the entire workspace of the Jenkins job, as well as completely re-cloned and re-uploaded the repository in question, other instances of jobs which pull this change and test appear to work as expected.
            Hide
            zovitsadam Adam Zovits added a comment - - edited

            Hi everybody! We are experiencing this bug even after upgrading to 2.5.0. Is there any way I can help debug or solve this issue?

            org.eclipse.jgit.errors.MissingObjectException: Missing unknown e70464c5a3f2003858020477bcb4b81756726012
            at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:158)
            at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:227)
            at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:859)
            at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:772)
            at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:25)
            at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:13)
            at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
            at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:71)
            at hudson.plugins.git.GitSCM.printCommitMessageToLog(GitSCM.java:1195)
            at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1159)
            at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109)
            at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:130)
            at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:120)
            at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:247)
            at hudson.model.ResourceController.execute(ResourceController.java:97)
            at hudson.model.Executor.run(Executor.java:405)

            Thank you!

            Show
            zovitsadam Adam Zovits added a comment - - edited Hi everybody! We are experiencing this bug even after upgrading to 2.5.0. Is there any way I can help debug or solve this issue? org.eclipse.jgit.errors.MissingObjectException: Missing unknown e70464c5a3f2003858020477bcb4b81756726012 at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:158) at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:227) at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:859) at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:772) at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:25) at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:13) at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:71) at hudson.plugins.git.GitSCM.printCommitMessageToLog(GitSCM.java:1195) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1159) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:130) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:120) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:247) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:405) Thank you!
            Hide
            markewaite Mark Waite added a comment -

            Adam Zovits since you're still seeing the problem (and you're probably not using submodules), I suspect you're seeing a different bug which shows itself through a similar stack trace.

            While reviewing the code to remove the offending call, I think I found a way to solve the problem.  You could "test drive" the pull request build (when it finishes about 20 minutes from now).  It  proposes a fix for the problem (without yet having written a test to show the problem).

            Show
            markewaite Mark Waite added a comment - Adam Zovits since you're still seeing the problem (and you're probably not using submodules), I suspect you're seeing a different bug which shows itself through a similar stack trace. While reviewing the code to remove the offending call, I think I found a way to solve the problem.  You could "test drive" the pull request build (when it finishes about 20 minutes from now).  It  proposes a fix for the problem (without yet having written a test to show the problem).
            Hide
            zovitsadam Adam Zovits added a comment -

            Thank you Mark, I will try it either today or sometimes after the 18th, depending on the ability to restart our Jenkins.

            Show
            zovitsadam Adam Zovits added a comment - Thank you Mark, I will try it either today or sometimes after the 18th, depending on the ability to restart our Jenkins.
            Hide
            zovitsadam Adam Zovits added a comment - - edited

            I have tried this build of the plugin. The failure was reproducible on our infrastructure (Jenkins 2.60.3 and Bitbucket 4.13.0) by creating a branch from DEV, making a change to this branch, creating a PR back to DEV (Jenkins then automatically started a build for the PR), then updating the soruce branch without looking at the PR in Bitbucket. This has resulted in Jenkins being notified about an update to the PR and trying to build it again, but could not check out the current head, leading to the "MissingObjectException: Missing unknown {HASH}" exception.

            After installing this build (Git plugin 3.5.2-SNAPSHOT (private-c603bebf-jenkins)) and performing the above steps again, the error still occurred, but in a slightly different form: 

            hudson.plugins.git.GitException: Command "C:\Program Files\Git\bin\git.exe checkout -f 7e3b26c44a5198e550a6aef49ad173b89a149bb6" returned status code 128:
            stdout:
            stderr: fatal: reference is not a tree: 7e3b26c44a5198e550a6aef49ad173b89a149bb6

            at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1924)
            at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$800(CliGitAPIImpl.java:71)
            at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2214)
            Caused: hudson.plugins.git.GitException: Could not checkout 7e3b26c44a5198e550a6aef49ad173b89a149bb6
            at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2237)
            at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1165)
            at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109)
            at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:130)
            at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:120)
            at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:247)
            at hudson.model.ResourceController.execute(ResourceController.java:97)
            at hudson.model.Executor.run(Executor.java:405)
            Finished: FAILURE

            The error is resolved just as before by opening the PR in the web interface of Bitbucket itself, as outlined here. I recognize that this is an implementation detail of Bitbucket and so is outside your influence, so I'll keep pestering the Bitbucket team with it. Thank you for the assistance!

             

            Show
            zovitsadam Adam Zovits added a comment - - edited I have tried this build of the plugin. The failure was reproducible on our infrastructure (Jenkins 2.60.3 and Bitbucket 4.13.0) by creating a branch from DEV, making a change to this branch, creating a PR back to DEV (Jenkins then automatically started a build for the PR), then updating the soruce branch without looking at the PR in Bitbucket. This has resulted in Jenkins being notified about an update to the PR and trying to build it again, but could not check out the current head, leading to the "MissingObjectException: Missing unknown {HASH}" exception. After installing this build (Git plugin 3.5.2-SNAPSHOT (private-c603bebf-jenkins)) and performing the above steps again, the error still occurred, but in a slightly different form:  hudson.plugins.git.GitException: Command "C:\Program Files\Git\bin\git.exe checkout -f 7e3b26c44a5198e550a6aef49ad173b89a149bb6" returned status code 128: stdout: stderr: fatal: reference is not a tree: 7e3b26c44a5198e550a6aef49ad173b89a149bb6 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1924) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$800(CliGitAPIImpl.java:71) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2214) Caused: hudson.plugins.git.GitException: Could not checkout 7e3b26c44a5198e550a6aef49ad173b89a149bb6 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2237) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1165) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:130) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:120) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:247) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:405) Finished: FAILURE The error is resolved just as before by opening the PR in the web interface of Bitbucket itself, as outlined  here . I recognize that this is an implementation detail of Bitbucket and so is outside your influence, so I'll keep pestering the Bitbucket team with it. Thank you for the assistance!  
            Hide
            markewaite Mark Waite added a comment - - edited

            Adam Zovits thanks very much for the additional details.  I attempted unsuccessfully to write an automated test which would show the problem.  Based on your description of the details of the problem, I will try a different path on my next attempt.

            Is your Bitbucket web hook configured to send the sha1 of the commit?  The behavior you're describing seems like it might change in a relevant way if the web hook were passing the sha1 of the commit.

            If it is passing the sha1 of the commit, does it behave better if you disable passing the sha1 and instead rely on Jenkins to determine the sha1 of the commit?

            Also, can you confirm that you are not using git submodules?  The fix from Jacob Keller was specifically for submodules and should not have modified behavior for cases which are not using submodules.

            Show
            markewaite Mark Waite added a comment - - edited Adam Zovits thanks very much for the additional details.  I attempted unsuccessfully to write an automated test which would show the problem.  Based on your description of the details of the problem, I will try a different path on my next attempt. Is your Bitbucket web hook configured to send the sha1 of the commit?  The behavior you're describing seems like it might change in a relevant way if the web hook were passing the sha1 of the commit. If it is passing the sha1 of the commit, does it behave better if you disable passing the sha1 and instead rely on Jenkins to determine the sha1 of the commit? Also, can you confirm that you are not using git submodules?  The fix from Jacob Keller was specifically for submodules and should not have modified behavior for cases which are not using submodules.
            Hide
            markewaite Mark Waite added a comment -

            I've revised the pull request to ignore the exception, log the exception message to the build log, and continue.  The code which is causing the exception is an optional aid for users, not a critical part of the build.  A new build will be available from ci.jenkins.io as a new build of the same pull request.

            Show
            markewaite Mark Waite added a comment - I've revised the pull request to ignore the exception, log the exception message to the build log, and continue.  The code which is causing the exception is an optional aid for users, not a critical part of the build.  A new build will be available from ci.jenkins.io as a new build of the same pull request .
            Hide
            zovitsadam Adam Zovits added a comment -

            Mark Waite Yes, I can confirm that we aren't using submodules. Sorry for not realizing earlier that this bug was about submodules.

            Show
            zovitsadam Adam Zovits added a comment - Mark Waite Yes, I can confirm that we aren't using submodules. Sorry for not realizing earlier that this bug was about submodules.
            Hide
            maybee Malte Brunnlieb added a comment -

            Hi,

            I am getting the missing object exception as well with Jenkins 2.60.3 + Git Plugin 3.5.1 + Git Client Plugin 2.5.0 + Github Plugin 1.28.0 + Github PR Builder 1.39.0.

            However, it is maybe caused by a file not found exception at the beginning. I am not sure, what file could not be found. I am guessing that it may be the Jenkinsfile. However, the Jenkinsfile definitively exists. Any ideas?
            Btw. we are using submodules.

             

            09:44:10 Connecting to https://api.github.com using XXXXXX/****** (devonfw-ci GitHub Account)
            Loading trusted files from base branch master at a3333dcd9a125830df529efa206f925283d24d6b rather than cb296562cac0d1512202433d3056a0c9e4d2ebf2
            ERROR: Could not do lightweight checkout, falling back to heavyweight
            java.io.FileNotFoundException
            at jenkins.plugins.git.GitSCMFile$3.invoke(GitSCMFile.java:167)
            at jenkins.plugins.git.GitSCMFile$3.invoke(GitSCMFile.java:159)
            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:71)
            at jenkins.plugins.git.GitSCMFileSystem.invoke(GitSCMFileSystem.java:189)
            at jenkins.plugins.git.GitSCMFile.content(GitSCMFile.java:159)
            at jenkins.scm.api.SCMFile.contentAsString(SCMFile.java:338)
            at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:104)
            at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:263)
            at hudson.model.ResourceController.execute(ResourceController.java:97)
            at hudson.model.Executor.run(Executor.java:405)
            Checking out git https://github.com/XXXXXX/XXXXXX.git into /var/jenkins_home/workspace/XXXXXX_PR-305-head-TBRL6UISNUYACAVZ7XSH4RRQSDXTCR7IAF7UBSQK76MNQVNFVOVA@script to read Jenkinsfile
            > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
            > git config remote.origin.url https://github.com/XXXXXX/XXXXXX.git # timeout=10
            Cleaning workspace
            > git rev-parse --verify HEAD # timeout=10
            No valid HEAD. Skipping the resetting
            > git clean -fdx # timeout=10
            Fetching without tags
            Fetching upstream changes from https://github.com/XXXXXX/XXXXXX.git
            > git --version # timeout=10
            using GIT_ASKPASS to set credentials XXXXXX GitHub Account
            > git fetch --no-tags --progress https://github.com/XXXXXX/XXXXXX.git +refs/pull/305/head:refs/remotes/origin/PR-305-head
            Checking out Revision a3333dcd9a125830df529efa206f925283d24d6b (master)

            GitHub has been notified of this commit’s build result

            org.eclipse.jgit.errors.MissingObjectException: Missing unknown a3333dcd9a125830df529efa206f925283d24d6b
            at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:158)
            at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:227)
            at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:859)
            at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:772)
            at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:25)
            at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:13)
            at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
            at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:71)
            at hudson.plugins.git.GitSCM.printCommitMessageToLog(GitSCM.java:1195)
            at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1159)
            at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
            at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:130)
            at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:120)
            at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:263)
            at hudson.model.ResourceController.execute(ResourceController.java:97)
            at hudson.model.Executor.run(Executor.java:405)
            Finished: FAILURE

            Show
            maybee Malte Brunnlieb added a comment - Hi, I am getting the missing object exception as well with Jenkins 2.60.3 + Git Plugin 3.5.1 + Git Client Plugin 2.5.0 + Github Plugin 1.28.0 + Github PR Builder 1.39.0. However, it is maybe caused by a file not found exception at the beginning. I am not sure, what file could not be found. I am guessing that it may be the Jenkinsfile. However, the Jenkinsfile definitively exists. Any ideas? Btw. we are using submodules.   09:44:10 Connecting to https://api.github.com using XXXXXX/****** (devonfw-ci GitHub Account) Loading trusted files from base branch master at a3333dcd9a125830df529efa206f925283d24d6b rather than cb296562cac0d1512202433d3056a0c9e4d2ebf2 ERROR: Could not do lightweight checkout, falling back to heavyweight java.io.FileNotFoundException at jenkins.plugins.git.GitSCMFile$3.invoke(GitSCMFile.java:167) at jenkins.plugins.git.GitSCMFile$3.invoke(GitSCMFile.java:159) 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:71) at jenkins.plugins.git.GitSCMFileSystem.invoke(GitSCMFileSystem.java:189) at jenkins.plugins.git.GitSCMFile.content(GitSCMFile.java:159) at jenkins.scm.api.SCMFile.contentAsString(SCMFile.java:338) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:104) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:263) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:405) Checking out git https://github.com/XXXXXX/XXXXXX.git into /var/jenkins_home/workspace/XXXXXX_PR-305-head-TBRL6UISNUYACAVZ7XSH4RRQSDXTCR7IAF7UBSQK76MNQVNFVOVA@script to read Jenkinsfile > git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url https://github.com/XXXXXX/XXXXXX.git # timeout=10 Cleaning workspace > git rev-parse --verify HEAD # timeout=10 No valid HEAD. Skipping the resetting > git clean -fdx # timeout=10 Fetching without tags Fetching upstream changes from https://github.com/XXXXXX/XXXXXX.git > git --version # timeout=10 using GIT_ASKPASS to set credentials XXXXXX GitHub Account > git fetch --no-tags --progress https://github.com/XXXXXX/XXXXXX.git +refs/pull/305/head:refs/remotes/origin/PR-305-head Checking out Revision a3333dcd9a125830df529efa206f925283d24d6b (master) GitHub has been notified of this commit’s build result org.eclipse.jgit.errors.MissingObjectException: Missing unknown a3333dcd9a125830df529efa206f925283d24d6b at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:158) at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:227) at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:859) at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:772) at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:25) at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:13) at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:71) at hudson.plugins.git.GitSCM.printCommitMessageToLog(GitSCM.java:1195) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1159) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:130) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:120) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:263) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:405) Finished: FAILURE
            Hide
            markewaite Mark Waite added a comment -

            Thanks Malte Brunnlieb. I suspect the first stack trace in your comment is not related to the missing object exception.

            The missing object exception you're seeing has the same printCommitMessageToLog in its stack trace, so it should be resolved by the pull request that I've submitted. Could you download the git.hpi from that pull request and see if it prevents the build failure in your case?

            Show
            markewaite Mark Waite added a comment - Thanks Malte Brunnlieb . I suspect the first stack trace in your comment is not related to the missing object exception. The missing object exception you're seeing has the same printCommitMessageToLog in its stack trace, so it should be resolved by the pull request that I've submitted. Could you download the git.hpi from that pull request and see if it prevents the build failure in your case?
            markewaite Mark Waite made changes -
            Resolution Fixed [ 1 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            Assignee Jacob Keller [ jekeller ] Mark Waite [ markewaite ]
            Hide
            maybee Malte Brunnlieb added a comment - - edited

            Mark Waite, now I get

             

            > git checkout -f a3333dcd9a125830df529efa206f925283d24d6b

            GitHub has been notified of this commit’s build result

            hudson.plugins.git.GitException: Command "git checkout -f a3333dcd9a125830df529efa206f925283d24d6b" returned status code 128:
            stdout:
            stderr: fatal: reference is not a tree: a3333dcd9a125830df529efa206f925283d24d6b

            at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1924)
            at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$800(CliGitAPIImpl.java:71)
            at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2214)
            Caused: hudson.plugins.git.GitException: Could not checkout a3333dcd9a125830df529efa206f925283d24d6b
            at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2237)
            at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1165)
            at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
            at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:130)
            at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:120)
            at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:263)
            at hudson.model.ResourceController.execute(ResourceController.java:97)
            at hudson.model.Executor.run(Executor.java:405)
            Finished: FAILURE

            Show
            maybee Malte Brunnlieb added a comment - - edited Mark Waite , now I get   > git checkout -f a3333dcd9a125830df529efa206f925283d24d6b GitHub has been notified of this commit’s build result hudson.plugins.git.GitException: Command "git checkout -f a3333dcd9a125830df529efa206f925283d24d6b" returned status code 128: stdout: stderr: fatal: reference is not a tree: a3333dcd9a125830df529efa206f925283d24d6b at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1924) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$800(CliGitAPIImpl.java:71) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2214) Caused: hudson.plugins.git.GitException: Could not checkout a3333dcd9a125830df529efa206f925283d24d6b at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2237) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1165) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:130) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:120) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:263) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:405) Finished: FAILURE
            Hide
            markewaite Mark Waite added a comment -

            Malte Brunnlieb that is a message from command line git saying that it can't find the SHA1 a3333dcd9a125830df529efa206f925283d24d6b in the repository which it is using for the checkout.

            Are you using a pipeline global shared library?

            Are you using multiple checkout steps in the pipeline definition?

            Is the SHA1 a3333dcd9a125830df529efa206f925283d24d6b in the remote repository history?

            I assume your upgrade was from a git plugin prior to 3.3.0 (since that is where the printCommitMessageToLog was added). What version were you using previously?

            Since you're using GitHub Pull Request Builder (and I don't test that plugin), you may be encountering an intentional change that was made in git plugin 3.4.0. Previously, git plugin in pipeline would clone a default refspec and would clone all tags, even though it only needed a narrow refspecs and no tags. Git plugin 3.4.0 clones exactly the refspec needed for the branch defined in the job, and does not clone tags. It is possible that the GitHub Pull Request Builder plugin depends on a full refspec.

            You can switch back to the old behavior in that pipeline by adding the "Additional Behaviour" for "Advanced clone options". Adding the behavior causes a default refspec to be cloned, and tags will be cloned. You do not need to adjust any settings in that added behavior.

            Show
            markewaite Mark Waite added a comment - Malte Brunnlieb that is a message from command line git saying that it can't find the SHA1 a3333dcd9a125830df529efa206f925283d24d6b in the repository which it is using for the checkout. Are you using a pipeline global shared library? Are you using multiple checkout steps in the pipeline definition? Is the SHA1 a3333dcd9a125830df529efa206f925283d24d6b in the remote repository history? I assume your upgrade was from a git plugin prior to 3.3.0 (since that is where the printCommitMessageToLog was added). What version were you using previously? Since you're using GitHub Pull Request Builder (and I don't test that plugin), you may be encountering an intentional change that was made in git plugin 3.4.0. Previously, git plugin in pipeline would clone a default refspec and would clone all tags, even though it only needed a narrow refspecs and no tags. Git plugin 3.4.0 clones exactly the refspec needed for the branch defined in the job, and does not clone tags. It is possible that the GitHub Pull Request Builder plugin depends on a full refspec. You can switch back to the old behavior in that pipeline by adding the "Additional Behaviour" for "Advanced clone options". Adding the behavior causes a default refspec to be cloned, and tags will be cloned. You do not need to adjust any settings in that added behavior.
            Hide
            maybee Malte Brunnlieb added a comment -

            Is the SHA1 a3333dcd9a125830df529efa206f925283d24d6b in the remote repository history?

            Got it... the repository the PR was issued from was deleted meanwhile... so the clone of the head of the PR branch is failing
            Sometimes it's so easy

            Show
            maybee Malte Brunnlieb added a comment - Is the SHA1 a3333dcd9a125830df529efa206f925283d24d6b in the remote repository history? Got it... the repository the PR was issued from was deleted meanwhile... so the clone of the head of the PR branch is failing Sometimes it's so easy
            markewaite Mark Waite made changes -
            Status Reopened [ 4 ] Open [ 1 ]
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Mark Waite
            Path:
            src/main/java/hudson/plugins/git/GitSCM.java
            http://jenkins-ci.org/commit/git-plugin/c1ac7012d4003a1bf2394031cb1a76baac016523
            Log:
            JENKINS-45729 Move printCommitMessageToLog after checkout, ignore exceptions

            JENKINS-45729 shows that there are cases where the expected commit is not
            yet available to be printed or some other issue is causing an exception.

            Printing the commit message of the last commit to the log file is a
            diagnostic aid, not critical to success of the build. An exception in
            a diagnostic should not break the build.

            I'm unable to duplicate JENKINS-45729 in any consistent way. I have
            seen the reported exception at least once, but the project with that
            exception stopped showing that exception.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: src/main/java/hudson/plugins/git/GitSCM.java http://jenkins-ci.org/commit/git-plugin/c1ac7012d4003a1bf2394031cb1a76baac016523 Log: JENKINS-45729 Move printCommitMessageToLog after checkout, ignore exceptions JENKINS-45729 shows that there are cases where the expected commit is not yet available to be printed or some other issue is causing an exception. Printing the commit message of the last commit to the log file is a diagnostic aid, not critical to success of the build. An exception in a diagnostic should not break the build. I'm unable to duplicate JENKINS-45729 in any consistent way. I have seen the reported exception at least once, but the project with that exception stopped showing that exception.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Mark Waite
            Path:
            src/main/java/hudson/plugins/git/GitSCM.java
            http://jenkins-ci.org/commit/git-plugin/34f047f644bb32db8359cc71715590d1902db701
            Log:
            Merge pull request #530 from MarkEWaite/remove-printCommitMessageToLog

            JENKINS-45729 - Move print commit message after checkout

            Compare: https://github.com/jenkinsci/git-plugin/compare/a6ddae8a65df...34f047f644bb

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: src/main/java/hudson/plugins/git/GitSCM.java http://jenkins-ci.org/commit/git-plugin/34f047f644bb32db8359cc71715590d1902db701 Log: Merge pull request #530 from MarkEWaite/remove-printCommitMessageToLog JENKINS-45729 - Move print commit message after checkout Compare: https://github.com/jenkinsci/git-plugin/compare/a6ddae8a65df...34f047f644bb
            Hide
            markewaite Mark Waite added a comment -

            Included in git plugin 3.6.0

            Show
            markewaite Mark Waite added a comment - Included in git plugin 3.6.0
            markewaite Mark Waite made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            markewaite Mark Waite made changes -
            Link This issue is duplicated by JENKINS-46628 [ JENKINS-46628 ]
            Hide
            ssbarnea Sorin Sbarnea added a comment -

            I got the same error using 3.7.0 version of the plugin. The cli git version is 2.8.4 in case it matters.

            Show
            ssbarnea Sorin Sbarnea added a comment - I got the same error using 3.7.0 version of the plugin. The cli git version is 2.8.4 in case it matters.
            Hide
            markewaite Mark Waite added a comment -

            Sorin Sbarnea a missing object exception can also happen when the commit is not yet in the repository. That may be due to a checkout which uses a narrow refspec followed by a checkout of a commit which is not available in the workspace copy of the repository. There are probably other reasons for that exception, though I've not found repeatable cases of that exception.

            Can you provide a repeatable case?

            Show
            markewaite Mark Waite added a comment - Sorin Sbarnea a missing object exception can also happen when the commit is not yet in the repository. That may be due to a checkout which uses a narrow refspec followed by a checkout of a commit which is not available in the workspace copy of the repository. There are probably other reasons for that exception, though I've not found repeatable cases of that exception. Can you provide a repeatable case?
            Hide
            ssbarnea Sorin Sbarnea added a comment -

            Mark Waite, thanks for the hint. In fact I get the same kind of error while trying to use the new gerrit plugin for Jenkins, not the git plugin. Gerrit plugin is based on git plugin as it only adds few Gerrit specific features on top of the base git part which is common. See https://github.com/GerritForge/gerrit-plugin/issues/7

            I checked this was happening when there where not refspec specified, probably because the default ones are not wide enough.

            I am going to try now adding wider refspecs and see if this addresses the issue. Once I have them I should be able to change the defaults. Again, thanks for the help.

            Show
            ssbarnea Sorin Sbarnea added a comment - Mark Waite , thanks for the hint. In fact I get the same kind of error while trying to use the new gerrit plugin for Jenkins, not the git plugin. Gerrit plugin is based on git plugin as it only adds few Gerrit specific features on top of the base git part which is common. See  https://github.com/GerritForge/gerrit-plugin/issues/7 I checked this was happening when there where not refspec specified, probably because the default ones are not wide enough. I am going to try now adding wider refspecs and see if this addresses the issue. Once I have them I should be able to change the defaults. Again, thanks for the help.
            markewaite Mark Waite made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

              People

              • Assignee:
                markewaite Mark Waite
                Reporter:
                jekeller Jacob Keller
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: