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

Git checkout fails when branch is not */master

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • None
    • Jenkins 1.609.2 (using jenkins Docker container)

      plugins:
        git-client-plugin: 1.19.0
        git-plugin: 2.4.0

      I have a private repo that I added a dev branch too. I am trying to build off the dev branch, but I get:

      Building in workspace /var/jenkins_home/jobs/Strata Consulting App (Dev)/workspace
      Cloning the remote Git repository
      Cloning repository git@bitbucket.org:mbabauer/strata_home_inspection.git
       > git init /var/jenkins_home/jobs/Strata Consulting App (Dev)/workspace/strata_home_inspection # timeout=10
      Fetching upstream changes from git@bitbucket.org:mbabauer/strata_home_inspection.git
       > git --version # timeout=10
      using GIT_SSH to set credentials 
       > git -c core.askpass=true fetch --tags --progress git@bitbucket.org:mbabauer/strata_home_inspection.git +refs/heads/*:refs/remotes/origin/*
       > git config remote.origin.url git@bitbucket.org:mbabauer/strata_home_inspection.git # timeout=10
       > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
       > git config remote.origin.url git@bitbucket.org:mbabauer/strata_home_inspection.git # timeout=10
      Fetching upstream changes from git@bitbucket.org:mbabauer/strata_home_inspection.git
      using GIT_SSH to set credentials 
       > git -c core.askpass=true fetch --tags --progress git@bitbucket.org:mbabauer/strata_home_inspection.git +refs/heads/*:refs/remotes/origin/*
       > git rev-parse origin/dev^{commit} # timeout=10
      Checking out Revision 88f250a798e301ea9bebb0460c88496611884820 (origin/dev)
       > git config core.sparsecheckout # timeout=10
       > git checkout -f 88f250a798e301ea9bebb0460c88496611884820
       > git rev-list 88f250a798e301ea9bebb0460c88496611884820 # timeout=10
      Cloning the remote Git repository
      Cloning repository git@bitbucket.org:mbabauer/mbabauer-accounts-utils.git
       > git init /var/jenkins_home/jobs/Strata Consulting App (Dev)/workspace/mbabauer:accounts-utils # timeout=10
      Fetching upstream changes from git@bitbucket.org:mbabauer/mbabauer-accounts-utils.git
       > git --version # timeout=10
      using GIT_SSH to set credentials 
       > git -c core.askpass=true fetch --tags --progress git@bitbucket.org:mbabauer/mbabauer-accounts-utils.git +refs/heads/*:refs/remotes/origin/*
       > git config remote.origin.url git@bitbucket.org:mbabauer/mbabauer-accounts-utils.git # timeout=10
       > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
       > git config remote.origin.url git@bitbucket.org:mbabauer/mbabauer-accounts-utils.git # timeout=10
      Fetching upstream changes from git@bitbucket.org:mbabauer/mbabauer-accounts-utils.git
      using GIT_SSH to set credentials 
       > git -c core.askpass=true fetch --tags --progress git@bitbucket.org:mbabauer/mbabauer-accounts-utils.git +refs/heads/*:refs/remotes/origin/*
       > git rev-parse origin/dev^{commit} # timeout=10
       > git rev-parse dev^{commit} # timeout=10
      ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
      Finished: FAILURE
      

      I have found other bugs with similar errors, like JENKINS-27114, but most speak of bugs in the plugin code that have been fixed. I have confirmed I am at the "fixed" versions or higher, but I am still experiencing problems.

      If I nuke the workspace folder and set the branch to my dev branch, I can see that the branch is checked out as expected.

            ndeloof Nicolas De Loof
            codechimp Michael Bauer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: