Fixing YAML that won't compile
YAML compilation errors in dbt usually stem from indentation mistakes, invalid syntax, or misconfigured keys in .yml files, and they surface as parsing errors before dbt even reaches SQL compilation. Because YAML is whitespace-sensitive and dbt enforces a specific schema for properties files, small formatting issues can break dbt parse, dbt compile, or dbt run entirely. Systematic troubleshooting relies on reading the error message closely, validating YAML syntax, and checking dbt's expected schema structure.
Must-know
- dbt error messages typically include the file path and line/column number, so always start by opening the exact file and line referenced in the traceback.
- Common causes include inconsistent indentation (mixing tabs and spaces), missing colons, incorrect list/dict nesting, or duplicate keys under the same model/source entry.
- Running
dbt parseordbt debugisolates whether the issue is YAML syntax versus a Jinja/SQL compilation problem, since parse only validates project structure and config files. - dbt validates .yml files against expected schemas (e.g., models, sources, seeds, snapshots), so using a key in the wrong scope (like putting a source property under a models: block) triggers a validation error even if YAML syntax is valid.
- External YAML linters or an IDE with YAML schema support can catch indentation and syntax errors faster than reading raw dbt tracebacks.
- Version-control diffs are useful for isolating recently introduced YAML errors, since compilation failures often follow directly from the last edited .yml file.
You add a schema.yml file for a new staging model, then run dbt compile and get a failure.
version: 2
models:
- name: stg_customers
description: "Cleaned customer records"
columns:
- name: customer_id
tests:
- unique
- not_null
- name: stg_customers
description: "Adds email validation"
columns:
- name: email
tests:
- not_null
Terminal output:
Compilation Error
dbt found two resources with the name stg_customers. Since resources
are always uniquely identified by name, this is not allowed.
Why does this compilation error occur?
What you have tried across dbt Analytics Engineering's objectives, not a readiness score.
Developing and optimizing dbt models
- Tracing and confirming a model's upstream raw sources
- How dbt's core materialization types differ
- Keeping models modular and avoiding repeated logic
- What each core dbt command actually does
- Shaping a model's dependency graph so it stays readable
- Setting project-wide configuration in dbt_project.yml
- Pulling in and using a dbt package
- Writing a model in Python instead of SQL
- Granting model access through the grants config
- Configuring a snapshot to track slowly changing data
- Picking the right incremental strategy for a dataset
- Dry-running a model to check its logic and schema before a real build
- Sampling a model run before a full build
- What microbatch and other advanced materializations are for
Managing dbt models governance
Debugging data modeling errors
Troubleshooting and optimizing dbt pipelines
Implementing dbt tests
Implementing and maintaining external dependencies
Coverage checked against the published exam guide on Aug 5, 2026.
These are independent practice questions, written against this certification's published exam guide. They are not the certification vendor's own questions, and not the real exam.