DBT - [WARNING]: Did not find matching node for patch

Viewed 2705

I keep getting the error below when I use dbt run - I can't find anything on why this error occurs or how to fix it within the dbt documentation.

[WARNING]: Did not find matching node for patch with name 'vGenericView' in the 'models' section of file 'models\generic_schema\schema.sql'
4 Answers

did you by chance recently upgrade to dbt 1.0.0? If so, this means that you have a model, vGenericView defined in a schema.yml but you don't have a vGenericView.sql model file to which it corresponds.

If all views and tables defined in schema are 1 to 1 with model files then try to run dbt clean and test or run afterward.

Not sure what happened to my project, but ran into frustration looking for missing and/or misspelled files when it was just leftovers from different compiled files not cleaned out. Previously moved views around to different schemas and renamed others.

One case when this will happen is if you have the same data source defined in two different schema.yml file (or whatever you call it)

So the mistake is here in the naming:

The model name in the models.yml file should for example be: employees
And the sql file should be named: employees.sql

So your models.yml will look like:

version: 2

models:
  - name: employees
    description: "View of employees"

And there must be a model with file name: employees.sql

Related