dbt 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
- 1Search for the source definition across all YAML files: grep -r 'source_name' . --include='*.yml' — confirm the source name and table name are defined.
- 2Verify the source() call arguments match the definition exactly, including case: source('source_name', 'table_name').
- 3Run dbt deps if the source is defined in a package — the package must be installed before dbt can resolve it.
- 4Check that the sources.yml file is in a directory included in the dbt project's model-paths configuration.
- 5Run dbt parse to get the full compilation error with the file path and line number where the undefined source is referenced.
Frequently asked questions
Source · docs.getdbt.com/reference/exceptions