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

Pull Request pipeline fails to checkout successive commits

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • core:1.642.4.2
      github:1.17.1
      github-api:1.75
      github-branch-source:1.6
      branch-api:1.7

      How to reproduce

      (Assuming you have a GitHub Organization folder with WebHooks already setup)

      1. Fork a repo
      2. Create a branch
      3. Make a change
      4. Make a commit
      5. Create a pull request against the remote master
      6. Commit successively multiple changes very quickly - 2/3 seconds interval
      (Usually 5 commit suffice)
      7. You should see the PR build failing with the following exception:

      hudson.plugins.git.GitException: Could not checkout 67615299b8ef9ae83a60c72af7ca37cbfc879d4f 
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:1992) 
      at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1135) 
      at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109) 
      at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:109) 
      at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:87) 
      at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:206) 
      at hudson.model.ResourceController.execute(ResourceController.java:98) 
      at hudson.model.Executor.run(Executor.java:410) 
      Caused by: hudson.plugins.git.GitException: Command "git checkout -f 67615299b8ef9ae83a60c72af7ca37cbfc879d4f" returned status code 128: 
      stdout: 
      stderr: fatal: reference is not a tree: 67615299b8ef9ae83a60c72af7ca37cbfc879d4f
      
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1719) 
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:63) 
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:1984) 
      ... 7 more 
      Finished: FAILURE
      

      Example

      Following have been committed within 10 seconds in that order:

      1. 4fba098fd8127befb73e751f58d31129abfec323
      2. 84765a178a5516dbabfb9d0cbf17ee08129a00c4 -> triggered branch indexing
      3. 67615299b8ef9ae83a60c72af7ca37cbfc879d4f

      Checking in the indexing logs, the Branch Indexing detected changes for PR-13, sha 84765a178a5516dbabfb9d0cbf17ee08129a00c4:

      Changes detected in PR-13 (12d4896a25dcf71c7febc379f55e84841c4dde69 → 84765a178a5516dbabfb9d0cbf17ee08129a00c4)
      Scheduled build for branch: PR-13
      

      The next indexing logs, probably triggered by 67615299b8ef9ae83a60c72af7ca37cbfc879d4f, shows:

      No changes detected in PR-13 (still at 84765a178a5516dbabfb9d0cbf17ee08129a00c4)
      

          [JENKINS-34728] Pull Request pipeline fails to checkout successive commits

          This could be related somehow to JENKINS-34727

          Allan BURDAJEWICZ added a comment - This could be related somehow to JENKINS-34727

          Paul Tyng added a comment -

          I am getting this continuously on PR builds. I have the latest plugin versions. Not sure if there is something I could do to address it on my end.

          Paul Tyng added a comment - I am getting this continuously on PR builds. I have the latest plugin versions. Not sure if there is something I could do to address it on my end.

          Can still reproduce with the latest:

          branch-api:1.10
          github-branch-source:1.7
          github-pull-request-build:1.10

          Reproduce

          I have a repo, a fork and an open PR:

          • Create an GitHub Organization Folder for the support-team user
          • Register WebHook on GHE for the repo
          • Commit successively multiple changes to the fork very quickly - 5 seconds interval
          • You should see the PR build failing with the following exception:
          hudson.plugins.git.GitException: Could not checkout 67615299b8ef9ae83a60c72af7ca37cbfc879d4f 
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:1992) 
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1135) 
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109) 
          at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:109) 
          at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:87) 
          at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:206) 
          at hudson.model.ResourceController.execute(ResourceController.java:98) 
          at hudson.model.Executor.run(Executor.java:410) 
          Caused by: hudson.plugins.git.GitException: Command "git checkout -f 67615299b8ef9ae83a60c72af7ca37cbfc879d4f" returned status code 128: 
          stdout: 
          stderr: fatal: reference is not a tree: 67615299b8ef9ae83a60c72af7ca37cbfc879d4f
          
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1719) 
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:63) 
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:1984) 
          ... 7 more 
          Finished: FAILURE
          

          Allan BURDAJEWICZ added a comment - Can still reproduce with the latest: branch-api:1.10 github-branch-source:1.7 github-pull-request-build:1.10 Reproduce I have a repo , a fork and an open PR : Create an GitHub Organization Folder for the support-team user Register WebHook on GHE for the repo Commit successively multiple changes to the fork very quickly - 5 seconds interval You should see the PR build failing with the following exception: hudson.plugins.git.GitException: Could not checkout 67615299b8ef9ae83a60c72af7ca37cbfc879d4f at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:1992) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1135) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:109) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:87) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:206) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Caused by: hudson.plugins.git.GitException: Command "git checkout -f 67615299b8ef9ae83a60c72af7ca37cbfc879d4f" returned status code 128: stdout: stderr: fatal: reference is not a tree: 67615299b8ef9ae83a60c72af7ca37cbfc879d4f at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1719) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:63) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:1984) ... 7 more Finished: FAILURE

          Jesse Glick added a comment -

          As I suspected, this is reproducible before, but not after, the refactoring in JENKINS-33161.

          Jesse Glick added a comment - As I suspected, this is reproducible before, but not after, the refactoring in JENKINS-33161 .

          Jesse Glick added a comment -

          Reproduced using https://github.com/cloudbeers/PR-demo/pull/12 by the way.

          Jesse Glick added a comment - Reproduced using https://github.com/cloudbeers/PR-demo/pull/12 by the way.

            jglick Jesse Glick
            allan_burdajewicz Allan BURDAJEWICZ
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: