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

Checkout fails with ERROR: Could not determine exact tip revision of <branch>

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • Jenkins v2.225
      Gerrit Code Review plugin v0.4.1
    • gerrit-code-review-0.4.5

      Short explanation

      Creating Multibranch Pipelines using Gerrit as Branch Source through the UI causes the error to occur. The error is that for every new Change Request, the first build (and automatic) occurs with no problem, but if you hit Build Now to build a second, it fails with the error stated. 

      This error doesn't happen if you use Jenkins Job Builder or Job DSL to create the Multibranch pipeline, only when created by the UI.

      Long explanation

      The issue is the same as the others linked (and closed) but happens using the Gerrit Code Review plugin. Seems like a fix was applied for BlueOcean, Github, Jervis, but I suppose this must also be fixed here. 

      Every time I push a new change for review, the first build of that patchset works. But if you hit Build now on that change, the build fails. 

      The error is:

      ERROR: Could not determine exact tip revision of 01/7002801/3

      A picture of the pipeline:

          [JENKINS-61469] Checkout fails with ERROR: Could not determine exact tip revision of <branch>

          Matt Story added a comment -

          I run into this issue when triggering a multibranch plugin job from another multibranch plugin job with 'build job: ...'.  When I build the job manually it works fine.

          Jenkins v2.202

          GCR plugin version unknown since I don't have 'Manage Jenkins' privs.

          Gerrit v3.0.2

          Matt Story added a comment - I run into this issue when triggering a multibranch plugin job from another multibranch plugin job with 'build job: ...'.  When I build the job manually it works fine. Jenkins v2.202 GCR plugin version unknown since I don't have 'Manage Jenkins' privs. Gerrit v3.0.2

          Felipe Santos added a comment -

          There are two workarounds

          1. Use Jenkins Job Builder to create the Multibranch Pipeline on Jenkins 
              How-to: https://jenkins-job-builder.readthedocs.io/en/latest/project_workflow_multibranch.html#project_multibranch.gerrit_scm
          2. Use Job DSL to create the Multibranch Pipeline on Jenkins

          Felipe Santos added a comment - There are two workarounds 1. Use Jenkins Job Builder to create the Multibranch Pipeline on Jenkins      How-to:  https://jenkins-job-builder.readthedocs.io/en/latest/project_workflow_multibranch.html#project_multibranch.gerrit_scm 2. Use Job DSL to create the Multibranch Pipeline on Jenkins

          Looks like we have to configure the refspec `+refs/changes/*:refs/remotes/@

          {remote}

          /*` to fix this issue. I will investigate further. If this turns out to be a reproducible fix, I will upload a change, making this the default.

          Thomas Draebing added a comment - Looks like we have to configure the refspec `+refs/changes/*:refs/remotes/@ {remote} /*` to fix this issue. I will investigate further. If this turns out to be a reproducible fix, I will upload a change, making this the default.

          Vivien Tintillier added a comment - Fix proposed by tdraebing  in  https://review.gerrithub.io/c/jenkinsci/gerrit-code-review-plugin/+/511193

            lucamilanesio Luca Domenico Milanesio
            felipecassiors Felipe Santos
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: