Problem with Bamboo script task hanging indefinitely at "exit 0"

I have a "script" task that completes successfully, but Bamboo doesn't seem to recognize that it's complete. The task itself is an inline script that does some simple setup (creates directories and symlinks) and then as the last line it executes another script with `/bin/sh -x build.sh`. This script runs to completion, with the last line being `exit 0` to ensure a successful exit code. In the Bamboo job log, I see the last line of the log is `+ exit 0` indicating it successfully reaches that point, but the Bamboo job never moves on from there to the final tasks of the job.

The agent is running on OS X. If I monitor the agent running the job with `ps` to check on the execution of the task, I see the temporary script created by Bamboo as well as the `build.sh` script running until they complete, then the processes disappear as expected. Bamboo itself doesn't seem to recognize that it's done, though.

The `build.sh` script does quite a lot of things, and it's possible that it's trampling on the bamboo agent process somehow. What might cause Bamboo to behave this way? What can I do to troubleshoot this?

1 answer

1 accepted

Turns out this was caused by some dangling child processes that weren't getting terminated properly. Finding these and ensuring they were killed by the end of the script resolved the issue.

Andrew could you clarify what you mean by "dangling child processes"? I'm experiencing this same issue, but all I do in my script is start up a web server. I don't know what child processes I would be needing to kill. Thanks!

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,321 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you