Skip to content
Latchkey

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

  1. Scroll to the "Completed with N errors" block listing each failure.
  2. Fix the earliest upstream error first, since it skips downstreams.
  3. Re-run the failed nodes with dbt build --select result:error+.
Terminal
dbt build --select result:error+ --state ./target

Separate 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 build in 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →