dbt "Runtime Error ... Could not find profile named" in CI
dbt read the profile: key in dbt_project.yml and looked for a matching block in profiles.yml, but no profile with that name exists where dbt searched. It raises a Runtime Error before any connection.
What this error means
dbt run or dbt debug fails with "Runtime Error ... Could not find profile named 'my_project'". The profiles file is missing on the runner, in the wrong directory, or names a different profile.
Runtime Error
Could not find profile named 'analytics'Common causes
No profiles.yml on the runner
profiles.yml lives in ~/.dbt/ locally but was never created in CI, so dbt finds no profiles at all.
The profile name does not match dbt_project.yml
The profile: value in dbt_project.yml does not equal any top-level key in profiles.yml.
How to fix it
Provide a profiles file in CI
- Commit a CI profiles.yml (with env_var() for secrets) or write it in a step.
- Point dbt at it with
--profiles-dirso it is found. - Ensure its top-level key matches
profile:in dbt_project.yml.
dbt run --profiles-dir ./ciAlign the profile name
Make the profile: in dbt_project.yml exactly equal a block name in profiles.yml.
# dbt_project.yml
profile: 'analytics'
# profiles.yml must define a top-level 'analytics:' blockHow to prevent it
- Keep a CI-specific profiles.yml and pass
--profiles-dir. - Match the profile name in dbt_project.yml to profiles.yml exactly.
- Use env_var() in profiles.yml so secrets stay out of the repo.