MetricSign
EN|NLRequest Access
High severitydbt

Power BI Refresh Error:
Compilation Error: Invalid YAML

What does this error mean?

Dbt encountered a YAML parsing error in a schema or configuration file. The file contains invalid YAML syntax that prevents it from being parsed.

Common causes

  • 1Tabs used for indentation instead of spaces (YAML requires spaces)
  • 2Duplicate keys under the same parent element
  • 3Unquoted strings containing special characters such as colons or brackets

How to fix it

  1. 1Use a YAML linter (such as yamllint) to validate the affected .yml file.
  2. 2Replace any tab characters with spaces — YAML requires spaces for indentation.
  3. 3Look for duplicate keys under the same parent.
  4. 4Quote strings that contain special characters (colons, hyphens, brackets).
  5. 5Run `dbt parse` to identify which file is causing the error.

Frequently asked questions

What causes YAML parsing errors in dbt schema files?

Common causes: incorrect indentation (YAML uses spaces, not tabs), missing colons after keys, unquoted strings containing special characters (:, #, @, {}), and inconsistent indentation levels within a block.

How do I validate YAML files before running dbt?

Use a YAML linter (yamllint or `dbt parse`) to check for syntax errors. VS Code with the YAML extension highlights errors inline. The dbt Cloud IDE also shows YAML parse errors before running jobs.

Is YAML schema validation different from dbt project validation?

Yes — YAML syntax validity is a prerequisite. dbt also validates content against its expected schema (correct keys, valid test names, valid references). A file can pass YAML syntax but still fail dbt schema validation.

Official documentation: https://docs.getdbt.com/guides/debug-errors

Other dbt errors