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

Wipe out repository & force clone option is broken since GIT plugin version 2.0

      When using the "Wipe out repository & force clone" option after upgrade to GIT plugin version 2.0 jobs fail with the error "ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.".

      We are seeing this issue on multiple Jenkins installations in combination with the Gerrit Trigger plugin.

      Example job log:

      Triggered by Gerrit: https://.../12345
      Building remotely on .. in workspace /.../job_name
      Wiping out workspace first.
      Cloning the remote Git repository
      Cloning repository ssh://...:29418/...
      git --version
      git version 1.8.4
      ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
      Finished: FAILURE
      

          [JENKINS-20231] Wipe out repository & force clone option is broken since GIT plugin version 2.0

          Andréas Berg created issue -
          Andréas Berg made changes -
          Description Original: When using the "Wipe out repository & force clone" option after upgrade to GIT plugin version 2.0 jobs fail with the error "ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.".

          We are seeing this issue on multiple Jenkins installations in combination with the Gerrit Trigger plugin.

          Example job log:
           Triggered by Gerrit: https://.../12345
           Building remotely on .. in workspace /.../job_name
           Wiping out workspace first.
           Cloning the remote Git repository
           Cloning repository ssh://...:29418/...
           git --version
           git version 1.8.4
           ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
           Finished: FAILURE
          New: When using the "Wipe out repository & force clone" option after upgrade to GIT plugin version 2.0 jobs fail with the error "ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.".

          We are seeing this issue on multiple Jenkins installations in combination with the Gerrit Trigger plugin.

          Example job log:
          {code}
          Triggered by Gerrit: https://.../12345
          Building remotely on .. in workspace /.../job_name
          Wiping out workspace first.
          Cloning the remote Git repository
          Cloning repository ssh://...:29418/...
          git --version
          git version 1.8.4
          ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
          Finished: FAILURE
          {code}
          Nicolas De Loof made changes -
          Link New: This issue is duplicated by JENKINS-20257 [ JENKINS-20257 ]
          Nicolas De Loof made changes -
          Link Original: This issue is duplicated by JENKINS-20257 [ JENKINS-20257 ]

          Maybe you need https://github.com/jenkinsci/gerrit-trigger-plugin/commit/41c445e9c1801c3cf091cefe622f63dd47252b2e
          Can you try using a SNAPSHOT build for gerrit-trigger plugin ?

          Nicolas De Loof added a comment - Maybe you need https://github.com/jenkinsci/gerrit-trigger-plugin/commit/41c445e9c1801c3cf091cefe622f63dd47252b2e Can you try using a SNAPSHOT build for gerrit-trigger plugin ?

          Andréas Berg added a comment -

          No, that will not help. The Gerrit Trigger plugin works just fine and gives correct information.

          The workaround we use right now is to use Clean instead of Wipe in the GIT plugin but we have a few jobs were we really do want a wipe instead.

          Merge before build does not work with Clean when a single Jenkins job is listening to multiple Gerrit projects.

          Andréas Berg added a comment - No, that will not help. The Gerrit Trigger plugin works just fine and gives correct information. The workaround we use right now is to use Clean instead of Wipe in the GIT plugin but we have a few jobs were we really do want a wipe instead. Merge before build does not work with Clean when a single Jenkins job is listening to multiple Gerrit projects.

          I have no experience with Gerrit so can't help here.

          Nicolas De Loof added a comment - I have no experience with Gerrit so can't help here.
          oeuftete made changes -
          Link New: This issue is related to JENKINS-20502 [ JENKINS-20502 ]

          Andréas Berg added a comment -

          The update to GIT plugin 2.0 broke the functionality. The Gerrit Trigger plugin remains untouched.

          Our workaround to use clean instead of wipe has since I wrote the initial issue also stopped working.

          Currently we can no longer use the GIT client plugin and have replaced it with a shell script build step that issues the proper Git commands.

          Since our build step works and uses the environment variables delivered by the Gerrit Trigger plugin, I remain confident that the Gerrit Trigger plugin works fine, and the GIT client plugin is broken as it no longer respects the variables as input.

          Andréas Berg added a comment - The update to GIT plugin 2.0 broke the functionality. The Gerrit Trigger plugin remains untouched. Our workaround to use clean instead of wipe has since I wrote the initial issue also stopped working. Currently we can no longer use the GIT client plugin and have replaced it with a shell script build step that issues the proper Git commands. Since our build step works and uses the environment variables delivered by the Gerrit Trigger plugin, I remain confident that the Gerrit Trigger plugin works fine, and the GIT client plugin is broken as it no longer respects the variables as input.

          Also experiencing the same issue when wiping or like this time - started using concurrent builds (with new workspaces).

          Started by build flow Project - Orchestrator#132
          Building in workspace D:\Jenkins\jobs\Project - Flow - Build and publish\workspace@3
          Cloning the remote Git repository
          Cloning repository ssh://...@...:29418/Project.git
          git --version
          git version 1.8.4.msysgit.0
          ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
          

          Since we are using a Flow build (plugin) we forward different Gerrit Trigger variables that is needed to checkout the correct code.

          Build parameters:

          GIT_COMMIT_PARAM: 5eec51b0eeaa79eb5d9d7f8067a96f049a941fef
          GIT_COMMIT_REFSPEC: refs/changes/66/66/2
          

          This is the same variables that Gerrit Trigger normally is configured with.

          Configuration - Source Code Management:

          Repo URL: ssh://...@...:29418/Project.git
          Credentials: Our credentials - SSH key based
          Name: <nothing>
          Refspec: $GIT_COMMIT_REFSPEC
          
          Branch Specifier: $GIT_COMMIT_PARAM
          
          Repository Browser: (Auto)
          
          No "Gerrit Trigger" as "Strategy" (normal setup when using the Gerrit Trigger)
          

          Hallvard Nygård added a comment - Also experiencing the same issue when wiping or like this time - started using concurrent builds (with new workspaces). Started by build flow Project - Orchestrator#132 Building in workspace D:\Jenkins\jobs\Project - Flow - Build and publish\workspace@3 Cloning the remote Git repository Cloning repository ssh: //...@...:29418/Project.git git --version git version 1.8.4.msysgit.0 ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job. Since we are using a Flow build (plugin) we forward different Gerrit Trigger variables that is needed to checkout the correct code. Build parameters: GIT_COMMIT_PARAM: 5eec51b0eeaa79eb5d9d7f8067a96f049a941fef GIT_COMMIT_REFSPEC: refs/changes/66/66/2 This is the same variables that Gerrit Trigger normally is configured with. Configuration - Source Code Management: Repo URL: ssh: //...@...:29418/Project.git Credentials: Our credentials - SSH key based Name: <nothing> Refspec: $GIT_COMMIT_REFSPEC Branch Specifier: $GIT_COMMIT_PARAM Repository Browser: (Auto) No "Gerrit Trigger" as "Strategy" (normal setup when using the Gerrit Trigger)

            ndeloof Nicolas De Loof
            epkabeg Andréas Berg
            Votes:
            10 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: