-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
windows
Given:
- Jenkins 2.319.2
- kubernetes-plugin 1.31.3
- a Windows (ltsc2019) kubernetes cluster
When:
- Setup a pipeline with two containers (jnlp + windowsservercore)
- Add a parameter of type text
- Have the pipeline execute a simple powershell command on the non-jnlp container (ex. pwd)
- Run the pipeline with the text parameter set to:
. path x
n.b. the '.' is not important to reproduce, but the newline after it is
Expectations:
- The pipeline should execute the command
Observations:
- The pipeline hangs infinitely on the powershell command
Additional details:
Here is a sample pipeline that reproduces the issue
pipeline { agent { kubernetes { yaml '''\ --- apiVersion: "v1" kind: "Pod" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "windowsservercore" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" ''' } } parameters { text(name: 'myparam', defaultValue: "\npath x", description: 'myparam') } stages { stage('Test') { steps { script { container('windowsservercore') { powershell "pwd" } } } } } }
Sample output:
[Pipeline] Start of Pipeline [Pipeline] podTemplate [Pipeline] { [Pipeline] node Created Pod: kubernetes jenkins/osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc [Normal][jenkins/osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc][Scheduled] Successfully assigned jenkins/osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc to canolsk8s01j [Normal][jenkins/osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc][Pulled] Container image "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" already present on machine [Normal][jenkins/osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc][Created] Created container windowsservercore [Normal][jenkins/osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc][Started] Started container windowsservercore [Normal][jenkins/osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc][Pulled] Container image "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" already present on machine [Normal][jenkins/osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc][Created] Created container jnlp [Normal][jenkins/osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc][Started] Started container jnlp Still waiting to schedule task ‘osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc’ is offline Agent osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc is provisioned from template osdk-gpetit_tests_test-long-params_43-n3gmp-qfqq1 --- apiVersion: "v1" kind: "Pod" metadata: annotations: buildUrl: "http://jenkins.jenkins.svc.cluster.local:80/job/osdk-gpetit/job/tests/job/test-long-params/43/" runUrl: "job/osdk-gpetit/job/tests/job/test-long-params/43/" labels: jenkins: "slave" jenkins/label-digest: "009d92f111e8a72c2c59471c07aa207cb7b8b04d" jenkins/label: "osdk-gpetit_tests_test-long-params_43-n3gmp" name: "osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "windowsservercore" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - env: - name: "JENKINS_SECRET" value: "********" - name: "JENKINS_TUNNEL" value: "jenkins-agent.jenkins.svc.cluster.local:50000" - name: "JENKINS_AGENT_NAME" value: "osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc" - name: "JENKINS_NAME" value: "osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc" - name: "JENKINS_AGENT_WORKDIR" value: "/home/jenkins/agent" - name: "JENKINS_URL" value: "http://jenkins.jenkins.svc.cluster.local:80/" image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" restartPolicy: "Never" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" Running on osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc in /home/jenkins/agent/workspace/osdk-gpetit/tests/test-long-params [Pipeline] { [Pipeline] stage [Pipeline] { (Test) [Pipeline] script [Pipeline] { [Pipeline] container [Pipeline] { [Pipeline] powershell
It seems like the path word in the param is interpreted on the windows containers and end up messing up the containers.
I could not find any log helping, but I'll be happy to provide any other additional detail necessary.
[JENKINS-67715] using 'path' in a pipeline param breaks powershell with kubernetes
Description |
Original:
*Given:*
** - Jenkins [2.319.2 - |https://www.jenkins.io/]kubernetes-plugin 1.31.3 - a Windows (ltsc2019) kubernetes cluster *When:* 1. Setup a pipeline with two containers (jnlp + windowsservercore) 2. Add a parameter of type *text* 3. Have the pipeline execute a simple powershell command on the non-jnlp container (ex. *pwd*) 4. Run the pipeline with the text parameter set to: {code:java} . path x{code} _n.b. the '.' is not important to reproduce, but the newline after it is_ *Expectations:* - The pipeline should execute the command *Observations:* - The pipeline hangs infinitely on the powershell command *Additional details:* Here is a sample pipeline that reproduces the issue {code:java} pipeline { agent { kubernetes { yaml '''\ --- apiVersion: "v1" kind: "Pod" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "nano" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" ''' } } parameters { text(name: 'myparam', defaultValue: "\npath x", description: 'myparam') } stages { stage('Test') { steps { script { container('nano') { powershell "pwd" } } } } } } {code} Sample output: {code:java} [Pipeline] Start of Pipeline [Pipeline] podTemplate [Pipeline] { [Pipeline] node Created Pod: kubernetes jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Scheduled] Successfully assigned jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt to canolsk8s01j [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulled] Container image "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" already present on machine [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Created] Created container nano [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Started] Started container nano [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulling] Pulling image "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" Still waiting to schedule task ‘osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt’ is offline [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulled] Successfully pulled image "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" in 3m53.3267045s [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Created] Created container jnlp [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Started] Started container jnlp Agent osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt is provisioned from template osdk-gpetit_tests_test-long-params_42-72rjc-0w152 --- apiVersion: "v1" kind: "Pod" metadata: annotations: buildUrl: "http://jenkins.jenkins.svc.cluster.local:80/job/osdk-gpetit/job/tests/job/test-long-params/42/" runUrl: "job/osdk-gpetit/job/tests/job/test-long-params/42/" labels: jenkins: "slave" jenkins/label-digest: "b28a981d7451217ad56f21ba75087f377518df8d" jenkins/label: "osdk-gpetit_tests_test-long-params_42-72rjc" name: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "nano" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - env: - name: "JENKINS_SECRET" value: "********" - name: "JENKINS_TUNNEL" value: "jenkins-agent.jenkins.svc.cluster.local:50000" - name: "JENKINS_AGENT_NAME" value: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" - name: "JENKINS_NAME" value: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" - name: "JENKINS_AGENT_WORKDIR" value: "/home/jenkins/agent" - name: "JENKINS_URL" value: "http://jenkins.jenkins.svc.cluster.local:80/" image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" restartPolicy: "Never" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" Running on osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt in /home/jenkins/agent/workspace/osdk-gpetit/tests/test-long-params [Pipeline] { [Pipeline] stage [Pipeline] { (Test) [Pipeline] script [Pipeline] { [Pipeline] container [Pipeline] { [Pipeline] powershell {code} It seems like the *path* word in the param is interpreted on the windows containers and end up messing up the containers. I could not find any log helping, but I'll be happy to provide any other additional detail necessary. |
New:
*Given:*
- Jenkins [2.319.2 - |https://www.jenkins.io/]kubernetes-plugin 1.31.3 - a Windows (ltsc2019) kubernetes cluster *When:* 1. Setup a pipeline with two containers (jnlp + windowsservercore) 2. Add a parameter of type *text* 3. Have the pipeline execute a simple powershell command on the non-jnlp container (ex. *pwd*) 4. Run the pipeline with the text parameter set to: {code:java} . path x{code} _n.b. the '.' is not important to reproduce, but the newline after it is_ *Expectations:* - The pipeline should execute the command *Observations:* - The pipeline hangs infinitely on the powershell command *Additional details:* Here is a sample pipeline that reproduces the issue {code:java} pipeline { agent { kubernetes { yaml '''\ --- apiVersion: "v1" kind: "Pod" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "nano" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" ''' } } parameters { text(name: 'myparam', defaultValue: "\npath x", description: 'myparam') } stages { stage('Test') { steps { script { container('nano') { powershell "pwd" } } } } } } {code} Sample output: {code:java} [Pipeline] Start of Pipeline [Pipeline] podTemplate [Pipeline] { [Pipeline] node Created Pod: kubernetes jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Scheduled] Successfully assigned jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt to canolsk8s01j [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulled] Container image "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" already present on machine [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Created] Created container nano [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Started] Started container nano [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulling] Pulling image "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" Still waiting to schedule task ‘osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt’ is offline [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulled] Successfully pulled image "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" in 3m53.3267045s [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Created] Created container jnlp [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Started] Started container jnlp Agent osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt is provisioned from template osdk-gpetit_tests_test-long-params_42-72rjc-0w152 --- apiVersion: "v1" kind: "Pod" metadata: annotations: buildUrl: "http://jenkins.jenkins.svc.cluster.local:80/job/osdk-gpetit/job/tests/job/test-long-params/42/" runUrl: "job/osdk-gpetit/job/tests/job/test-long-params/42/" labels: jenkins: "slave" jenkins/label-digest: "b28a981d7451217ad56f21ba75087f377518df8d" jenkins/label: "osdk-gpetit_tests_test-long-params_42-72rjc" name: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "nano" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - env: - name: "JENKINS_SECRET" value: "********" - name: "JENKINS_TUNNEL" value: "jenkins-agent.jenkins.svc.cluster.local:50000" - name: "JENKINS_AGENT_NAME" value: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" - name: "JENKINS_NAME" value: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" - name: "JENKINS_AGENT_WORKDIR" value: "/home/jenkins/agent" - name: "JENKINS_URL" value: "http://jenkins.jenkins.svc.cluster.local:80/" image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" restartPolicy: "Never" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" Running on osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt in /home/jenkins/agent/workspace/osdk-gpetit/tests/test-long-params [Pipeline] { [Pipeline] stage [Pipeline] { (Test) [Pipeline] script [Pipeline] { [Pipeline] container [Pipeline] { [Pipeline] powershell {code} It seems like the *path* word in the param is interpreted on the windows containers and end up messing up the containers. I could not find any log helping, but I'll be happy to provide any other additional detail necessary. |
Description |
Original:
*Given:*
- Jenkins [2.319.2 - |https://www.jenkins.io/]kubernetes-plugin 1.31.3 - a Windows (ltsc2019) kubernetes cluster *When:* 1. Setup a pipeline with two containers (jnlp + windowsservercore) 2. Add a parameter of type *text* 3. Have the pipeline execute a simple powershell command on the non-jnlp container (ex. *pwd*) 4. Run the pipeline with the text parameter set to: {code:java} . path x{code} _n.b. the '.' is not important to reproduce, but the newline after it is_ *Expectations:* - The pipeline should execute the command *Observations:* - The pipeline hangs infinitely on the powershell command *Additional details:* Here is a sample pipeline that reproduces the issue {code:java} pipeline { agent { kubernetes { yaml '''\ --- apiVersion: "v1" kind: "Pod" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "nano" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" ''' } } parameters { text(name: 'myparam', defaultValue: "\npath x", description: 'myparam') } stages { stage('Test') { steps { script { container('nano') { powershell "pwd" } } } } } } {code} Sample output: {code:java} [Pipeline] Start of Pipeline [Pipeline] podTemplate [Pipeline] { [Pipeline] node Created Pod: kubernetes jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Scheduled] Successfully assigned jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt to canolsk8s01j [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulled] Container image "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" already present on machine [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Created] Created container nano [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Started] Started container nano [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulling] Pulling image "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" Still waiting to schedule task ‘osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt’ is offline [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulled] Successfully pulled image "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" in 3m53.3267045s [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Created] Created container jnlp [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Started] Started container jnlp Agent osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt is provisioned from template osdk-gpetit_tests_test-long-params_42-72rjc-0w152 --- apiVersion: "v1" kind: "Pod" metadata: annotations: buildUrl: "http://jenkins.jenkins.svc.cluster.local:80/job/osdk-gpetit/job/tests/job/test-long-params/42/" runUrl: "job/osdk-gpetit/job/tests/job/test-long-params/42/" labels: jenkins: "slave" jenkins/label-digest: "b28a981d7451217ad56f21ba75087f377518df8d" jenkins/label: "osdk-gpetit_tests_test-long-params_42-72rjc" name: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "nano" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - env: - name: "JENKINS_SECRET" value: "********" - name: "JENKINS_TUNNEL" value: "jenkins-agent.jenkins.svc.cluster.local:50000" - name: "JENKINS_AGENT_NAME" value: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" - name: "JENKINS_NAME" value: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" - name: "JENKINS_AGENT_WORKDIR" value: "/home/jenkins/agent" - name: "JENKINS_URL" value: "http://jenkins.jenkins.svc.cluster.local:80/" image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" restartPolicy: "Never" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" Running on osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt in /home/jenkins/agent/workspace/osdk-gpetit/tests/test-long-params [Pipeline] { [Pipeline] stage [Pipeline] { (Test) [Pipeline] script [Pipeline] { [Pipeline] container [Pipeline] { [Pipeline] powershell {code} It seems like the *path* word in the param is interpreted on the windows containers and end up messing up the containers. I could not find any log helping, but I'll be happy to provide any other additional detail necessary. |
New:
*Given:*
- Jenkins 2.319.2 - |https://www.jenkins.io/]kubernetes-plugin 1.31.3 - a Windows (ltsc2019) kubernetes cluster *When:* 1. Setup a pipeline with two containers (jnlp + windowsservercore) 2. Add a parameter of type *text* 3. Have the pipeline execute a simple powershell command on the non-jnlp container (ex. *pwd*) 4. Run the pipeline with the text parameter set to: {code:java} . path x{code} _n.b. the '.' is not important to reproduce, but the newline after it is_ *Expectations:* - The pipeline should execute the command *Observations:* - The pipeline hangs infinitely on the powershell command *Additional details:* Here is a sample pipeline that reproduces the issue {code:java} pipeline { agent { kubernetes { yaml '''\ --- apiVersion: "v1" kind: "Pod" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "nano" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" ''' } } parameters { text(name: 'myparam', defaultValue: "\npath x", description: 'myparam') } stages { stage('Test') { steps { script { container('nano') { powershell "pwd" } } } } } } {code} Sample output: {code:java} [Pipeline] Start of Pipeline [Pipeline] podTemplate [Pipeline] { [Pipeline] node Created Pod: kubernetes jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Scheduled] Successfully assigned jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt to canolsk8s01j [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulled] Container image "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" already present on machine [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Created] Created container nano [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Started] Started container nano [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulling] Pulling image "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" Still waiting to schedule task ‘osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt’ is offline [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulled] Successfully pulled image "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" in 3m53.3267045s [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Created] Created container jnlp [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Started] Started container jnlp Agent osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt is provisioned from template osdk-gpetit_tests_test-long-params_42-72rjc-0w152 --- apiVersion: "v1" kind: "Pod" metadata: annotations: buildUrl: "http://jenkins.jenkins.svc.cluster.local:80/job/osdk-gpetit/job/tests/job/test-long-params/42/" runUrl: "job/osdk-gpetit/job/tests/job/test-long-params/42/" labels: jenkins: "slave" jenkins/label-digest: "b28a981d7451217ad56f21ba75087f377518df8d" jenkins/label: "osdk-gpetit_tests_test-long-params_42-72rjc" name: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "nano" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - env: - name: "JENKINS_SECRET" value: "********" - name: "JENKINS_TUNNEL" value: "jenkins-agent.jenkins.svc.cluster.local:50000" - name: "JENKINS_AGENT_NAME" value: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" - name: "JENKINS_NAME" value: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" - name: "JENKINS_AGENT_WORKDIR" value: "/home/jenkins/agent" - name: "JENKINS_URL" value: "http://jenkins.jenkins.svc.cluster.local:80/" image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" restartPolicy: "Never" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" Running on osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt in /home/jenkins/agent/workspace/osdk-gpetit/tests/test-long-params [Pipeline] { [Pipeline] stage [Pipeline] { (Test) [Pipeline] script [Pipeline] { [Pipeline] container [Pipeline] { [Pipeline] powershell {code} It seems like the *path* word in the param is interpreted on the windows containers and end up messing up the containers. I could not find any log helping, but I'll be happy to provide any other additional detail necessary. |
Description |
Original:
*Given:*
- Jenkins 2.319.2 - |https://www.jenkins.io/]kubernetes-plugin 1.31.3 - a Windows (ltsc2019) kubernetes cluster *When:* 1. Setup a pipeline with two containers (jnlp + windowsservercore) 2. Add a parameter of type *text* 3. Have the pipeline execute a simple powershell command on the non-jnlp container (ex. *pwd*) 4. Run the pipeline with the text parameter set to: {code:java} . path x{code} _n.b. the '.' is not important to reproduce, but the newline after it is_ *Expectations:* - The pipeline should execute the command *Observations:* - The pipeline hangs infinitely on the powershell command *Additional details:* Here is a sample pipeline that reproduces the issue {code:java} pipeline { agent { kubernetes { yaml '''\ --- apiVersion: "v1" kind: "Pod" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "nano" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" ''' } } parameters { text(name: 'myparam', defaultValue: "\npath x", description: 'myparam') } stages { stage('Test') { steps { script { container('nano') { powershell "pwd" } } } } } } {code} Sample output: {code:java} [Pipeline] Start of Pipeline [Pipeline] podTemplate [Pipeline] { [Pipeline] node Created Pod: kubernetes jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Scheduled] Successfully assigned jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt to canolsk8s01j [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulled] Container image "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" already present on machine [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Created] Created container nano [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Started] Started container nano [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulling] Pulling image "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" Still waiting to schedule task ‘osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt’ is offline [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulled] Successfully pulled image "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" in 3m53.3267045s [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Created] Created container jnlp [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Started] Started container jnlp Agent osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt is provisioned from template osdk-gpetit_tests_test-long-params_42-72rjc-0w152 --- apiVersion: "v1" kind: "Pod" metadata: annotations: buildUrl: "http://jenkins.jenkins.svc.cluster.local:80/job/osdk-gpetit/job/tests/job/test-long-params/42/" runUrl: "job/osdk-gpetit/job/tests/job/test-long-params/42/" labels: jenkins: "slave" jenkins/label-digest: "b28a981d7451217ad56f21ba75087f377518df8d" jenkins/label: "osdk-gpetit_tests_test-long-params_42-72rjc" name: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "nano" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - env: - name: "JENKINS_SECRET" value: "********" - name: "JENKINS_TUNNEL" value: "jenkins-agent.jenkins.svc.cluster.local:50000" - name: "JENKINS_AGENT_NAME" value: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" - name: "JENKINS_NAME" value: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" - name: "JENKINS_AGENT_WORKDIR" value: "/home/jenkins/agent" - name: "JENKINS_URL" value: "http://jenkins.jenkins.svc.cluster.local:80/" image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" restartPolicy: "Never" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" Running on osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt in /home/jenkins/agent/workspace/osdk-gpetit/tests/test-long-params [Pipeline] { [Pipeline] stage [Pipeline] { (Test) [Pipeline] script [Pipeline] { [Pipeline] container [Pipeline] { [Pipeline] powershell {code} It seems like the *path* word in the param is interpreted on the windows containers and end up messing up the containers. I could not find any log helping, but I'll be happy to provide any other additional detail necessary. |
New:
*Given:*
* Jenkins 2.319.2 * kubernetes-plugin 1.31.3 * a Windows (ltsc2019) kubernetes cluster *When:* 1. Setup a pipeline with two containers (jnlp + windowsservercore) 2. Add a parameter of type *text* 3. Have the pipeline execute a simple powershell command on the non-jnlp container (ex. *pwd*) 4. Run the pipeline with the text parameter set to: {code:java} . path x{code} _n.b. the '.' is not important to reproduce, but the newline after it is_ *Expectations:* - The pipeline should execute the command *Observations:* - The pipeline hangs infinitely on the powershell command *Additional details:* Here is a sample pipeline that reproduces the issue {code:java} pipeline { agent { kubernetes { yaml '''\ --- apiVersion: "v1" kind: "Pod" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "nano" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" ''' } } parameters { text(name: 'myparam', defaultValue: "\npath x", description: 'myparam') } stages { stage('Test') { steps { script { container('nano') { powershell "pwd" } } } } } } {code} Sample output: {code:java} [Pipeline] Start of Pipeline [Pipeline] podTemplate [Pipeline] { [Pipeline] node Created Pod: kubernetes jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Scheduled] Successfully assigned jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt to canolsk8s01j [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulled] Container image "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" already present on machine [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Created] Created container nano [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Started] Started container nano [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulling] Pulling image "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" Still waiting to schedule task ‘osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt’ is offline [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulled] Successfully pulled image "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" in 3m53.3267045s [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Created] Created container jnlp [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Started] Started container jnlp Agent osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt is provisioned from template osdk-gpetit_tests_test-long-params_42-72rjc-0w152 --- apiVersion: "v1" kind: "Pod" metadata: annotations: buildUrl: "http://jenkins.jenkins.svc.cluster.local:80/job/osdk-gpetit/job/tests/job/test-long-params/42/" runUrl: "job/osdk-gpetit/job/tests/job/test-long-params/42/" labels: jenkins: "slave" jenkins/label-digest: "b28a981d7451217ad56f21ba75087f377518df8d" jenkins/label: "osdk-gpetit_tests_test-long-params_42-72rjc" name: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "nano" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - env: - name: "JENKINS_SECRET" value: "********" - name: "JENKINS_TUNNEL" value: "jenkins-agent.jenkins.svc.cluster.local:50000" - name: "JENKINS_AGENT_NAME" value: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" - name: "JENKINS_NAME" value: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" - name: "JENKINS_AGENT_WORKDIR" value: "/home/jenkins/agent" - name: "JENKINS_URL" value: "http://jenkins.jenkins.svc.cluster.local:80/" image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" restartPolicy: "Never" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" Running on osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt in /home/jenkins/agent/workspace/osdk-gpetit/tests/test-long-params [Pipeline] { [Pipeline] stage [Pipeline] { (Test) [Pipeline] script [Pipeline] { [Pipeline] container [Pipeline] { [Pipeline] powershell {code} It seems like the *path* word in the param is interpreted on the windows containers and end up messing up the containers. I could not find any log helping, but I'll be happy to provide any other additional detail necessary. |
Description |
Original:
*Given:*
* Jenkins 2.319.2 * kubernetes-plugin 1.31.3 * a Windows (ltsc2019) kubernetes cluster *When:* 1. Setup a pipeline with two containers (jnlp + windowsservercore) 2. Add a parameter of type *text* 3. Have the pipeline execute a simple powershell command on the non-jnlp container (ex. *pwd*) 4. Run the pipeline with the text parameter set to: {code:java} . path x{code} _n.b. the '.' is not important to reproduce, but the newline after it is_ *Expectations:* - The pipeline should execute the command *Observations:* - The pipeline hangs infinitely on the powershell command *Additional details:* Here is a sample pipeline that reproduces the issue {code:java} pipeline { agent { kubernetes { yaml '''\ --- apiVersion: "v1" kind: "Pod" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "nano" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" ''' } } parameters { text(name: 'myparam', defaultValue: "\npath x", description: 'myparam') } stages { stage('Test') { steps { script { container('nano') { powershell "pwd" } } } } } } {code} Sample output: {code:java} [Pipeline] Start of Pipeline [Pipeline] podTemplate [Pipeline] { [Pipeline] node Created Pod: kubernetes jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Scheduled] Successfully assigned jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt to canolsk8s01j [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulled] Container image "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" already present on machine [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Created] Created container nano [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Started] Started container nano [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulling] Pulling image "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" Still waiting to schedule task ‘osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt’ is offline [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulled] Successfully pulled image "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" in 3m53.3267045s [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Created] Created container jnlp [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Started] Started container jnlp Agent osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt is provisioned from template osdk-gpetit_tests_test-long-params_42-72rjc-0w152 --- apiVersion: "v1" kind: "Pod" metadata: annotations: buildUrl: "http://jenkins.jenkins.svc.cluster.local:80/job/osdk-gpetit/job/tests/job/test-long-params/42/" runUrl: "job/osdk-gpetit/job/tests/job/test-long-params/42/" labels: jenkins: "slave" jenkins/label-digest: "b28a981d7451217ad56f21ba75087f377518df8d" jenkins/label: "osdk-gpetit_tests_test-long-params_42-72rjc" name: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "nano" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - env: - name: "JENKINS_SECRET" value: "********" - name: "JENKINS_TUNNEL" value: "jenkins-agent.jenkins.svc.cluster.local:50000" - name: "JENKINS_AGENT_NAME" value: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" - name: "JENKINS_NAME" value: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" - name: "JENKINS_AGENT_WORKDIR" value: "/home/jenkins/agent" - name: "JENKINS_URL" value: "http://jenkins.jenkins.svc.cluster.local:80/" image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" restartPolicy: "Never" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" Running on osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt in /home/jenkins/agent/workspace/osdk-gpetit/tests/test-long-params [Pipeline] { [Pipeline] stage [Pipeline] { (Test) [Pipeline] script [Pipeline] { [Pipeline] container [Pipeline] { [Pipeline] powershell {code} It seems like the *path* word in the param is interpreted on the windows containers and end up messing up the containers. I could not find any log helping, but I'll be happy to provide any other additional detail necessary. |
New:
*Given:*
* Jenkins 2.319.2 * kubernetes-plugin 1.31.3 * a Windows (ltsc2019) kubernetes cluster *When:* # Setup a pipeline with two containers (jnlp + windowsservercore) # Add a parameter of type *text* # Have the pipeline execute a simple powershell command on the non-jnlp container (ex. *pwd*) # Run the pipeline with the text parameter set to: {code:java} . path x{code} _n.b. the '.' is not important to reproduce, but the newline after it is_ *Expectations:* - The pipeline should execute the command *Observations:* - The pipeline hangs infinitely on the powershell command *Additional details:* Here is a sample pipeline that reproduces the issue {code:java} pipeline { agent { kubernetes { yaml '''\ --- apiVersion: "v1" kind: "Pod" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "nano" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" ''' } } parameters { text(name: 'myparam', defaultValue: "\npath x", description: 'myparam') } stages { stage('Test') { steps { script { container('nano') { powershell "pwd" } } } } } } {code} Sample output: {code:java} [Pipeline] Start of Pipeline [Pipeline] podTemplate [Pipeline] { [Pipeline] node Created Pod: kubernetes jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Scheduled] Successfully assigned jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt to canolsk8s01j [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulled] Container image "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" already present on machine [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Created] Created container nano [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Started] Started container nano [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulling] Pulling image "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" Still waiting to schedule task ‘osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt’ is offline [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulled] Successfully pulled image "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" in 3m53.3267045s [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Created] Created container jnlp [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Started] Started container jnlp Agent osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt is provisioned from template osdk-gpetit_tests_test-long-params_42-72rjc-0w152 --- apiVersion: "v1" kind: "Pod" metadata: annotations: buildUrl: "http://jenkins.jenkins.svc.cluster.local:80/job/osdk-gpetit/job/tests/job/test-long-params/42/" runUrl: "job/osdk-gpetit/job/tests/job/test-long-params/42/" labels: jenkins: "slave" jenkins/label-digest: "b28a981d7451217ad56f21ba75087f377518df8d" jenkins/label: "osdk-gpetit_tests_test-long-params_42-72rjc" name: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "nano" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - env: - name: "JENKINS_SECRET" value: "********" - name: "JENKINS_TUNNEL" value: "jenkins-agent.jenkins.svc.cluster.local:50000" - name: "JENKINS_AGENT_NAME" value: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" - name: "JENKINS_NAME" value: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" - name: "JENKINS_AGENT_WORKDIR" value: "/home/jenkins/agent" - name: "JENKINS_URL" value: "http://jenkins.jenkins.svc.cluster.local:80/" image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" restartPolicy: "Never" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" Running on osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt in /home/jenkins/agent/workspace/osdk-gpetit/tests/test-long-params [Pipeline] { [Pipeline] stage [Pipeline] { (Test) [Pipeline] script [Pipeline] { [Pipeline] container [Pipeline] { [Pipeline] powershell {code} It seems like the *path* word in the param is interpreted on the windows containers and end up messing up the containers. I could not find any log helping, but I'll be happy to provide any other additional detail necessary. |
Description |
Original:
*Given:*
* Jenkins 2.319.2 * kubernetes-plugin 1.31.3 * a Windows (ltsc2019) kubernetes cluster *When:* # Setup a pipeline with two containers (jnlp + windowsservercore) # Add a parameter of type *text* # Have the pipeline execute a simple powershell command on the non-jnlp container (ex. *pwd*) # Run the pipeline with the text parameter set to: {code:java} . path x{code} _n.b. the '.' is not important to reproduce, but the newline after it is_ *Expectations:* - The pipeline should execute the command *Observations:* - The pipeline hangs infinitely on the powershell command *Additional details:* Here is a sample pipeline that reproduces the issue {code:java} pipeline { agent { kubernetes { yaml '''\ --- apiVersion: "v1" kind: "Pod" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "nano" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" ''' } } parameters { text(name: 'myparam', defaultValue: "\npath x", description: 'myparam') } stages { stage('Test') { steps { script { container('nano') { powershell "pwd" } } } } } } {code} Sample output: {code:java} [Pipeline] Start of Pipeline [Pipeline] podTemplate [Pipeline] { [Pipeline] node Created Pod: kubernetes jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Scheduled] Successfully assigned jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt to canolsk8s01j [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulled] Container image "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" already present on machine [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Created] Created container nano [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Started] Started container nano [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulling] Pulling image "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" Still waiting to schedule task ‘osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt’ is offline [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Pulled] Successfully pulled image "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" in 3m53.3267045s [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Created] Created container jnlp [Normal][jenkins/osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt][Started] Started container jnlp Agent osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt is provisioned from template osdk-gpetit_tests_test-long-params_42-72rjc-0w152 --- apiVersion: "v1" kind: "Pod" metadata: annotations: buildUrl: "http://jenkins.jenkins.svc.cluster.local:80/job/osdk-gpetit/job/tests/job/test-long-params/42/" runUrl: "job/osdk-gpetit/job/tests/job/test-long-params/42/" labels: jenkins: "slave" jenkins/label-digest: "b28a981d7451217ad56f21ba75087f377518df8d" jenkins/label: "osdk-gpetit_tests_test-long-params_42-72rjc" name: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "nano" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - env: - name: "JENKINS_SECRET" value: "********" - name: "JENKINS_TUNNEL" value: "jenkins-agent.jenkins.svc.cluster.local:50000" - name: "JENKINS_AGENT_NAME" value: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" - name: "JENKINS_NAME" value: "osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt" - name: "JENKINS_AGENT_WORKDIR" value: "/home/jenkins/agent" - name: "JENKINS_URL" value: "http://jenkins.jenkins.svc.cluster.local:80/" image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" restartPolicy: "Never" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" Running on osdk-gpetit-tests-test-long-params-42-72rjc-0w152-kx4nt in /home/jenkins/agent/workspace/osdk-gpetit/tests/test-long-params [Pipeline] { [Pipeline] stage [Pipeline] { (Test) [Pipeline] script [Pipeline] { [Pipeline] container [Pipeline] { [Pipeline] powershell {code} It seems like the *path* word in the param is interpreted on the windows containers and end up messing up the containers. I could not find any log helping, but I'll be happy to provide any other additional detail necessary. |
New:
*Given:*
* Jenkins 2.319.2 * kubernetes-plugin 1.31.3 * a Windows (ltsc2019) kubernetes cluster *When:* # Setup a pipeline with two containers (jnlp + windowsservercore) # Add a parameter of type *text* # Have the pipeline execute a simple powershell command on the non-jnlp container (ex. *pwd*) # Run the pipeline with the text parameter set to: {code:java} . path x{code} _n.b. the '.' is not important to reproduce, but the newline after it is_ *Expectations:* - The pipeline should execute the command *Observations:* - The pipeline hangs infinitely on the powershell command *Additional details:* Here is a sample pipeline that reproduces the issue {code:java} pipeline { agent { kubernetes { yaml '''\ --- apiVersion: "v1" kind: "Pod" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "windowsservercore" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" ''' } } parameters { text(name: 'myparam', defaultValue: "\npath x", description: 'myparam') } stages { stage('Test') { steps { script { container('windowsservercore') { powershell "pwd" } } } } } } {code} Sample output: {code:java} [Pipeline] Start of Pipeline [Pipeline] podTemplate [Pipeline] { [Pipeline] node Created Pod: kubernetes jenkins/osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc [Normal][jenkins/osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc][Scheduled] Successfully assigned jenkins/osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc to canolsk8s01j [Normal][jenkins/osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc][Pulled] Container image "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" already present on machine [Normal][jenkins/osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc][Created] Created container windowsservercore [Normal][jenkins/osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc][Started] Started container windowsservercore [Normal][jenkins/osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc][Pulled] Container image "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" already present on machine [Normal][jenkins/osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc][Created] Created container jnlp [Normal][jenkins/osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc][Started] Started container jnlp Still waiting to schedule task ‘osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc’ is offline Agent osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc is provisioned from template osdk-gpetit_tests_test-long-params_43-n3gmp-qfqq1 --- apiVersion: "v1" kind: "Pod" metadata: annotations: buildUrl: "http://jenkins.jenkins.svc.cluster.local:80/job/osdk-gpetit/job/tests/job/test-long-params/43/" runUrl: "job/osdk-gpetit/job/tests/job/test-long-params/43/" labels: jenkins: "slave" jenkins/label-digest: "009d92f111e8a72c2c59471c07aa207cb7b8b04d" jenkins/label: "osdk-gpetit_tests_test-long-params_43-n3gmp" name: "osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc" spec: containers: - args: - "Start-Sleep" - "999999" command: - "powershell" image: "mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019" name: "windowsservercore" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" - env: - name: "JENKINS_SECRET" value: "********" - name: "JENKINS_TUNNEL" value: "jenkins-agent.jenkins.svc.cluster.local:50000" - name: "JENKINS_AGENT_NAME" value: "osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc" - name: "JENKINS_NAME" value: "osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc" - name: "JENKINS_AGENT_WORKDIR" value: "/home/jenkins/agent" - name: "JENKINS_URL" value: "http://jenkins.jenkins.svc.cluster.local:80/" image: "jenkins/inbound-agent:jdk11-windowsservercore-ltsc2019" name: "jnlp" resources: requests: memory: "1024Mi" cpu: "250m" volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" nodeSelector: kubernetes.io/os: "windows" restartPolicy: "Never" tolerations: - effect: "NoSchedule" key: "OS" operator: "Equal" value: "Windows" volumes: - emptyDir: medium: "" name: "workspace-volume" Running on osdk-gpetit-tests-test-long-params-43-n3gmp-qfqq1-274bc in /home/jenkins/agent/workspace/osdk-gpetit/tests/test-long-params [Pipeline] { [Pipeline] stage [Pipeline] { (Test) [Pipeline] script [Pipeline] { [Pipeline] container [Pipeline] { [Pipeline] powershell {code} It seems like the *path* word in the param is interpreted on the windows containers and end up messing up the containers. I could not find any log helping, but I'll be happy to provide any other additional detail necessary. |