-
Bug
-
Resolution: Unresolved
-
Critical
-
None
-
Jenkins: 2.331
OS: Linux - 3.10.0-1160.53.1.el7.x86_64
---
Office-365-Connector:4.15.2
ace-editor:1.1
analysis-core:1.96
ansicolor:1.0.1
ant:1.13
antisamy-markup-formatter:2.7
apache-httpcomponents-client-4-api:4.5.13-1.0
artifactory:3.15.2
authentication-tokens:1.4
authorize-project:1.4.0
badge:1.9.1
bitbucket:214.v2fd4234d0554
block-queued-job:0.2.0
blueocean:1.25.2
blueocean-autofavorite:1.2.4
blueocean-bitbucket-pipeline:1.25.2
blueocean-commons:1.25.2
blueocean-config:1.25.2
blueocean-core-js:1.25.2
blueocean-dashboard:1.25.2
blueocean-display-url:2.4.1
blueocean-events:1.25.2
blueocean-executor-info:1.25.2
blueocean-git-pipeline:1.25.2
blueocean-github-pipeline:1.25.2
blueocean-i18n:1.25.2
blueocean-jira:1.25.2
blueocean-jwt:1.25.2
blueocean-personalization:1.25.2
blueocean-pipeline-api-impl:1.25.2
blueocean-pipeline-editor:1.25.2
blueocean-pipeline-scm-api:1.25.2
blueocean-rest:1.25.2
blueocean-rest-impl:1.25.2
blueocean-web:1.25.2
bootstrap4-api:4.6.0-3
bootstrap5-api:5.1.3-4
bouncycastle-api:2.25
branch-api:2.7.0
build-blocker-plugin:1.7.7
build-failure-analyzer:2.1.0
build-monitor-plugin:1.13+build.202201221819
build-timeout:1.20
build-token-root:1.9
build-user-vars-plugin:1.8
caffeine-api:2.9.2-29.v717aac953ff3
checkmarx:2022.1.2
checks-api:1.7.2
claim:2.18.2
cloudbees-bitbucket-branch-source:751.vda_24678a_f781
cloudbees-folder:6.17
command-launcher:1.6
conditional-buildstep:1.4.1
config-file-provider:3.8.2
configurationslicing:1.52
copyartifact:1.46.2
credentials:1074.v60e6c29b_b_44b_
credentials-binding:1.27.1
custom-tools-plugin:0.8
cvs:2.19
dashboard-view:2.18
dependency-check-jenkins-plugin:5.1.2
dependency-track:4.0.0
discard-old-build:1.05
display-url-api:2.3.5
docker-commons:1.18
docker-java-api:3.1.5.2
docker-swarm:1.11
docker-workflow:1.27
durable-task:493.v195aefbb0ff2
echarts-api:5.2.2-2
email-ext:2.87
embeddable-build-status:2.0.3
envinject:2.4.0
envinject-api:1.8
extended-choice-parameter:0.82
external-monitor-job:1.7
favorite:2.3.3
file-operations:1.11
font-awesome-api:5.15.4-5
git:4.10.3
git-changelog:3.18
git-client:3.11.1-SNAPSHOT (private-b07504bc-)
git-server:1.10
github:1.34.1
github-api:1.301-378.v9807bd746da5
github-branch-source:2.11.4
google-metadata-plugin:0.3.1
google-oauth-plugin:1.0.6
google-storage-plugin:1.5.4.1
gradle:1.38
greenballs:1.15.1
groovy:2.4
groovy-postbuild:2.5
h2-api:1.4.199
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-1.0
htmlpublisher:1.28
http_request:1.13
icon-shim:3.0.0
ivy:2.1
jackson2-api:2.13.1-246.va8a9f3eaf46a
javadoc:1.6
javax-activation-api:1.2.0-2
javax-mail-api:1.6.2-5
jaxb:2.3.0.1
jdk-tool:1.5
jenkins-design-language:1.25.2
jira:3.6
jjwt-api:0.11.2-9.c8b45b8bb173
job-dsl:1.78.3
jobConfigHistory:2.31-rc1098.b666422863b2
jquery:1.12.4-1
jquery-detached:1.2.1
jquery-ui:1.0.2
jquery3-api:3.6.0-2
jsch:0.1.55.2
junit:1.53
label-linked-jobs:6.0.1
labelled-steps:1.0
ldap:2.7
leastload:3.0.0
lockable-resources:2.13
locks-and-latches:0.6
mailer:408.vd726a_1130320
mapdb-api:1.0.9.0
matrix-auth:3.0
matrix-project:1.20
maven-plugin:3.16
mercurial:2.16
metrics:4.0.2.8.1
momentjs:1.1.1
monitoring:1.90.0
msbuild:1.30
nested-view:1.24
newrelic-deployment-notifier:1.8
nodejs:1.5.1
nodelabelparameter:1.10.3
oauth-credentials:0.5
okhttp-api:4.9.3-105.vb96869f8ac3a
pam-auth:1.6.1
parameterized-trigger:2.43
pipeline-build-step:2.15
pipeline-graph-analysis:188.v3a01e7973f2c
pipeline-input-step:446.vf27b_0b_83500e
pipeline-maven:3.10.0
pipeline-milestone-step:1.3.2
pipeline-model-api:1.9.3
pipeline-model-declarative-agent:1.1.1
pipeline-model-definition:1.9.3
pipeline-model-extensions:1.9.3
pipeline-rest-api:2.20
pipeline-stage-step:291.vf0a8a7aeeb50
pipeline-stage-tags-metadata:1.9.3
pipeline-stage-view:2.20
pipeline-utility-steps:2.12.0
plain-credentials:1.7
plugin-util-api:2.12.0
poll-mailbox-trigger-plugin:1.026
popper-api:1.16.1-2
popper2-api:2.11.2-1
powershell:1.7
preSCMbuildstep:0.3
promoted-builds:3.11
publish-over:0.22
publish-over-ftp:1.16
pubsub-light:1.16
pyenv-pipeline:2.1.2
resource-disposer:0.17
role-strategy:3.2.0
run-condition:1.5
saml:2.1.1-275.va_5718591a_999
scm-api:595.vd5a_df5eb_0e39
scmskip:1.0.3
script-security:1131.v8b_b_5eda_c328e
simple-theme-plugin:0.7
snakeyaml-api:1.29.1
sonar:2.14
sse-gateway:1.24
ssh-credentials:1.19
ssh-slaves:1.33.0
sshd:3.1.0
stashNotifier:1.25
strict-crumb-issuer:2.1.0
structs:308.v852b473a2b8c
subversion:2.15.2
test-results-aggregator:1.2.6
thinBackup:1.10
timestamper:1.16
token-macro:267.vcdaea6462991
trilead-api:1.0.13
variant:1.4
view-job-filters:2.3
windows-slaves:1.8
workflow-aggregator:2.6
workflow-api:1136.v7f5f1759dc16
workflow-basic-steps:2.24
workflow-cps:2648.va9433432b33c
workflow-cps-global-lib:552.vd9cc05b8a2e1
workflow-durable-task-step:1121.va_65b_d2701486
workflow-job:1156.v7539182e7b_d5
workflow-multibranch:706.vd43c65dec013
workflow-scm-step:2.13
workflow-step-api:622.vb_8e7c15b_c95a_
workflow-support:813.vb_d7c3d2984a_0Jenkins: 2.331 OS: Linux - 3.10.0-1160.53.1.el7.x86_64 --- Office-365-Connector:4.15.2 ace-editor:1.1 analysis-core:1.96 ansicolor:1.0.1 ant:1.13 antisamy-markup-formatter:2.7 apache-httpcomponents-client-4-api:4.5.13-1.0 artifactory:3.15.2 authentication-tokens:1.4 authorize-project:1.4.0 badge:1.9.1 bitbucket:214.v2fd4234d0554 block-queued-job:0.2.0 blueocean:1.25.2 blueocean-autofavorite:1.2.4 blueocean-bitbucket-pipeline:1.25.2 blueocean-commons:1.25.2 blueocean-config:1.25.2 blueocean-core-js:1.25.2 blueocean-dashboard:1.25.2 blueocean-display-url:2.4.1 blueocean-events:1.25.2 blueocean-executor-info:1.25.2 blueocean-git-pipeline:1.25.2 blueocean-github-pipeline:1.25.2 blueocean-i18n:1.25.2 blueocean-jira:1.25.2 blueocean-jwt:1.25.2 blueocean-personalization:1.25.2 blueocean-pipeline-api-impl:1.25.2 blueocean-pipeline-editor:1.25.2 blueocean-pipeline-scm-api:1.25.2 blueocean-rest:1.25.2 blueocean-rest-impl:1.25.2 blueocean-web:1.25.2 bootstrap4-api:4.6.0-3 bootstrap5-api:5.1.3-4 bouncycastle-api:2.25 branch-api:2.7.0 build-blocker-plugin:1.7.7 build-failure-analyzer:2.1.0 build-monitor-plugin:1.13+build.202201221819 build-timeout:1.20 build-token-root:1.9 build-user-vars-plugin:1.8 caffeine-api:2.9.2-29.v717aac953ff3 checkmarx:2022.1.2 checks-api:1.7.2 claim:2.18.2 cloudbees-bitbucket-branch-source:751.vda_24678a_f781 cloudbees-folder:6.17 command-launcher:1.6 conditional-buildstep:1.4.1 config-file-provider:3.8.2 configurationslicing:1.52 copyartifact:1.46.2 credentials:1074.v60e6c29b_b_44b_ credentials-binding:1.27.1 custom-tools-plugin:0.8 cvs:2.19 dashboard-view:2.18 dependency-check-jenkins-plugin:5.1.2 dependency-track:4.0.0 discard-old-build:1.05 display-url-api:2.3.5 docker-commons:1.18 docker-java-api:3.1.5.2 docker-swarm:1.11 docker-workflow:1.27 durable-task:493.v195aefbb0ff2 echarts-api:5.2.2-2 email-ext:2.87 embeddable-build-status:2.0.3 envinject:2.4.0 envinject-api:1.8 extended-choice-parameter:0.82 external-monitor-job:1.7 favorite:2.3.3 file-operations:1.11 font-awesome-api:5.15.4-5 git:4.10.3 git-changelog:3.18 git-client:3.11.1-SNAPSHOT (private-b07504bc-) git-server:1.10 github:1.34.1 github-api:1.301-378.v9807bd746da5 github-branch-source:2.11.4 google-metadata-plugin:0.3.1 google-oauth-plugin:1.0.6 google-storage-plugin:1.5.4.1 gradle:1.38 greenballs:1.15.1 groovy:2.4 groovy-postbuild:2.5 h2-api:1.4.199 handlebars:3.0.8 handy-uri-templates-2-api:2.1.8-1.0 htmlpublisher:1.28 http_request:1.13 icon-shim:3.0.0 ivy:2.1 jackson2-api:2.13.1-246.va8a9f3eaf46a javadoc:1.6 javax-activation-api:1.2.0-2 javax-mail-api:1.6.2-5 jaxb:2.3.0.1 jdk-tool:1.5 jenkins-design-language:1.25.2 jira:3.6 jjwt-api:0.11.2-9.c8b45b8bb173 job-dsl:1.78.3 jobConfigHistory:2.31-rc1098.b666422863b2 jquery:1.12.4-1 jquery-detached:1.2.1 jquery-ui:1.0.2 jquery3-api:3.6.0-2 jsch:0.1.55.2 junit:1.53 label-linked-jobs:6.0.1 labelled-steps:1.0 ldap:2.7 leastload:3.0.0 lockable-resources:2.13 locks-and-latches:0.6 mailer:408.vd726a_1130320 mapdb-api:1.0.9.0 matrix-auth:3.0 matrix-project:1.20 maven-plugin:3.16 mercurial:2.16 metrics:4.0.2.8.1 momentjs:1.1.1 monitoring:1.90.0 msbuild:1.30 nested-view:1.24 newrelic-deployment-notifier:1.8 nodejs:1.5.1 nodelabelparameter:1.10.3 oauth-credentials:0.5 okhttp-api:4.9.3-105.vb96869f8ac3a pam-auth:1.6.1 parameterized-trigger:2.43 pipeline-build-step:2.15 pipeline-graph-analysis:188.v3a01e7973f2c pipeline-input-step:446.vf27b_0b_83500e pipeline-maven:3.10.0 pipeline-milestone-step:1.3.2 pipeline-model-api:1.9.3 pipeline-model-declarative-agent:1.1.1 pipeline-model-definition:1.9.3 pipeline-model-extensions:1.9.3 pipeline-rest-api:2.20 pipeline-stage-step:291.vf0a8a7aeeb50 pipeline-stage-tags-metadata:1.9.3 pipeline-stage-view:2.20 pipeline-utility-steps:2.12.0 plain-credentials:1.7 plugin-util-api:2.12.0 poll-mailbox-trigger-plugin:1.026 popper-api:1.16.1-2 popper2-api:2.11.2-1 powershell:1.7 preSCMbuildstep:0.3 promoted-builds:3.11 publish-over:0.22 publish-over-ftp:1.16 pubsub-light:1.16 pyenv-pipeline:2.1.2 resource-disposer:0.17 role-strategy:3.2.0 run-condition:1.5 saml:2.1.1-275.va_5718591a_999 scm-api:595.vd5a_df5eb_0e39 scmskip:1.0.3 script-security:1131.v8b_b_5eda_c328e simple-theme-plugin:0.7 snakeyaml-api:1.29.1 sonar:2.14 sse-gateway:1.24 ssh-credentials:1.19 ssh-slaves:1.33.0 sshd:3.1.0 stashNotifier:1.25 strict-crumb-issuer:2.1.0 structs:308.v852b473a2b8c subversion:2.15.2 test-results-aggregator:1.2.6 thinBackup:1.10 timestamper:1.16 token-macro:267.vcdaea6462991 trilead-api:1.0.13 variant:1.4 view-job-filters:2.3 windows-slaves:1.8 workflow-aggregator:2.6 workflow-api:1136.v7f5f1759dc16 workflow-basic-steps:2.24 workflow-cps:2648.va9433432b33c workflow-cps-global-lib:552.vd9cc05b8a2e1 workflow-durable-task-step:1121.va_65b_d2701486 workflow-job:1156.v7539182e7b_d5 workflow-multibranch:706.vd43c65dec013 workflow-scm-step:2.13 workflow-step-api:622.vb_8e7c15b_c95a_ workflow-support:813.vb_d7c3d2984a_0
When running pipelines on Jenkins 2.331 the initial SCM checkout/clone fails when the pipeline definition specifies a global agent context with an OS that differs from the OS of the controller.
Started by user xxxxxx Running as xxxxx Checking out git https://xxxxxxxxxxx/jenkins-pipeline.git into /apps/jenkins/jobs/...../workspace@script to read resources/pipelines/......groovy The recommended git tool is: /usr/bin/git using credential svc_xxxxxxxxxxxxx > /usr/bin/git rev-parse --resolve-git-dir /apps/jenkins/jobs/....../workspace@script/.git # timeout=10 Fetching changes from the remote Git repository > /usr/bin/git config remote.origin.url https://xxxxxx/jenkins-pipeline.git # timeout=10 Fetching upstream changes from https://xxxxxxx/jenkins-pipeline.git > /usr/bin/git --version # timeout=10 > git --version # 'git version 2.24.4' using GIT_ASKPASS to set credentials Bitbucket Server (xxxxxxx) > /usr/bin/git fetch --tags --force --progress -- https://xxxxxxx/jenkins-pipeline.git +refs/heads/*:refs/remotes/origin/* # timeout=10 ERROR: Error fetching remote repo 'origin' hudson.plugins.git.GitException: Failed to fetch from https://xxxxxxx/jenkins-pipeline.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:1001) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1242) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1302) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:154) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:68) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:311) at hudson.model.ResourceController.execute(ResourceController.java:101) at hudson.model.Executor.run(Executor.java:442) Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git fetch --tags --force --progress -- https://xxxxxxx/jenkins-pipeline.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: /apps/jenkins/jobs/...../workspace@script@tmp/jenkins-gitclient-pass2348591706542264259.sh: line 3: cat: command not found error: unable to read askpass response from '/apps/jenkins/jobs/....../workspace@script@tmp/jenkins-gitclient-pass2348591706542264259.sh' fatal: could not read Username for 'https://xxxxxx.com': terminal prompts disabled at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2671) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2096) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:84) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:618) at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:999) ... 8 more ERROR: Error fetching remote repo 'origin' ERROR: Maximum checkout retry attempts reached, aborting Finished: FAILURE
Our controller runs on Linux and we have a pipeline that runs exclusively on windows agents. The pipeline declares a global contexts for certain stages that must run on a single agent vs others that run in parallel on all agents
pipeline { agent { node { label MASTER_NODE } }
When running this pipeline the above error is thrown and the pipeline fails. If i rerun the pipeline but set the agent to "agent: none", then the checkout completes as expected, but our pipeline fails due to missing context.
Given the error and the fact this only seems to happen with global agent context where the agents OS differs from the controllers OS, I assume something is overriding the path with the path from the Windows agent.
To partially prove this, i deployed a custom version of the git-client-plugin, where i modified createUnixStandardAskpass to explicitly output the full path
private File createUnixStandardAskpass(StandardUsernamePasswordCredentials creds, File usernameFile, File passwordFile) throws IOException { File askpass = createTempFile("pass", ".sh"); try (PrintWriter w = new PrintWriter(askpass, encoding)) { w.println("#!/bin/sh"); w.println("case \"$1\" in"); w.println("Username*) /bin/cat " + unixArgEncodeFileName(usernameFile.getAbsolutePath()) + " ;;"); w.println("Password*) /bin/cat " + unixArgEncodeFileName(passwordFile.getAbsolutePath()) + " ;;"); w.println("esac"); } askpass.setExecutable(true, true); // fixSELinuxLabel(askpass, "ssh_exec_t"); return askpass; }
The checkout then completes correctly.
I found something similar, but in a plugin we don't use
https://issues.jenkins.io/browse/JENKINS-55948?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel
https://github.com/jenkinsci/git-parameter-plugin/commit/a39eac169d72df2b6e3b10a4050b18030770150b?diff=split