Buildkite dynamic pipeline "exit status 1" in CI
A dynamic pipeline runs a script that prints steps and pipes them to pipeline upload. If that script exits 1, the upload step fails and the build has no further steps.
What this error means
The initial step fails with "exit status 1" from the generator command, often before any "Uploading pipeline" line appears.
buildkite
$ .buildkite/generate.sh | buildkite-agent pipeline upload
./generate.sh: line 12: jq: command not found
error: exit status 1Common causes
A missing tool in the generator
The script depends on a tool (jq, python, yq) that is not installed on the agent, so it exits before producing valid steps.
The generator errors on bad input
A missing env var or an unexpected repository state makes the generation script fail, and with pipefail that failure surfaces as exit status 1.
How to fix it
Install prerequisites and run the generator standalone
- Read the first error line from the generator, not the final "exit status 1".
- Install the missing tool on the agent or in a setup step.
- Run the generator on its own to confirm it emits valid YAML before piping to upload.
Terminal
.buildkite/generate.sh > /tmp/pipeline.yml
buildkite-agent pipeline upload /tmp/pipeline.ymlFail fast with strict bash
Use strict mode so the real failing line is obvious and the generator does not upload partial output.
.buildkite/generate.sh
#!/usr/bin/env bash
set -euo pipefailHow to prevent it
- Bake generator tool dependencies into the agent image.
- Run the generator standalone in tests so failures surface early.
- Use
set -euo pipefailin upload scripts.
Related guides
Buildkite "Failed to upload pipeline" in CIFix Buildkite "Failed to upload pipeline" in CI - the buildkite-agent pipeline upload step rejected the pipel…
Buildkite "command exited with status 1" in CIFix Buildkite "The command exited with status 1" in CI - a step command returned a non-zero exit code, so Bui…
Buildkite "meta-data get: key not found" in CIFix Buildkite "buildkite-agent meta-data get: key not found" in CI - a step read a meta-data key that no earl…