MetricSign
EN|NLRequest Access
High severitycompilation

Power BI Refresh Error:
SourceNotFoundError

What does this error mean?

A dbt model references a source using source() but the source is not defined in any sources.yml file in the project. dbt cannot compile the model.

Common causes

  • 1The source was defined in a package that is not installed (run dbt deps)
  • 2The sources.yml file was deleted or the source definition was removed
  • 3The source name or table name in the source() call doesn't match the definition in sources.yml
  • 4The sources.yml file is in a directory not included in the model paths
  • 5A typo in the source name or table name in the source() macro call

How to fix it

  1. 1Search for the source definition: grep -r 'source_name' . --include='*.yml'
  2. 2Verify the source() call arguments match exactly: source('source_name', 'table_name')
  3. 3Run dbt deps if the source is defined in a package
  4. 4Check that the sources.yml file is in a directory included in the dbt project path
  5. 5Run dbt parse to see the full error including the file and line number

Frequently asked questions

Can a source be defined in multiple YAML files?

Each source name must be unique per schema. You can split source definitions across multiple files as long as the source names are unique.

How do I list all defined sources in my dbt project?

Run: dbt ls --resource-type source. This lists all sources defined in the project.

Other compilation errors