Bamboo "Failing task since return code was not 0" in CI
A command or script task exited with a non-zero return code. Bamboo treats any non-zero exit as a task failure and prints "Failing task since return code of the command was N and not 0". The real error is above this line.
What this error means
The task ends with "Failing task since return code of the command was N and not 0", where N is the exit code of the underlying command.
npm run build exited with 1
Failing task since return code of the command was 1 and not 0.Common causes
The underlying command genuinely failed
The build, test, or lint command exited non-zero because of a real error, and Bamboo faithfully propagates that as a task failure.
A multi-line script where an early command fails
In an inline script, an early command exits non-zero; without careful handling the task return code reflects a failing step even if later lines run.
How to fix it
Read the command output above the failure line
- Scroll up from "Failing task since return code..." to the first real error printed by the command.
- Fix that root error (a failing test, a missing file, a compile error).
- Re-run the task once the command exits 0 locally.
Make script failures explicit
Use a strict shell so a failing early command stops the script clearly rather than masking the true failure point.
#!/bin/bash
set -euo pipefail
npm ci
npm run buildHow to prevent it
- Run the same command locally so non-zero exits surface before CI.
- Use set -e in inline scripts so the first failure is the reported one.
- Keep tasks small so a non-zero code maps to one clear cause.