-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Jenkins 2.249.2
Git plugin 4.4.4
As requested in allowSecondFetch ** documentation I am opening a ticket.
After upgrading git plugin to version 4.4.4 (can't recall the previous version), my Jenkins job started to fail on the checkout step because it requires the version tags, defined as bellow:
stage('Checkout') { retry(3) { scmvars = checkout([ $class : 'GitSCM', branches : scm.branches, doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations, extensions : scm.extensions + [$class: 'CloneOption', noTags: false, reference: '~/git/service-sourcing/', shallow: false] + [$class: 'LocalBranch', localBranch: "**"] + [$class: 'UserIdentity', email: 'dev@nezasa.com', name: 'Jenkins CI'], userRemoteConfigs : scm.userRemoteConfigs ]) } }
Before the update the job used to output this during checkout:
**
05:16:32 > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10 05:16:35 Fetching without tags 05:16:35 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:16:35 > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10 05:16:35 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:16:35 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:16:35 Fetching upstream changes from git@github.com:nezasa/tb-service-sourcing.git 05:16:35 using GIT_SSH to set credentials Github SSH Key for common libraries access 05:16:35 > git fetch --tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10
After the update the output is (Git is now Avoiding second fetch):
**
05:16:59 > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10 05:17:01 Avoid second fetch 05:17:01 Checking out Revision 68628022e4553cacb97377dfd35d54c3d3d3734f (develop) 05:17:01 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:17:01 > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10 05:17:01 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:17:01 > git config core.sparsecheckout # timeout=10 05:17:01 > git checkout -f 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10 05:17:01 > git branch -a -v --no-abbrev # timeout=10 05:17:02 > git checkout -b develop 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10
Adding allowSecondFetch flag and setting it to true on the global settings seems to fix the issue but I was expecting that the Advanced Clone Setting on the job would be enough.
[JENKINS-64000] Git tag setting ignored by repository fetch in multibranch project created by GitHub org folder
Summary | Original: Jenkins Job unable to fetch tags with git without allowSecondFetch flag set to true | New: Jenkins Job unable to perform second fetch without allowSecondFetch flag set to true |
Description |
Original:
After upgrading git plugin to version 4.4.4 (can't recall the previous version), my jenkins job started to fail on the checkout step, defined as bellow: {code:java} stage('Checkout') { retry(3) { scmvars = checkout([ $class : 'GitSCM', branches : scm.branches, doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations, extensions : scm.extensions + [$class: 'CloneOption', noTags: false, reference: '~/git/service-sourcing/', shallow: false] + [$class: 'LocalBranch', localBranch: "**"] + [$class: 'UserIdentity', email: 'dev@nezasa.com', name: 'Jenkins CI'], userRemoteConfigs : scm.userRemoteConfigs ]) } }{code} Before the update the job used to output this during checkout: *05:16:32* Fetching upstream changes from git@github.com:nezasa/tb-service-sourcing.git*05:16:32* > git --version # timeout=10*05:16:32* using GIT_SSH to set credentials Github SSH Key for common libraries access*05:16:32* > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10*05:16:35* Fetching without tags*05:16:35* > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10*05:16:35* > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10*05:16:35* > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10*05:16:35* > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10*05:16:35* Fetching upstream changes from git@github.com:nezasa/tb-service-sourcing.git After the update the output is (Git is now Avoiding second fetch): *05:16:59* > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10*05:17:01* Avoid second fetch*05:17:01* Checking out Revision 68628022e4553cacb97377dfd35d54c3d3d3734f (develop)*05:17:01* > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10*05:17:01* > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10*05:17:01* > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10*05:17:01* > git config core.sparsecheckout # timeout=10*05:17:01* > git checkout -f 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10*05:17:01* > git branch -a -v --no-abbrev # timeout=10*05:17:02* > git checkout -b develop 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10 Setting *allowSecondFetch* flag to true seems to fix the issue but I was expecting that the Advacanced Clone Setting on the job would be enought. |
New:
After upgrading git plugin to version 4.4.4 (can't recall the previous version), my jenkins job started to fail on the checkout step, defined as bellow: {code:java} stage('Checkout') { retry(3) { scmvars = checkout([ $class : 'GitSCM', branches : scm.branches, doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations, extensions : scm.extensions + [$class: 'CloneOption', noTags: false, reference: '~/git/service-sourcing/', shallow: false] + [$class: 'LocalBranch', localBranch: "**"] + [$class: 'UserIdentity', email: 'dev@nezasa.com', name: 'Jenkins CI'], userRemoteConfigs : scm.userRemoteConfigs ]) } }{code} Before the update the job used to output this during checkout: ** {noformat} 05:16:32 > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10 05:16:35 Fetching without tags 05:16:35 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:16:35 > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10 05:16:35 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:16:35 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:16:35 Fetching upstream changes from git@github.com:nezasa/tb-service-sourcing.git 05:16:35 using GIT_SSH to set credentials Github SSH Key for common libraries access 05:16:35 > git fetch --tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10{noformat} After the update the output is (Git is now Avoiding second fetch): ** {noformat} 05:16:59 > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10 05:17:01 Avoid second fetch 05:17:01 Checking out Revision 68628022e4553cacb97377dfd35d54c3d3d3734f (develop) 05:17:01 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:17:01 > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10 05:17:01 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:17:01 > git config core.sparsecheckout # timeout=10 05:17:01 > git checkout -f 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10 05:17:01 > git branch -a -v --no-abbrev # timeout=10 05:17:02 > git checkout -b develop 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10{noformat} Setting *allowSecondFetch* flag to true seems to fix the issue but I was expecting that the Advacanced Clone Setting on the job would be enought. |
Description |
Original:
After upgrading git plugin to version 4.4.4 (can't recall the previous version), my jenkins job started to fail on the checkout step, defined as bellow: {code:java} stage('Checkout') { retry(3) { scmvars = checkout([ $class : 'GitSCM', branches : scm.branches, doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations, extensions : scm.extensions + [$class: 'CloneOption', noTags: false, reference: '~/git/service-sourcing/', shallow: false] + [$class: 'LocalBranch', localBranch: "**"] + [$class: 'UserIdentity', email: 'dev@nezasa.com', name: 'Jenkins CI'], userRemoteConfigs : scm.userRemoteConfigs ]) } }{code} Before the update the job used to output this during checkout: ** {noformat} 05:16:32 > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10 05:16:35 Fetching without tags 05:16:35 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:16:35 > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10 05:16:35 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:16:35 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:16:35 Fetching upstream changes from git@github.com:nezasa/tb-service-sourcing.git 05:16:35 using GIT_SSH to set credentials Github SSH Key for common libraries access 05:16:35 > git fetch --tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10{noformat} After the update the output is (Git is now Avoiding second fetch): ** {noformat} 05:16:59 > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10 05:17:01 Avoid second fetch 05:17:01 Checking out Revision 68628022e4553cacb97377dfd35d54c3d3d3734f (develop) 05:17:01 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:17:01 > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10 05:17:01 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:17:01 > git config core.sparsecheckout # timeout=10 05:17:01 > git checkout -f 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10 05:17:01 > git branch -a -v --no-abbrev # timeout=10 05:17:02 > git checkout -b develop 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10{noformat} Setting *allowSecondFetch* flag to true seems to fix the issue but I was expecting that the Advacanced Clone Setting on the job would be enought. |
New:
After upgrading git plugin to version 4.4.4 (can't recall the previous version), my jenkins job started to fail on the checkout step, defined as bellow: {code:java} stage('Checkout') { retry(3) { scmvars = checkout([ $class : 'GitSCM', branches : scm.branches, doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations, extensions : scm.extensions + [$class: 'CloneOption', noTags: false, reference: '~/git/service-sourcing/', shallow: false] + [$class: 'LocalBranch', localBranch: "**"] + [$class: 'UserIdentity', email: 'dev@nezasa.com', name: 'Jenkins CI'], userRemoteConfigs : scm.userRemoteConfigs ]) } }{code} Before the update the job used to output this during checkout: ** {noformat} 05:16:32 > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10 05:16:35 Fetching without tags 05:16:35 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:16:35 > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10 05:16:35 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:16:35 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:16:35 Fetching upstream changes from git@github.com:nezasa/tb-service-sourcing.git 05:16:35 using GIT_SSH to set credentials Github SSH Key for common libraries access 05:16:35 > git fetch --tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10{noformat} After the update the output is (Git is now Avoiding second fetch): ** {noformat} 05:16:59 > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10 05:17:01 Avoid second fetch 05:17:01 Checking out Revision 68628022e4553cacb97377dfd35d54c3d3d3734f (develop) 05:17:01 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:17:01 > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10 05:17:01 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:17:01 > git config core.sparsecheckout # timeout=10 05:17:01 > git checkout -f 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10 05:17:01 > git branch -a -v --no-abbrev # timeout=10 05:17:02 > git checkout -b develop 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10{noformat} Setting *allowSecondFetch* flag to true seems to fix the issue but I was expecting that the Advacanced Clone Setting on the job would be enought. |
Description |
Original:
After upgrading git plugin to version 4.4.4 (can't recall the previous version), my jenkins job started to fail on the checkout step, defined as bellow: {code:java} stage('Checkout') { retry(3) { scmvars = checkout([ $class : 'GitSCM', branches : scm.branches, doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations, extensions : scm.extensions + [$class: 'CloneOption', noTags: false, reference: '~/git/service-sourcing/', shallow: false] + [$class: 'LocalBranch', localBranch: "**"] + [$class: 'UserIdentity', email: 'dev@nezasa.com', name: 'Jenkins CI'], userRemoteConfigs : scm.userRemoteConfigs ]) } }{code} Before the update the job used to output this during checkout: ** {noformat} 05:16:32 > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10 05:16:35 Fetching without tags 05:16:35 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:16:35 > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10 05:16:35 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:16:35 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:16:35 Fetching upstream changes from git@github.com:nezasa/tb-service-sourcing.git 05:16:35 using GIT_SSH to set credentials Github SSH Key for common libraries access 05:16:35 > git fetch --tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10{noformat} After the update the output is (Git is now Avoiding second fetch): ** {noformat} 05:16:59 > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10 05:17:01 Avoid second fetch 05:17:01 Checking out Revision 68628022e4553cacb97377dfd35d54c3d3d3734f (develop) 05:17:01 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:17:01 > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10 05:17:01 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:17:01 > git config core.sparsecheckout # timeout=10 05:17:01 > git checkout -f 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10 05:17:01 > git branch -a -v --no-abbrev # timeout=10 05:17:02 > git checkout -b develop 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10{noformat} Setting *allowSecondFetch* flag to true seems to fix the issue but I was expecting that the Advacanced Clone Setting on the job would be enought. |
New:
After upgrading git plugin to version 4.4.4 (can't recall the previous version), my Jenkins job started to fail on the checkout step, defined as bellow: {code:java} stage('Checkout') { retry(3) { scmvars = checkout([ $class : 'GitSCM', branches : scm.branches, doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations, extensions : scm.extensions + [$class: 'CloneOption', noTags: false, reference: '~/git/service-sourcing/', shallow: false] + [$class: 'LocalBranch', localBranch: "**"] + [$class: 'UserIdentity', email: 'dev@nezasa.com', name: 'Jenkins CI'], userRemoteConfigs : scm.userRemoteConfigs ]) } }{code} Before the update the job used to output this during checkout: ** {noformat} 05:16:32 > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10 05:16:35 Fetching without tags 05:16:35 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:16:35 > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10 05:16:35 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:16:35 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:16:35 Fetching upstream changes from git@github.com:nezasa/tb-service-sourcing.git 05:16:35 using GIT_SSH to set credentials Github SSH Key for common libraries access 05:16:35 > git fetch --tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10{noformat} After the update the output is (Git is now Avoiding second fetch): ** {noformat} 05:16:59 > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10 05:17:01 Avoid second fetch 05:17:01 Checking out Revision 68628022e4553cacb97377dfd35d54c3d3d3734f (develop) 05:17:01 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:17:01 > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10 05:17:01 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:17:01 > git config core.sparsecheckout # timeout=10 05:17:01 > git checkout -f 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10 05:17:01 > git branch -a -v --no-abbrev # timeout=10 05:17:02 > git checkout -b develop 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10{noformat} Adding *allowSecondFetch* flag and setting to true seems to fix the issue but I was expecting that the Advanced Clone Setting on the job would be enough. |
Description |
Original:
After upgrading git plugin to version 4.4.4 (can't recall the previous version), my Jenkins job started to fail on the checkout step, defined as bellow: {code:java} stage('Checkout') { retry(3) { scmvars = checkout([ $class : 'GitSCM', branches : scm.branches, doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations, extensions : scm.extensions + [$class: 'CloneOption', noTags: false, reference: '~/git/service-sourcing/', shallow: false] + [$class: 'LocalBranch', localBranch: "**"] + [$class: 'UserIdentity', email: 'dev@nezasa.com', name: 'Jenkins CI'], userRemoteConfigs : scm.userRemoteConfigs ]) } }{code} Before the update the job used to output this during checkout: ** {noformat} 05:16:32 > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10 05:16:35 Fetching without tags 05:16:35 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:16:35 > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10 05:16:35 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:16:35 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:16:35 Fetching upstream changes from git@github.com:nezasa/tb-service-sourcing.git 05:16:35 using GIT_SSH to set credentials Github SSH Key for common libraries access 05:16:35 > git fetch --tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10{noformat} After the update the output is (Git is now Avoiding second fetch): ** {noformat} 05:16:59 > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10 05:17:01 Avoid second fetch 05:17:01 Checking out Revision 68628022e4553cacb97377dfd35d54c3d3d3734f (develop) 05:17:01 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:17:01 > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10 05:17:01 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:17:01 > git config core.sparsecheckout # timeout=10 05:17:01 > git checkout -f 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10 05:17:01 > git branch -a -v --no-abbrev # timeout=10 05:17:02 > git checkout -b develop 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10{noformat} Adding *allowSecondFetch* flag and setting to true seems to fix the issue but I was expecting that the Advanced Clone Setting on the job would be enough. |
New:
After upgrading git plugin to version 4.4.4 (can't recall the previous version), my Jenkins job started to fail on the checkout step, defined as bellow: {code:java} stage('Checkout') { retry(3) { scmvars = checkout([ $class : 'GitSCM', branches : scm.branches, doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations, extensions : scm.extensions + [$class: 'CloneOption', noTags: false, reference: '~/git/service-sourcing/', shallow: false] + [$class: 'LocalBranch', localBranch: "**"] + [$class: 'UserIdentity', email: 'dev@nezasa.com', name: 'Jenkins CI'], userRemoteConfigs : scm.userRemoteConfigs ]) } }{code} Before the update the job used to output this during checkout: ** {noformat} 05:16:32 > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10 05:16:35 Fetching without tags 05:16:35 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:16:35 > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10 05:16:35 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:16:35 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:16:35 Fetching upstream changes from git@github.com:nezasa/tb-service-sourcing.git 05:16:35 using GIT_SSH to set credentials Github SSH Key for common libraries access 05:16:35 > git fetch --tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10{noformat} After the update the output is (Git is now Avoiding second fetch): ** {noformat} 05:16:59 > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10 05:17:01 Avoid second fetch 05:17:01 Checking out Revision 68628022e4553cacb97377dfd35d54c3d3d3734f (develop) 05:17:01 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:17:01 > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10 05:17:01 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:17:01 > git config core.sparsecheckout # timeout=10 05:17:01 > git checkout -f 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10 05:17:01 > git branch -a -v --no-abbrev # timeout=10 05:17:02 > git checkout -b develop 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10{noformat} Adding *allowSecondFetch* flag and setting it to true on the global settings seems to fix the issue but I was expecting that the Advanced Clone Setting on the job would be enough. |
Description |
Original:
After upgrading git plugin to version 4.4.4 (can't recall the previous version), my Jenkins job started to fail on the checkout step, defined as bellow: {code:java} stage('Checkout') { retry(3) { scmvars = checkout([ $class : 'GitSCM', branches : scm.branches, doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations, extensions : scm.extensions + [$class: 'CloneOption', noTags: false, reference: '~/git/service-sourcing/', shallow: false] + [$class: 'LocalBranch', localBranch: "**"] + [$class: 'UserIdentity', email: 'dev@nezasa.com', name: 'Jenkins CI'], userRemoteConfigs : scm.userRemoteConfigs ]) } }{code} Before the update the job used to output this during checkout: ** {noformat} 05:16:32 > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10 05:16:35 Fetching without tags 05:16:35 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:16:35 > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10 05:16:35 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:16:35 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:16:35 Fetching upstream changes from git@github.com:nezasa/tb-service-sourcing.git 05:16:35 using GIT_SSH to set credentials Github SSH Key for common libraries access 05:16:35 > git fetch --tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10{noformat} After the update the output is (Git is now Avoiding second fetch): ** {noformat} 05:16:59 > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10 05:17:01 Avoid second fetch 05:17:01 Checking out Revision 68628022e4553cacb97377dfd35d54c3d3d3734f (develop) 05:17:01 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:17:01 > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10 05:17:01 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:17:01 > git config core.sparsecheckout # timeout=10 05:17:01 > git checkout -f 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10 05:17:01 > git branch -a -v --no-abbrev # timeout=10 05:17:02 > git checkout -b develop 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10{noformat} Adding *allowSecondFetch* flag and setting it to true on the global settings seems to fix the issue but I was expecting that the Advanced Clone Setting on the job would be enough. |
New:
As requested in {{*allowSecondFetch*}} ** documentation I am opening a ticket. After upgrading git plugin to version 4.4.4 (can't recall the previous version), my Jenkins job started to fail on the checkout step because it requires the version tags, defined as bellow: {code:java} stage('Checkout') { retry(3) { scmvars = checkout([ $class : 'GitSCM', branches : scm.branches, doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations, extensions : scm.extensions + [$class: 'CloneOption', noTags: false, reference: '~/git/service-sourcing/', shallow: false] + [$class: 'LocalBranch', localBranch: "**"] + [$class: 'UserIdentity', email: 'dev@nezasa.com', name: 'Jenkins CI'], userRemoteConfigs : scm.userRemoteConfigs ]) } }{code} Before the update the job used to output this during checkout: ** {noformat} 05:16:32 > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10 05:16:35 Fetching without tags 05:16:35 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:16:35 > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10 05:16:35 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:16:35 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:16:35 Fetching upstream changes from git@github.com:nezasa/tb-service-sourcing.git 05:16:35 using GIT_SSH to set credentials Github SSH Key for common libraries access 05:16:35 > git fetch --tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10{noformat} After the update the output is (Git is now Avoiding second fetch): ** {noformat} 05:16:59 > git fetch --no-tags --force --progress -- git@github.com:nezasa/tb-service-sourcing.git +refs/heads/develop:refs/remotes/origin/develop +refs/heads/*:refs/remotes/origin/* # timeout=10 05:17:01 Avoid second fetch 05:17:01 Checking out Revision 68628022e4553cacb97377dfd35d54c3d3d3734f (develop) 05:17:01 > git config remote.origin.url git@github.com:nezasa/tb-service-sourcing.git # timeout=10 05:17:01 > git config --add remote.origin.fetch +refs/heads/develop:refs/remotes/origin/develop # timeout=10 05:17:01 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:17:01 > git config core.sparsecheckout # timeout=10 05:17:01 > git checkout -f 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10 05:17:01 > git branch -a -v --no-abbrev # timeout=10 05:17:02 > git checkout -b develop 68628022e4553cacb97377dfd35d54c3d3d3734f # timeout=10{noformat} Adding *allowSecondFetch* flag and setting it to true on the global settings seems to fix the issue but I was expecting that the Advanced Clone Setting on the job would be enough. |
Assignee | Original: Mark Waite [ markewaite ] |
Summary | Original: Jenkins Job unable to perform second fetch without allowSecondFetch flag set to true | New: Git tags setting is ignored by initial repository fetch |
Attachment | New: image-2020-10-22-16-06-51-619.png [ 53018 ] | |
Attachment | New: image.png [ 53019 ] | |
Attachment | New: image.png [ 53020 ] |
Attachment | Original: image.png [ 53019 ] |