Tekton step "exited with code 1" (TaskRun failed) in CI
The step's container ran to completion but its command returned a non-zero exit code, so Tekton marks the step and the TaskRun Failed. The real error is in that step's log, not in the Tekton status.
What this error means
A TaskRun is Failed with a message like "\"step-build\" exited with code 1". Subsequent steps are skipped and the pod terminates.
"step-build" exited with code 1 (image: "golang:1.22"); for logs run: kubectl logs build-run-pod -c step-build -n ciCommon causes
The command in the step genuinely failed
A compile error, a failing test, or a linter returned exit 1. Tekton is faithfully reporting the tool's own failure.
A script error before the real work
A missing file, an unset variable under set -e, or a bad path makes the shell exit 1 before the intended command runs.
How to fix it
Read the step log
- The message prints the exact
kubectl logscommand with the step container name. - Run it to see the tool output that produced exit 1.
- Fix the underlying failure (test, build, or script).
kubectl logs build-run-pod -c step-build -n ciFetch the log with tkn
The Tekton CLI streams step logs for a TaskRun without needing the pod name.
tkn taskrun logs build-run -n ciHow to prevent it
- Reproduce the step command locally with the same image before pushing.
- Use
set -euo pipefailin step scripts so failures are explicit. - Keep step images pinned so behavior is reproducible.