Skip to content
Latchkey

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

  1. Commit a CI profiles.yml (with env_var() for secrets) or write it in a step.
  2. Point dbt at it with --profiles-dir so it is found.
  3. Ensure its top-level key matches profile: in dbt_project.yml.
Terminal
dbt run --profiles-dir ./ci

Align 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:' block

How 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →