Learning Objectives
By the end of this chapter, you will be able to:
- Decode logged error messages produced by
dbt run,dbt test,dbt build, anddbt compile, including stack traces from Jinja, YAML, and warehouse drivers. - Open the right artifact under
target/compiled/,target/run/, andlogs/dbt.logto reproduce a failing query directly against the warehouse. - Diagnose YAML compilation errors that block
dbt parsebefore any model executes, including indentation, tag, and reserved-key mistakes. - Tell apart dbt Core, dbt adapter, and warehouse-side errors when the same log line carries tokens from each layer.
- Develop minimal, traceable fixes that close the failing model without destabilizing upstream lineage or downstream consumers.
Executive Summary
- dbt's logged error messages always identify the layer (parser, compiler, adapter, warehouse) and the failing node; reading those tokens in order accelerates triage.
- The
target/directory holds the artifacts that turn an abstract dbt failure into a concrete SQL statement:target/compiled/for the post-Jinja query andtarget/run/for the wrapped DDL that the warehouse actually executed. - YAML compilation errors block
dbt parsebefore manifest construction; the failing line and column number are printed verbatim from the YAML parser. - A failing query rejected by the warehouse is a platform error, not a dbt error; the fix lives in SQL, schema design, or warehouse configuration, not in the Jinja or YAML surface.
- Fixes are applied to the smallest unit that closes the failure, then verified with
dbt build --select state:modified+to confirm downstream stability before merge.
Assumptions
- The reader has authored dbt models, defined sources, written tests, and shipped code through pull-request workflows.
- The reader knows the
ref()andsource()distinction, the five core materializations, and the cascade of defaults indbt_project.yml. - Examples use Snowflake as the default warehouse for SQL syntax; BigQuery, Databricks, Redshift, and Postgres variants are noted where behavior diverges.
- Region-specific dbt Cloud features are referenced by feature name only; tenant routing is out of scope.
