Learning Objectives
By the end of this chapter, you will be able to:
- Diagnose DAG failure points using
run_results.json,dbt retry,result:error+, and the dbt Cloud step log surface, separating failed nodes from skipped downstream nodes. - Apply
dbt cloneto promote zero-copy clones between environments and to materialize a development DAG against a production state without rebuilding upstream data. - Troubleshoot integrated tool errors in dbt Cloud Jobs, CI runs, scheduler failures, and webhook-driven jobs, identifying whether the fault sits in the credential layer, the project repository, the warehouse, or the orchestration plane.
- Optimize run performance by choosing the correct incremental strategy per adapter, tuning
threads, and using model selectors to prune unnecessary work without breaking DAG correctness.
Executive Summary
- A failed dbt run is rarely about a single broken SQL file; it is about which DAG nodes failed, which nodes were skipped because their parents failed, and which nodes succeeded with a degraded contract. The
run_results.jsonartifact and theresult:error+andstate:modified+selectors are the primary instruments for that triage. dbt cloneis a metadata operation on adapters that support it (Snowflake, BigQuery, Databricks), and acreate table as selectfallback elsewhere. It is the cheapest way to stand up a development schema that mirrors production state, and it is the safest way to promote a CI build into a production schema without re-running materializations.- dbt Cloud Jobs add a second failure surface above dbt Core: scheduler queues, CI triggers tied to pull-request events, webhook signature checks, environment credentials, and step ordering. Each layer has its own log and its own retry semantics, and reading them in order is the only reliable way to identify the actual fault.
- Pipeline-level optimization is the product of three knobs: the incremental strategy per model (
append,merge,delete+insert,insert_overwrite,microbatch), the thread count per execution, and the selector syntax that narrows the DAG to the work that actually needs to run.
Assumptions
- The reader has completed Chapters 1 through 3 and is familiar with
ref(),source(), the five core materializations, thetarget/directory layout, and the four dbt error classes. - All examples use dbt 1.11 against Snowflake, BigQuery, Databricks, Redshift, or Postgres; adapter-specific behavior is called out when it diverges.
- The reader runs dbt either through dbt Core CLI in a local virtual environment or through a dbt Cloud Job with a Git-backed project; both surfaces are covered.
