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

          Allan BURDAJEWICZ created issue -
          Antonio Muñiz made changes -
          Link New: This issue duplicates JENKINS-34727 [ JENKINS-34727 ]
          Antonio Muñiz made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]
          Allan BURDAJEWICZ made changes -
          Resolution Original: Fixed [ 1 ]
          Status Original: Closed [ 6 ] New: Reopened [ 4 ]
          Jesse Glick made changes -
          Component/s Original: branch-api-plugin [ 18621 ]
          Assignee Original: Stephen Connolly [ stephenconnolly ]
          Jesse Glick made changes -
          Assignee New: Jesse Glick [ jglick ]
          Jesse Glick made changes -
          Status Original: Reopened [ 4 ] New: Open [ 1 ]
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jesse Glick made changes -
          Link New: This issue is blocked by JENKINS-33161 [ JENKINS-33161 ]
          Jesse Glick made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 170909 ] New: JNJira + In-Review [ 198978 ]

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

              Created:
              Updated:
              Resolved: