It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

What exit code is Bamboo expecting from a command to highlight text red in the log?

Deleted user Jul 20, 2014

I have a series of final tasks running in a job because I want them all to execute regardless of pass/fail result. One thing I would like to be able to do is easily differentiate failed results from a command task. What return status from the application is Bamboo expecting to flag the result this way in the log? I've seen it previously for failed results, but have yet to decipher the return status I need to provide to consistently do so.

4 answers

1 accepted

2 votes
Answer accepted
Deleted user Jul 20, 2014

The answer to this question is provided above. All output for which this behavior is desired must be directed to stderr. It will then be marked up in red and output in the error log upon task failure.

0 votes
Daniel Wester Community Leader Jul 20, 2014

The last exist status must be >0 in order for Bamboo to flag the task as failing.

Deleted user Jul 20, 2014


The task is returning failing successfully, but I'd like it to also flag the failure in the log component of the job in red. A return status of > 1 does not accomplish this. I may need to return an exception with the failure status to accomplish this result.

Deleted user Jul 20, 2014

I assume that error text must need to be redirected to stderr to flag it. I'm going to test this assumption and see if that is correct.

When using bash script tasks, I always put:

set -o errexit

at the top.

And for "echoing" something to stderr, I have always been using echo "..." 1>&2 for that purpose.

Example: Checking that a variable value was overriden to enforce a custom build run:

set -o errexit


if [ ! -z "$ARTIFACT_VERSION" -a "$ARTIFACT_VERSION" != " " ]; then

    echo "Provided artifact version: $ARTIFACT_VERSION"
    exit 0
    echo "Artifact version is missing" 1>&2
    echo "Run a customized Build and override the build variable 'webforms.blueprint.version'." 1>&2
    exit 1 

exit 0

If a user started a build without setting a custom variable, so he will get:

I hope it will help you.

0 votes
Deleted user Jul 20, 2014

This is exactly what I ended up doing an reaffirm that redirecting to stderr is the answer. The application I initially asked the question about happened to a be a .NET application, so added System.Console.Error.WriteLine("<text>") for the messaging in the log that I wanted redirected to stderr. Worked perfectly. Thanks for your response.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bamboo

Cannot save a repository using Chrome v83 and other Chromium based browsers such as Edge

Hello Bamboo Community, I'm Jey from Bamboo Support team. If you have upgraded your Chrome browser to version 83 recently, it is observed that the save operation just spins and never completes w...

427 views 2 5
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you