Skip to content
Latchkey

dbt "Could not find profiles.yml" file not found in CI

dbt could not locate profiles.yml. By default it reads ~/.dbt/profiles.yml; on a fresh CI runner that directory does not exist, so you must place the file or point dbt at it with --profiles-dir.

What this error means

dbt run or dbt debug fails at startup with "Runtime Error: Could not find profiles.yml" or "The profiles.yml file does not exist".

dbt
Runtime Error
  Could not find profiles.yml. Please make sure a profiles.yml file exists in
  /home/runner/.dbt

Common causes

No profiles.yml on a clean runner

Hosted runners start without a ~/.dbt directory, so unless CI creates or points to profiles.yml, dbt finds nothing.

The file lives in the repo but dbt is not told where

A committed profiles.yml is ignored unless you pass --profiles-dir or set DBT_PROFILES_DIR.

How to fix it

Point dbt at a committed profiles.yml

  1. Commit a CI profiles.yml (with env_var references, no secrets) in the repo.
  2. Set DBT_PROFILES_DIR or pass --profiles-dir to that folder.
  3. Run dbt debug to confirm dbt reads it.
.github/workflows/ci.yml
env:
  DBT_PROFILES_DIR: ${{ github.workspace }}/ci

Write profiles.yml into ~/.dbt during the job

Generate the file from secrets before invoking dbt if you prefer the default location.

Terminal
mkdir -p ~/.dbt
cp ci/profiles.yml ~/.dbt/profiles.yml

How to prevent it

  • Commit a CI profiles.yml that uses env_var and set DBT_PROFILES_DIR.
  • Run dbt debug early so a missing file fails before models run.
  • Never commit real credentials; render them from CI secrets.

Related guides

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