Buildkite "command exited with status 1" in CI
Buildkite fails a step when its command returns any non-zero exit code. Status 1 is the generic failure code: the real reason is in the command output above this line.
What this error means
A step ends with "The command exited with status 1" and the build is marked failed. The output above shows the actual command that failed.
$ npm test
...
Tests: 1 failed, 42 passed
The command exited with status 1Common causes
The underlying command genuinely failed
A test failure, a lint error, or a build error returned exit 1, and Buildkite propagated it as a step failure.
A chained command hides which one failed
Multiple commands joined with && or a shell without pipefail can report status 1 without making the failing command obvious.
How to fix it
Read the output and reproduce locally
- Scroll to the command directly above the "status 1" line.
- Reproduce that exact command locally to see the real error.
- Fix the underlying failure, then re-run the step.
Make the failing command explicit
Split combined commands into separate step commands and enable pipefail so the exact failure is attributable.
steps:
- label: "test"
commands:
- "set -euo pipefail"
- "npm ci"
- "npm test"How to prevent it
- Keep one logical action per command so failures are attributable.
- Enable
set -euo pipefailin multi-command steps. - Surface test/lint reports as annotations for faster triage.