Diagnose why a dbt model is failing and propose a fix
When to use: A scheduled dbt run failed. You need to know what broke and why, without opening 5 UIs.
Prerequisites
- dbt Cloud account + service token — dbt Cloud → Profile → API Tokens
- Local dbt project checkout (if using CLI tools) — git clone your dbt repo
Flow
-
Find the failing runList my last 10 job runs in dbt Cloud. Show which ones failed and their error summary.✓ Copied→ Failed run IDs with timestamps
-
Drill into the failing modelFor the failed run, which model failed first? Get its details (SQL, description) and its upstream lineage.✓ Copied→ Failing model + dependency chain
-
Propose fixRun the model locally with dbt compile. Inspect the compiled SQL for the error. Propose the minimum edit to fix.✓ Copied→ Concrete SQL fix with rationale
Outcome: A validated fix for a broken model in under 15 minutes.
Pitfalls
- Cloud run failures can be environmental (connection/credentials), not code — Before editing SQL, check if the same model runs locally via
runtool — if yes, it's infra not code