We have an issue when running pipelines in a mixed environment with a Linux controller and Windows agents.
When using a pipeline job that uses either the node or label parameters, if the node defined by the param value is a windows node then the pipeline checkout stage fails.
Checking out git https://xxxxxxxxx.git into /xxx/xxxx/workspace@script to read resources/pipelines/playground/git-clone.groovy
The recommended git tool is: /usr/bin/git
using credential xxxxxxxxx
> /usr/bin/git rev-parse --resolve-git-dir /xxx/xxxx/workspace@script/.git # timeout=10
Fetching changes from the remote Git repository
> /usr/bin/git config remote.origin.url https://xxxxxxxx.git # timeout=10
Fetching upstream changes from https://xxxxxxxxxx.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://xxxxxxxx.git +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://xxxxxxxxxx.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://xxxxxxxxxxx.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: /xxx/xxxx/workspace@script@tmp/jenkins-gitclient-pass14582565555892846354.sh: line 3: cat: command not found
error: unable to read askpass response from '/xxx/xxxx/workspace@script@tmp/jenkins-gitclient-pass14582565555892846354.sh'
fatal: could not read Username for 'https://xxxxxxx.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
The path of the controller is perfectly fine and any pipeline that doesn't use the node or label parameter types is correctly checked out from the same scm system with the same credentials.
It appears that the path on the controller is being overwritten by the path of the node resolved by the param.
When we change the label param to a simple string param and resolve the nodes explicitly in the pipeline everything works correctly.
Its not clear is this is an issue in the node and label parameter plugin or the gitscm plugin or a combination of both.
Originally reported by ffsetit, imported from: Controller path altered in mixed OS environment
- status: Open
- priority: Minor
- component(s): nodelabelparameter-plugin
- resolution: Unresolved
- votes: 0
- watchers: 4
- imported: 20251210-235911
Raw content of original issue
We have an issue when running pipelines in a mixed environment with a Linux controller and Windows agents.
When using a pipeline job that uses either the node or label parameters, if the node defined by the param value is a windows node then the pipeline checkout stage fails.
Checking out git https://xxxxxxxxx.git into /xxx/xxxx/workspace@script to read resources/pipelines/playground/git-clone.groovy
The recommended git tool is: /usr/bin/git
using credential xxxxxxxxx
> /usr/bin/git rev-parse --resolve-git-dir /xxx/xxxx/workspace@script/.git # timeout=10
Fetching changes from the remote Git repository
> /usr/bin/git config remote.origin.url https://xxxxxxxx.git # timeout=10
Fetching upstream changes from https://xxxxxxxxxx.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://xxxxxxxx.git +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://xxxxxxxxxx.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://xxxxxxxxxxx.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: /xxx/xxxx/workspace@script@tmp/jenkins-gitclient-pass14582565555892846354.sh: line 3: cat: command not found
error: unable to read askpass response from '/xxx/xxxx/workspace@script@tmp/jenkins-gitclient-pass14582565555892846354.sh'
fatal: could not read Username for 'https://xxxxxxx.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
The path of the controller is perfectly fine and any pipeline that doesn't use the node or label parameter types is correctly checked out from the same scm system with the same credentials.
It appears that the path on the controller is being overwritten by the path of the node resolved by the param.
When we change the label param to a simple string param and resolve the nodes explicitly in the pipeline everything works correctly.
Its not clear is this is an issue in the node and label parameter plugin or the gitscm plugin or a combination of both.
environment
Jenkins: 2.350<br/>
OS: Linux - 3.10.0-1160.59.1.el7.x86_64<br/>
---<br/>
Office-365-Connector:4.17.0<br/>
ace-editor:1.1<br/>
ansible:1.1<br/>
ansicolor:1.0.1<br/>
ant:475.vf34069fef73c<br/>
antisamy-markup-formatter:2.7<br/>
apache-httpcomponents-client-4-api:4.5.13-1.0<br/>
artifactory:3.16.2<br/>
authentication-tokens:1.4<br/>
authorize-project:1.4.0<br/>
badge:1.9.1<br/>
bitbucket:223.vd12f2bca5430<br/>
block-queued-job:0.2.0<br/>
blueocean:1.25.5<br/>
blueocean-autofavorite:1.2.5<br/>
blueocean-bitbucket-pipeline:1.25.5<br/>
blueocean-commons:1.25.5<br/>
blueocean-config:1.25.5<br/>
blueocean-core-js:1.25.5<br/>
blueocean-dashboard:1.25.5<br/>
blueocean-display-url:2.4.1<br/>
blueocean-events:1.25.5<br/>
blueocean-git-pipeline:1.25.5<br/>
blueocean-github-pipeline:1.25.5<br/>
blueocean-i18n:1.25.5<br/>
blueocean-jira:1.25.5<br/>
blueocean-jwt:1.25.5<br/>
blueocean-personalization:1.25.5<br/>
blueocean-pipeline-api-impl:1.25.5<br/>
blueocean-pipeline-editor:1.25.5<br/>
blueocean-pipeline-scm-api:1.25.5<br/>
blueocean-rest:1.25.5<br/>
blueocean-rest-impl:1.25.5<br/>
blueocean-web:1.25.5<br/>
bootstrap4-api:4.6.0-5<br/>
bootstrap5-api:5.1.3-7<br/>
bouncycastle-api:2.26<br/>
branch-api:2.1046.v0ca_37783ecc5<br/>
build-blocker-plugin:1.7.8<br/>
build-failure-analyzer:2.3.0<br/>
build-monitor-plugin:1.13+build.202205140447<br/>
build-timeout:1.21<br/>
build-token-root:1.9<br/>
build-user-vars-plugin:1.8<br/>
caffeine-api:2.9.3-65.v6a_47d0f4d1fe<br/>
checkmarx:2022.2.3<br/>
checks-api:1.7.4<br/>
claim:2.18.2<br/>
cloudbees-bitbucket-branch-source:773.v4b_9b_005b_562b_<br/>
cloudbees-folder:6.722.v8165b_a_cf25e9<br/>
command-launcher:84.v4a_97f2027398<br/>
conditional-buildstep:1.4.2<br/>
config-file-provider:3.10.0<br/>
configurationslicing:430.v966357576543<br/>
copyartifact:1.46.4<br/>
credentials:1129.vef26f5df883c<br/>
credentials-binding:523.vd859a_4b_122e6<br/>
custom-tools-plugin:0.8<br/>
dashboard-view:2.432.va_712ce35862d<br/>
database:148.v4a_ff2ca_608b_7<br/>
database-mysql:1.4<br/>
dependency-check-jenkins-plugin:5.1.2<br/>
dependency-track:4.1.1<br/>
discard-old-build:1.05<br/>
display-url-api:2.3.6<br/>
docker-commons:1.19<br/>
docker-java-api:3.1.5.2<br/>
docker-swarm:1.11<br/>
docker-workflow:1.28<br/>
durable-task:496.va67c6f9eefa7<br/>
echarts-api:5.3.2-2<br/>
email-ext:2.88<br/>
embeddable-build-status:2.0.3<br/>
envinject:2.866.v5c0403e3d4df<br/>
envinject-api:1.199.v3ce31253ed13<br/>
extended-choice-parameter:0.82<br/>
external-monitor-job:191.v363d0d1efdf8<br/>
favorite:2.4.1<br/>
file-operations:1.11<br/>
font-awesome-api:6.1.1-1<br/>
git:4.11.3<br/>
git-changelog:3.23<br/>
git-client:3.11.0<br/>
git-server:1.11<br/>
github:1.34.3<br/>
github-api:1.303-400.v35c2d8258028<br/>
github-branch-source:1637.vd833b_7ca_7654<br/>
google-metadata-plugin:0.3.1<br/>
google-oauth-plugin:1.0.6<br/>
google-storage-plugin:1.5.6<br/>
gradle:1.38<br/>
greenballs:1.15.1<br/>
groovy:2.4<br/>
groovy-postbuild:2.5<br/>
h2-api:1.4.199<br/>
handlebars:3.0.8<br/>
handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953<br/>
htmlpublisher:1.30<br/>
http_request:1.15<br/>
ivy:2.2<br/>
jackson2-api:2.13.3-285.vc03c0256d517<br/>
javadoc:217.v905b_86277a_2a_<br/>
javax-activation-api:1.2.0-3<br/>
javax-mail-api:1.6.2-6<br/>
jaxb:2.3.6-1<br/>
jdk-tool:1.5<br/>
jenkins-design-language:1.25.5<br/>
jira:3.7.1<br/>
jjwt-api:0.11.2-71.v2722b_b_06a_2a_f<br/>
job-dsl:1.79<br/>
jobConfigHistory:1146.v94c2521f9213<br/>
jquery:1.12.4-1<br/>
jquery-detached:1.2.1<br/>
jquery3-api:3.6.0-4<br/>
jsch:0.1.55.2<br/>
junit:1119.va_a_5e9068da_d7<br/>
kpp-management-plugin:1.0.0<br/>
label-linked-jobs:6.0.1<br/>
labelled-steps:1.0<br/>
ldap:2.10<br/>
leastload:3.0.0<br/>
lockable-resources:2.15<br/>
mailer:414.vcc4c33714601<br/>
mapdb-api:1.0.9.0<br/>
matrix-auth:3.1.2<br/>
matrix-project:771.v574584b_39e60<br/>
maven-plugin:3.19<br/>
mercurial:2.16.2<br/>
metrics:4.1.6.2<br/>
mina-sshd-api-common:2.8.0-21.v493b_6b_db_22c6<br/>
mina-sshd-api-core:2.8.0-21.v493b_6b_db_22c6<br/>
momentjs:1.1.1<br/>
monitoring:1.91.0<br/>
msbuild:1.30<br/>
mysql-api:8.0.16<br/>
nested-view:1.25<br/>
newrelic-deployment-notifier:1.8<br/>
nodejs:1.5.1<br/>
nodelabelparameter:1.10.3.1<br/>
oauth-credentials:0.5<br/>
okhttp-api:4.9.3-105.vb96869f8ac3a<br/>
pam-auth:1.8<br/>
parameterized-trigger:2.44<br/>
pipeline-build-step:2.18<br/>
pipeline-graph-analysis:195.v5812d95a_a_2f9<br/>
pipeline-groovy-lib:591.v3a_7f422b_d058<br/>
pipeline-input-step:448.v37cea_9a_10a_70<br/>
pipeline-maven:3.10.0<br/>
pipeline-milestone-step:101.vd572fef9d926<br/>
pipeline-model-api:2.2086.v12b_420f036e5<br/>
pipeline-model-definition:2.2086.v12b_420f036e5<br/>
pipeline-model-extensions:2.2086.v12b_420f036e5<br/>
pipeline-rest-api:2.24<br/>
pipeline-stage-step:293.v200037eefcd5<br/>
pipeline-stage-tags-metadata:2.2086.v12b_420f036e5<br/>
pipeline-stage-view:2.24<br/>
pipeline-utility-steps:2.12.1<br/>
plain-credentials:1.8<br/>
plugin-util-api:2.17.0<br/>
popper-api:1.16.1-3<br/>
popper2-api:2.11.5-2<br/>
powershell:1.7<br/>
preSCMbuildstep:0.3<br/>
promoted-builds:3.11<br/>
publish-over:0.22<br/>
publish-over-ftp:1.17<br/>
pubsub-light:1.16<br/>
pyenv-pipeline:2.1.2<br/>
resource-disposer:0.19<br/>
role-strategy:488.v0634ce149b_8c<br/>
run-condition:1.5<br/>
saml:2.298.vc7a_2b_3958628<br/>
scm-api:608.vfa_f971c5a_a_e9<br/>
scmskip:1.0.3<br/>
script-security:1175.v4b_d517d6db_f0<br/>
simple-theme-plugin:103.va_161d09c38c7<br/>
snakeyaml-api:1.30.1<br/>
sonar:2.14<br/>
sse-gateway:1.25<br/>
ssh-agent:295.v9ca_a_1c7cc3a_a_<br/>
ssh-credentials:277.v95c2fec1c047<br/>
ssh-slaves:1.814.vc82988f54b_10<br/>
sshd:3.237.v883d165a_c1d3<br/>
stashNotifier:1.28<br/>
strict-crumb-issuer:2.1.0<br/>
structs:318.va_f3ccb_729b_71<br/>
test-results-aggregator:1.2.9<br/>
thinBackup:1.10<br/>
timestamper:1.17<br/>
token-macro:293.v283932a_0a_b_49<br/>
trilead-api:1.57.v6e90e07157e1<br/>
uno-choice:2.6.2<br/>
variant:1.4<br/>
view-job-filters:2.3<br/>
windows-slaves:1.8.1<br/>
workflow-aggregator:581.v0c46fa_697ffd<br/>
workflow-api:1153.vb_912c0e47fb_a_<br/>
workflow-basic-steps:948.v2c72a_091b_b_68<br/>
workflow-cps:2706.v71dd22b_c5a_a_2<br/>
workflow-cps-global-lib:588.v576c103a_ff86<br/>
workflow-durable-task-step:1139.v252a_e12e8463<br/>
workflow-job:1182.v60a_e6279b_579<br/>
workflow-multibranch:716.vc692a_e52371b_<br/>
workflow-scm-step:400.v6b_89a_1317c9a_<br/>
workflow-step-api:625.vd896b_f445a_f8<br/>
workflow-support:820.vd1a_6cc65ef33<br/>
ws-cleanup:0.42<br/>
openjdk version "11.0.14.1" 2022-02-08 LTS<br/>
OpenJDK Runtime Environment 18.9 (build 11.0.14.1+1-LTS)<br/>
OpenJDK 64-Bit Server VM 18.9 (build 11.0.14.1+1-LTS, mixed mode, sharing)
1 attachment
We have an issue when running pipelines in a mixed environment with a Linux controller and Windows agents.
When using a pipeline job that uses either the node or label parameters, if the node defined by the param value is a windows node then the pipeline checkout stage fails.
The path of the controller is perfectly fine and any pipeline that doesn't use the node or label parameter types is correctly checked out from the same scm system with the same credentials.
It appears that the path on the controller is being overwritten by the path of the node resolved by the param.
When we change the label param to a simple string param and resolve the nodes explicitly in the pipeline everything works correctly.
Its not clear is this is an issue in the node and label parameter plugin or the gitscm plugin or a combination of both.
Originally reported by ffsetit, imported from: Controller path altered in mixed OS environment
Raw content of original issue
environment
1 attachment