dbt "Done. ... N failures" build fails CI in CI
dbt build ran models, tests, seeds, and snapshots together and at least one node errored or a test failed. dbt prints a summary line with the counts and exits 1, which fails the CI job.
What this error means
dbt build ends with "Done. PASS=... WARN=... ERROR=... SKIP=... TOTAL=..." where ERROR or FAIL is non-zero, and the process exits with code 1.
dbt
Done. PASS=41 WARN=0 ERROR=2 SKIP=3 TOTAL=46
Completed with 2 errors and 0 warnings:
Database Error in model orders ...
Failure in test unique_customers_id ...Common causes
A model or test in the selection failed
Any errored model or failed test makes dbt exit 1, and dependent nodes are skipped, inflating the SKIP count.
A failure early in the graph skipped many downstreams
One upstream error cascades: dbt skips everything that depends on it, so the summary shows both ERROR and SKIP counts.
How to fix it
Read the per-node summary and fix the first error
- Scroll to the "Completed with N errors" block listing each failure.
- Fix the earliest upstream error first, since it skips downstreams.
- Re-run the failed nodes with
dbt build --select result:error+.
Terminal
dbt build --select result:error+ --state ./targetSeparate blocking from advisory tests
Set advisory checks to warn so only genuine errors fail the build, then fix the real errors.
How to prevent it
- Run
dbt buildin CI so models and tests gate every change. - Fix the earliest upstream failure first to clear cascaded skips.
- Use test severity to distinguish blocking errors from warnings.
Related guides
dbt test failure (unique / not_null) fails CI with exit 1Fix a dbt data test failure (unique, not_null) in CI - the model data violated a test assertion, so dbt exits…
dbt "Database Error in model" SQL error in CIFix dbt "Database Error in model X" in CI - the compiled SQL ran against the warehouse and the database rejec…
dbt "Runtime Error: relation does not exist" in CIFix dbt "Database Error ... relation X does not exist" in CI - a model or test queries a table or view that w…