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

GIT checkout fails with [Couldn't find any revision to build] when branch specifier is commit ID

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • git-plugin
    • None
    • Jenkins ver. 2.195
      Git client plugin ver. 3.2.1
      Git plugin ver. 4.2.2

      We execute one and the same job config.xml both on Linux and Windows slaves. 

      It uses a commit ID as a branch specifier. This configuration works perfectly on Linux but it fails on Windows. 

      I see double quotes are added to the commit ID on Windows, but I am not sure if that causes the problem.

      Failing windows output:

      Building remotely on sofumwin04.eur.ad.sag
      (.NET3.5 doxygen1.8.5 git cppcheck .NET4.5 cmake nodejs perl windows) in workspace C:/jenkins/workspace/freestyle_checkout
      No credentials specified
      > C:\jenkins\tools\git\cmd\git.exe rev-parse --is-inside-work-tree # timeout=10
      Fetching changes from the remote Git repository
      > C:\jenkins\tools\git\cmd\git.exe config remote.origin.url http://irepo.eur.ad.sag/scm/tsm/um-test.git

      1. timeout=10
        Cleaning workspace
        > C:\jenkins\tools\git\cmd\git.exe rev-parse --verify HEAD # timeout=10
        Resetting working tree
        > C:\jenkins\tools\git\cmd\git.exe reset --hard # timeout=10
        > C:\jenkins\tools\git\cmd\git.exe clean -ffdx # timeout=10
        > C:\jenkins\tools\git\cmd\git.exe submodule foreach --recursive git reset --hard # timeout=10
        > C:\jenkins\tools\git\cmd\git.exe submodule foreach --recursive git clean -fdx # timeout=10
        Fetching upstream changes from http://irepo.eur.ad.sag/scm/tsm/um-test.git
        > C:\jenkins\tools\git\cmd\git.exe --version # timeout=10
        > C:\jenkins\tools\git\cmd\git.exe fetch --tags --force --progress – http://irepo.eur.ad.sag/scm/tsm/um-test.git
        +refs/heads/:refs/remotes/origin/ # timeout=10
        > C:\jenkins\tools\git\cmd\git.exe rev-parse "22a341d6223157c1e1b2db792c26eb007f80d64a^{commit}" # timeout=10
        > C:\jenkins\tools\git\cmd\git.exe rev-parse "origin/22a341d6223157c1e1b2db792c26eb007f80d64a^{commit}" # timeout=10
        > C:\jenkins\tools\git\cmd\git.exe rev-parse "22a341d6223157c1e1b2db792c26eb007f80d64a^{commit}" # timeout=10
        ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
        Finished: FAILURE
         
         
        Working Linux output: 
      2. Building remotely on sofumrhel02.eur.ad.sag
        (rdma cmake linux gcc4.8.5 rhel7.5) in workspace /home/vmtest/workspace/freestyle_checkout
        Installer "Extract .zip/.tar.gz" cannot be used to install "git-2.28.0" on the node "sofumrhel02.eur.ad.sag"
        No credentials specified
        Cloning the remote Git repository
        Cloning repository http://irepo.eur.ad.sag/scm/tsm/um-test.git
        > git init /home/vmtest/workspace/freestyle_checkout # timeout=10
        Fetching upstream changes from http://irepo.eur.ad.sag/scm/tsm/um-test.git
        > git --version # timeout=10
        > git fetch --tags --progress http://irepo.eur.ad.sag/scm/tsm/um-test.git
        +refs/heads/:refs/remotes/origin/ # timeout=10
        > git config remote.origin.url http://irepo.eur.ad.sag/scm/tsm/um-test.git
      1. timeout=10
        > git config --add remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10
        > git config remote.origin.url http://irepo.eur.ad.sag/scm/tsm/um-test.git
      2. timeout=10
        Cleaning workspace
        > git rev-parse --verify HEAD # timeout=10
        No valid HEAD. Skipping the resetting
        > git clean -ffdx # timeout=10
        Fetching upstream changes from http://irepo.eur.ad.sag/scm/tsm/um-test.git
        > git fetch --tags --progress http://irepo.eur.ad.sag/scm/tsm/um-test.git
        +refs/heads/:refs/remotes/origin/ # timeout=10
        > git rev-parse 22a341d6223157c1e1b2db792c26eb007f80d64a^{commit} # timeout=10
        Checking out Revision 22a341d6223157c1e1b2db792c26eb007f80d64a (detached)
        > git config core.sparsecheckout # timeout=10
        > git checkout -f 22a341d6223157c1e1b2db792c26eb007f80d64a # timeout=10
        Commit message: "Auto-update submodule reference using gradle-git-submodules job, pointing to master"
        > git rev-list --no-walk 22a341d6223157c1e1b2db792c26eb007f80d64a # timeout=10
        > git remote # timeout=10
        > git submodule init # timeout=10
        > git submodule sync # timeout=10
        > git config --get remote.origin.url # timeout=10
        Using shallow submodule update with depth 1
        > git submodule init # timeout=10
        [WARNING] Git client older than 1.8.4 doesn't support shallow submodule updates. This flag is ignored.
        > git config -f .gitmodules --get-regexp ^submodule\.(.+)\.url # timeout=10
        > git config --get submodule.gradle.url # timeout=10
        > git config -f .gitmodules --get submodule.gradle.path # timeout=10
        > git submodule update --init --recursive gradle # timeout=10
        Finished: SUCCESS
         

      Could it be a configuration issue on my side? I cannot say :/

        1. config.xml
          3 kB
          Vassilena Treneva

            Unassigned Unassigned
            vassilena Vassilena Treneva
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: