[JIRA] (JENKINS-49773) Pipeline plugin sh script returned exit code -2 from time to time

3 views
Skip to first unread message

279245671@qq.com (JIRA)

unread,
Feb 27, 2018, 9:48:02 AM2/27/18
to jenkinsc...@googlegroups.com
yang guilei created an issue
 
Jenkins / Bug JENKINS-49773
Pipeline plugin sh script returned exit code -2 from time to time
Issue Type: Bug Bug
Assignee: Carlos Sanchez
Components: kubernetes-plugin
Created: 2018-02-27 14:47
Priority: Critical Critical
Reporter: yang guilei

I am using kubernetes plugin to build my ci environment on a kubernetes cluster. There is a pipeline block like below:

stage ('Compile client & go src') {
dir('./src/main/docker/go/src/portal') {
sh "pwd; \
cd /home/jenkins/workspace/portal_v3.0/src/main/docker/go/src/portal/; \
export GOPATH=${env.WORKSPACE}/src/main/docker/go; \
gvt restore || true"

}

}

but the sh block fails from time to time. In the console output there are even incomplete log like this:
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Compile client & go src)
[Pipeline] dir
Running in /home/jenkins/workspace/portal_v3.0/src/main/docker/go/src/portal
[Pipeline] {
[Pipeline] sh
[portal] Running shell script
Executing shell script inside container [maven] of pod [kubernetes-jcl72]
Executing command: sh -c echo $$ > '/home/jenkins/workspace/portal_v3.0/src/main/docker/go/src/portal@tmp/durable-ed3533f2/pid'; jsc=durable-d2043139f4d662aef846252c818e1165; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/portal_v3.0/src/main/docker/go/src/portal@tmp/durable-ed3533f2/script.sh' > '/home/jenkins/workspace/portal_v3.0/src/main/docker/go/src/portal@tmp/durable-ed3533f2/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/portal_v3.0/src/main/docker/go/src/portal@tmp/durable-ed3533f2/jenkins-result.txt'
cd "/home/jenkins/workspace/portal_v3.0"
sh -c echo $$ > '/home/jenkins/workspace/portal_v3.0/src/main/docker/go/src/portal@tmp/durable-ed3533f2/pid'; jsc=durable-d2043139f4d662aef846252c818e1165; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/portal_v3.0/src/main/docker/go/src/portal@tmp/durable-ed3533f2/script.sh' > '/home/jenkins/workspace/portal_v3.0/src/main/docker/go/src/portal@tmp/durable-ed3533f2/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/wo[?1034hsh-4.2# [Pipeline] }
It the last line, the word "workspace" was truncated to "wo".

I tried 5 times. it fails 2 times and success 3 times.
 

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

279245671@qq.com (JIRA)

unread,
Feb 27, 2018, 9:50:02 AM2/27/18
to jenkinsc...@googlegroups.com
yang guilei updated an issue
Change By: yang guilei
I am using kubernetes plugin to build my ci environment on a kubernetes cluster. There is a pipeline block like below:

stage ('Compile client & go src') \{
dir('./src/main/docker/go/src/portal') \{
sh "pwd; \
cd /home/jenkins/workspace/portal_v3.0/src/main/docker/go/src/portal/; \
export GOPATH=$\{env.WORKSPACE}/src/main/docker/go; \
gvt restore || true"

}

}

but the sh block fails from time to time. In the console output there are even incomplete log like this:
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] \{ (Compile client & go src)
[Pipeline] dir
Running in /home/jenkins/workspace/portal_v3.0/src/main/docker/go/src/portal
[Pipeline] \{
[Pipeline] sh
[portal] Running shell script
Executing shell script inside container [maven] of pod [kubernetes-jcl72]
Executing command: sh -c echo $$ > '/home/jenkins/workspace/portal_v3.0/src/main/docker/go/src/portal@tmp/durable-ed3533f2/pid'; jsc=durable-d2043139f4d662aef846252c818e1165; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/portal_v3.0/src/main/docker/go/src/portal@tmp/durable-ed3533f2/script.sh' > '/home/jenkins/workspace/portal_v3.0/src/main/docker/go/src/portal@tmp/durable-ed3533f2/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/portal_v3.0/src/main/docker/go/src/portal@tmp/durable-ed3533f2/jenkins-result.txt'
cd "/home/jenkins/workspace/portal_v3.0"
sh -c echo $$ > '/home/jenkins/workspace/portal_v3.0/src/main/docker/go/src/portal@tmp/durable-ed3533f2/pid'; jsc=durable-d2043139f4d662aef846252c818e1165; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/portal_v3.0/src/main/docker/go/src/portal@tmp/durable-ed3533f2/script.sh' > '/home/jenkins/workspace/portal_v3.0/src/main/docker/go/src/portal@tmp/durable-ed3533f2/jenkins-log.txt' 2>&1; echo $? > ' * /home/jenkins/wo * [?1034hsh-4.2# [Pipeline] }

 

*
It the last line, the word "workspace" was truncated to "wo". *

I tried 5 times. it fails 2 times and success 3 times.

I do not think it is a dupe of
  JENKINS-46545 because I have many time success


 

279245671@qq.com (JIRA)

unread,
Feb 27, 2018, 8:56:02 PM2/27/18
to jenkinsc...@googlegroups.com
yang guilei updated an issue
Change By: yang guilei
Environment: kubernetes1.8.4     jenkins 2.32.3(fabric8/jenkins-docker)      jenkins kubernetes plugin 1.3.1

jenkins-ci@carlossanchez.eu (JIRA)

unread,
Apr 1, 2018, 3:14:03 PM4/1/18
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Jul 16, 2019, 3:43:52 PM7/16/19
to jenkinsc...@googlegroups.com
Jesse Glick assigned an issue to Unassigned
 
Change By: Jesse Glick
Assignee: Carlos Sanchez
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)
Reply all
Reply to author
Forward
0 new messages