debugging-dbt-errors

Solid

Debugs and fixes dbt errors systematically. Use when working with dbt errors for: (1) Task mentions "fix", "error", "broken", "failing", "debug", "wrong", or "not working" (2) Compilation Error, Database Error, or test failures occur (3) Model produces incorrect output or unexpected results (4) Need to troubleshoot why a dbt command failed Reads full error, checks upstream first, runs dbt build (not just compile) to verify fix.

Code & Development 113 stars 8 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 85/100

Stars 20%
68
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# dbt Troubleshooting **Read the full error. Check upstream first. ALWAYS run `dbt build` after fixing.** ## Critical Rules 1. **ALWAYS run `dbt build` after fixing** - compile is NOT enough to verify the fix 2. **If fix fails 3+ times**, stop and reassess your entire approach 3. **Verify data after build** - build passing doesn't mean output is correct ## Workflow ### 1. Get the Full Error ```bash dbt compile --select <model_name> # or dbt build --select <model_name> ``` Read the COMPLETE error message. Note the file, line number, and specific error. ### 2. Inspect Actual Data (For Data Issues) **Before fixing "wrong output" or "incorrect results", query the actual data:** ```bash # Preview current output dbt show --select <model_name> --limit 20 # Check specific values with inline query dbt show --inline "select * from {{ ref('model_name') }} where <condition>" --limit 10 # Compare with expected - look for patterns dbt show --inline "select column, count(*) from {{ ref('model_name') }} group by 1 order by 2 desc" --limit 10 ``` **Understand what's wrong before attempting to fix it.** ### 3. Read Compiled SQL ```bash cat target/compiled/<project>/<path>/<model_name>.sql ``` See the actual SQL that will run. ### 4. Analyze Error Type | Error Type | Look For | |------------|----------| | Compilation Error | Jinja syntax, missing refs, YAML issues | | Database Error | Column not found, type mismatch, SQL syntax | | Dependency Error | Missing model, circular re...

Details

Author
AltimateAI
Repository
AltimateAI/data-engineering-skills
Created
6 months ago
Last Updated
1 weeks ago
Language
N/A
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Solid

creating-dbt-models

Creates dbt models following project conventions. Use when working with dbt models for: (1) Creating new models (any layer - discovers project's naming conventions first) (2) Task mentions "create", "build", "add", "write", "new", or "implement" with model, table, or SQL (3) Modifying existing model logic, columns, joins, or transformations (4) Implementing a model from schema.yml specs or expected output requirements Discovers project conventions before writing. Runs dbt build (not just compile) to verify.

113 Updated 1 weeks ago
AltimateAI
Code & Development Solid

debug

Debug systematically across software, data pipelines, infrastructure, and analytics. Find root cause before fixing - for bugs, test failures, CI/CD breakage, K8s/Cloud incidents, dbt/Airflow pipeline failures, schema drift, freshness violations, dashboard wrong-numbers, and performance issues. Validates at every layer; verifies with fresh evidence before claiming done.

2 Updated today
vanducng
Testing & QA Solid

testing-dbt-models

Adds schema tests and data quality validation to dbt models. Use when working with dbt tests for: (1) Adding or modifying tests in schema.yml files (2) Task mentions "test", "validate", "data quality", "unique", "not_null", or "accepted_values" (3) Ensuring data integrity - primary keys, foreign keys, relationships (4) Debugging test failures or understanding why dbt test failed Matches existing project test patterns and YAML style before adding new tests.

113 Updated 1 weeks ago
AltimateAI