Cannot find profile named 'prod'" dbt debug
Fixes the missing dbt profile error by adding the prod target to profiles.yml or pointing DBT_PROFILES_DIR at the right directory, then verifying with dbt debug. Use when dbt reports it cannot find a profile. Not for connection failures after the profile is found.
TL;DR
dbt looked for a profile named prod and found nothing. Either profiles.yml has no prod target under your project profile, or dbt is reading a different profiles.yml than you edited. Add the target or fix DBT_PROFILES_DIR, then run dbt debug --target prod.
Error
"Cannot find profile named 'prod'" dbt debugSteps
- Run
dbt debug --target prodand note the profiles path it reports. Expected: you see exactly which profiles.yml dbt read. - Open that file and check the top-level keys: one must match your project's
profile:name from dbt_project.yml, with aprodtarget beneath it. Expected: you find the missing key or the missing target. - If the file is wrong, set
DBT_PROFILES_DIRto the directory containing the correct profiles.yml. Expected: dbt reads the intended file. - Add the
prodtarget with all required fields for your adapter. Expected: the YAML has a completeprodblock. - Run
dbt debug --target prod. Expected: the profile is found and the connection check passes.
When to use
- dbt reports "Cannot find profile named 'prod'" (or any target name).
- You just added a new target or moved profiles.yml.
When not to use
- The profile is found but the connection fails (a credentials or network problem).
- dbt Cloud runs (profiles are managed in the UI, not in profiles.yml).
Tool compatibility
- dbt Core 1.0 and later, all adapters.
DBT_PROFILES_DIRbehavior is adapter-independent.
Variant phrasings
Could not find profile named 'dev'
Same fix for the default target; the profile key must match dbt_project.yml.
Profile not found in CI
CI usually needs DBT_PROFILES_DIR set or the file mounted into the job.
Why it happens
dbt resolves the profile name from dbt_project.yml, then looks up the target inside profiles.yml. A mismatch at either level, or dbt reading a different profiles.yml, yields "cannot find profile".
Edge cases
- The profile key is case-sensitive and must match
profile:in dbt_project.yml exactly. - A YAML syntax error can silently drop the target block; validate the file parses.
- Target names like
prodare conventional only; dbt accepts any name you define.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_qpUxQKe9KFBznsMLQiTYhA