[JIRA] (JENKINS-58975) Executing shell in a container with a custom workingDir times out

0 views
Skip to first unread message

hypnoce@donarproject.org (JIRA)

unread,
Aug 17, 2019, 2:42:03 PM8/17/19
to jenkinsc...@googlegroups.com
Francis JAC created an issue
 
Jenkins / Bug JENKINS-58975
Executing shell in a container with a custom workingDir times out
Issue Type: Bug Bug
Assignee: Unassigned
Components: kubernetes-plugin
Created: 2019-08-17 18:41
Environment: Kubernetes 1.15, Jenkins 2.189, kubernetes-plugin 1.18.1
Priority: Minor Minor
Reporter: Francis JAC

Hi,

when using a custom working dir for a specific container, the workspace is mounted under this workingdir.

Unfortunately, when running a shell script within this container, it runs by default using the workspace used for the POD (home/jenkins/agent/workspace)

launching [nohup, sh, -c, (pid=$$$$; { while [ \( -d /proc/$$pid -o \! -d /proc/$$$$ \) -a -d '/home/jenkins/agent/workspace/myjob_jenkins_agent@tmp/durable-f6c3edf2' -a \! -f '/home/jenkins/agent/workspace/myjob_jenkins_agent@tmp/durable-f6c3edf2/jenkins-result.txt' ]; do touch '/home/jenkins/agent/workspace/myjob_jenkins_agent@tmp/durable-f6c3edf2/jenkins-log.txt'; sleep 3; done } & jsc=durable-88384c7a8cc3f3d75dd32c12a311af37; JENKINS_SERVER_COOKIE=$$jsc 'sh' -xe '/home/jenkins/agent/workspace/myjob_jenkins_agent@tmp/durable-f6c3edf2/script.sh' > '/home/jenkins/agent/workspace/myjob_jenkins_agent@tmp/durable-f6c3edf2/jenkins-log.txt' 2>&1; echo $$? > '/home/jenkins/agent/workspace/myjob_jenkins_agent@tmp/durable-f6c3edf2/jenkins-result.txt.tmp'; mv '/home/jenkins/agent/workspace/myjob_jenkins_agent@tmp/durable-f6c3edf2/jenkins-result.txt.tmp' '/home/jenkins/agent/workspace/myjob_jenkins_agent@tmp/durable-f6c3edf2/jenkins-result.txt'; wait) >&- 2>&- &]

The effect is that the shell script stalls the build and then times out.

Use case to reproduce : https://github.com/hypnoce/kubernetes-plugin/commit/5382f88cfc7f8c1a65b4397b903d7f813cff5371

There are several options to fix this.

What do you think ?

Thanks

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

narayanan.singaram@gmail.com (JIRA)

unread,
Oct 3, 2019, 12:09:02 AM10/3/19
to jenkinsc...@googlegroups.com

vincent@latombe.net (JIRA)

unread,
Oct 3, 2019, 3:43:09 AM10/3/19
to jenkinsc...@googlegroups.com
Vincent Latombe started work on Bug JENKINS-58975
 
Change By: Vincent Latombe
Status: Open In Progress

vincent@latombe.net (JIRA)

unread,
Oct 3, 2019, 3:43:10 AM10/3/19
to jenkinsc...@googlegroups.com

vincent@latombe.net (JIRA)

unread,
Oct 3, 2019, 3:43:10 AM10/3/19
to jenkinsc...@googlegroups.com

aburdajewicz@cloudbees.com (JIRA)

unread,
Dec 18, 2019, 10:07:03 PM12/18/19
to jenkinsc...@googlegroups.com
Allan BURDAJEWICZ commented on Bug JENKINS-58975
 
Re: Executing shell in a container with a custom workingDir times out

To make this work, you must change the working directory of all containers in the pod, including the jnlp container.

I think that this JIRA is actually an improvement ? to make the container block aware of the container context (reflecting working dir and *workspace*) that allows to use different workingDir in the containers of kubernetes agent pods.

zerkms@zerkms.ru (JIRA)

unread,
Dec 19, 2019, 6:21:02 PM12/19/19
to jenkinsc...@googlegroups.com

hypnoce@donarproject.org (JIRA)

unread,
Mar 10, 2020, 9:01:03 AM3/10/20
to jenkinsc...@googlegroups.com
Francis JAC edited a comment on Bug JENKINS-58975
his This Jira is a regression. It used to work on the 1.17.3 version.
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

hypnoce@donarproject.org (JIRA)

unread,
Mar 10, 2020, 9:01:06 AM3/10/20
to jenkinsc...@googlegroups.com

his Jira is a regression. It used to work on the 1.17.3 version.

hypnoce@donarproject.org (JIRA)

unread,
Mar 10, 2020, 4:09:09 PM3/10/20
to jenkinsc...@googlegroups.com

hypnoce@donarproject.org (JIRA)

unread,
Mar 10, 2020, 4:09:10 PM3/10/20
to jenkinsc...@googlegroups.com
Francis JAC updated an issue
 
Change By: Francis JAC
Comment: This Jira is a regression. It used to work on the 1.17.3 version.
Reply all
Reply to author
Forward
0 new messages