[JIRA] [core] (JENKINS-29554) job stuck when executing shell script

29 views
Skip to first unread message

hotterd@gmail.com (JIRA)

unread,
Jul 22, 2015, 4:28:04 AM7/22/15
to jenkinsc...@googlegroups.com
Gan Dong created an issue
 
Jenkins / Bug JENKINS-29554
job stuck when executing shell script
Issue Type: Bug Bug
Assignee: Unassigned
Attachments: thread_dump.txt
Components: core
Created: 22/Jul/15 8:27 AM
Environment: windows 7
Priority: Critical Critical
Reporter: Gan Dong

Hi,

My job gets stuck forever when executing a trivial shell script which simply sets up the execution env:

[workspace] $ sh -xe "D:\Tomcat 5.5\temp\hudson8794539940981712077.sh"

Then it hangs there and never returns. When I logon to the host and run above command manually, there is no issue and the shell commands get executed and displayed correctly.

Couldn't find any clue in the threaddump:

"Executor #0 for master : executing testlogic-build-ant192 #268" Id=53 Group=main RUNNABLE (in native)
at java.lang.ProcessImpl.waitForInterruptibly(Native Method)
at java.lang.ProcessImpl.waitFor(Unknown Source)
at hudson.Proc$LocalProc.join(Proc.java:319)
at hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:137)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:97)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
at hudson.model.Build$BuildExecution.build(Build.java:203)
at hudson.model.Build$BuildExecution.doRun(Build.java:160)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:536)
at hudson.model.Run.execute(Run.java:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:374)

For a full threaddump, please see the attachement.
Could anyone suggest what issue this could be?

Thanks in advance,
Gan Dong

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

dbeck@cloudbees.com (JIRA)

unread,
Jul 22, 2015, 7:47:01 AM7/22/15
to jenkinsc...@googlegroups.com
Daniel Beck commented on Bug JENKINS-29554
 
Re: job stuck when executing shell script

Could be an issue with the specific commands you're executing in the script. Try finding out which it is.

hotterd@gmail.com (JIRA)

unread,
Jul 22, 2015, 10:33:01 PM7/22/15
to jenkinsc...@googlegroups.com
Gan Dong commented on Bug JENKINS-29554

Hi Daniel,

Thanks for the response.

The issue persists if I replaced the script with merely one echo line:

bash-3.2$ cat setenv.sh

    1. simple echo
      echo "This message should be displayed.."

It still hangs there and output nothing.

It runs fine when I log on to the host and run the same command.

D:\testlogic-jenkins\jobs\testlogic-build-ant192\workspace>cat setenv.sh

    1. simple echo
      echo "This message should be displayed.."

D:\testlogic-jenkins\jobs\testlogic-build-ant192\workspace>bash -xe setenv.sh
+ echo This message should be displayed..
This message should be displayed..

D:\testlogic-jenkins\jobs\testlogic-build-ant192\workspace>sh -ex setenv.sh
+ echo This message should be displayed..
This message should be displayed..

Note I have configured my job with following line to invoke the script:

bash -ex setenv.sh

It should be able to print the command it executes, but it prints nothing - seems simply hangs before entering the script.

Thanks,
Gan

hotterd@gmail.com (JIRA)

unread,
Jul 22, 2015, 10:35:01 PM7/22/15
to jenkinsc...@googlegroups.com
Gan Dong edited a comment on Bug JENKINS-29554
Hi Daniel,

Thanks for the response.

The issue persists if I replaced the script with merely one echo line:

{quote} bash-3.2$ cat setenv.sh 
## simple echo

echo "This message should be displayed.."


It still hangs there and output nothing.

It runs fine when I log on to the host and run the same command.

D:\testlogic-jenkins\jobs\testlogic-build-ant192\workspace>cat setenv.sh
## simple echo

echo "This message should be displayed.."

D:\testlogic-jenkins\jobs\testlogic-build-ant192\workspace>bash -xe setenv.sh
+ echo This message should be displayed..
This message should be displayed..

D:\testlogic-jenkins\jobs\testlogic-build-ant192\workspace>sh -ex setenv.sh
+ echo This message should be displayed..
This message should be displayed.. {quote}



Note I have configured my job with following line to invoke the script:

bash -ex setenv.sh

It should be able to print the command it executes, but it prints nothing - seems simply hangs before entering the script.


Thanks,
Gan

hotterd@gmail.com (JIRA)

unread,
Jul 22, 2015, 10:38:01 PM7/22/15
to jenkinsc...@googlegroups.com
Gan Dong edited a comment on Bug JENKINS-29554
Hi Daniel,

Thanks for the response.

The issue persists if I replaced the script with merely one echo line:

{quote}
bash-3.2$ cat setenv.sh 
## simple
 echo

echo
 "This message should be displayed.." {quote}


It
But it  still hangs there and output nothing.

It runs fine when I log on to the host and run the same command.  

{quote}
D:\testlogic-jenkins\jobs\testlogic-build-ant192\workspace>cat setenv.sh
\ # \ # simple echo

echo "This message should be displayed.."

D:\testlogic-jenkins\jobs\testlogic-build-ant192\workspace>bash -xe setenv.sh
+ echo This message should be displayed..
This message should be displayed..

D:\testlogic-jenkins\jobs\testlogic-build-ant192\workspace>sh -ex setenv.sh
+ echo This message should be displayed..
This message should be displayed..{quote}



Note I have configured my job with following line to invoke the script:

{quote} bash -ex setenv.sh {quote}

It should be able to print the command it executes, but it prints nothing - seems simply hangs before entering the script.


Thanks,
Gan

san@san.spb.ru (JIRA)

unread,
Feb 24, 2016, 5:29:02 AM2/24/16
to jenkinsc...@googlegroups.com

Looks like I'm facing the same issue, but I can provide more details. In my case shell script hangs in the middle. So I have one shell script, which calls another shell script

parent script has this line:
./tools/create_report.sh "Success" "$TEMP_FOLDER/report_template_1.html"

child script (create_report.sh) has "#!/bin/bash -x" annotation and following lines in the middle

JENKINS_LINKS="JENKINS_LINKS -

> $JENKINS_LINKS <! -"
DATE=`date "+%H:%M %d %b %Y"`
oneLineMessage=`echo $message | sed "s|\n|<br>|g" | sed "s|<br><br>|<br>|g"`

Console output shows:
+ JENKINS_LINKS='JENKINS_LINKS -

> <a href="<some URL>">Console output</a> <! -'
++ date '+%H:%M %d %b %Y'

and that's it - script hangs forever after date

This is reproducible very rarely.

prashanthh727@gmail.com (JIRA)

unread,
Jul 17, 2019, 10:57:02 AM7/17/19
to jenkinsc...@googlegroups.com

I'm facing the same issue.

My pipeline script is very simple, I'm running this pipeline is a Unix slave(Configured via SSH).

pipeline{
agent

{label 'unix-slave'}

stages{
stage("test"){
steps{
script

{ sh "java -version" }

}
}
}

This pipeline gets stuck at sh command and fails with the following error,

""process apparently never started in /home/user/jenkins/workspace/Test@tmp/durable-e039cc5c
(running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)""

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)
Reply all
Reply to author
Forward
0 new messages