dataengref errors

Home / dbt / Projects and profiles

dbt: Compilation Error: dbt found two models with the name

dbt found two models with the name "orders".

Two resources of the same type share a name, so ref() would be ambiguous. Model names must be unique across the whole project, including subfolders, and across installed packages for some resource types.

Causes · Fixes · Source

Common causes

  1. Two .sql files with the same name live in different folders, for example staging/orders.sql and marts/orders.sql.How to confirm: The message lists both unique ids and their file paths.
  2. A copied or renamed file left the old version behind.How to confirm: One of the two paths is a backup or an old copy.

How to fix it

Rename one of the files (model names come from file names), or delete the stale copy. Use alias in config() if the database table name must stay the same.

Where the message comes from

Message template in the source: dbt found two %s with the name "%s".

References

Related errors

Last checked: