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.
dbt
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.
Terminal
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
# 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.
Related guides
dbt "Database Error ... could not connect to server" in CIFix dbt "Database Error ... could not connect to server" in CI - dbt reached the connection step but the ware…
dbt "Could not find adapter type ... dbt-snowflake not installed" in CIFix dbt "Could not find adapter type X" in CI - the warehouse adapter package (dbt-snowflake, dbt-bigquery, d…
dbt "Database Error ... permission denied" in CIFix dbt "Database Error ... permission denied for schema/table" in CI - dbt connected and authenticated, but…