Databases and Redis · Troubleshooting walkthrough
dbt stops because it cannot find the profile or the .dbt folder
Short answer
dbt raises Could not find profile named 'x' when the profiles.yml it reads has no top-level key called x. In dbt-core 1.11 and later that file comes from --profiles-dir, DBT_ENGINE_PROFILES_DIR or DBT_PROFILES_DIR, the current folder, then ~/.dbt. Run dbt debug, create the file with dbt init if it is missing, or make the two names match.
Could not find profile named 'x' means dbt read a profiles.yml and found no top-level key called x, or found no profiles.yml at all and so had an empty list of profiles. Three different problems end in the same sentence: the file was never created on this machine, the file exists where dbt does not look, or the two names do not match.
One command shows which of them you have, because it prints the path dbt chose.
The text you see
Could not find profile named 'jaffle_shop'profiles.yml file [ERROR not found]dbt looked for a profiles.yml file in /home/me/.dbt/profiles.yml, but did not find one.
Stage 1
Let dbt say where it looked
Run dbt debug from the project folder. The line beginning Using profiles.yml file at gives the exact path, and the configuration block says whether that file exists and parses.
Show the chosen profiles.yml
dbt debug| dbt debug shows | Go to |
|---|---|
| profiles.yml file [ERROR not found] | No file yet on this machine |
| A path that is not where your file is | Folder dbt does not search |
| File found, name not in its keys | Names do not match |
Stage 2
No profiles.yml on this machine yet
The recommended home for the file is ~/.dbt, and dbt init is what normally writes it. A project you cloned or copied brings no credentials with it, so a new laptop or a fresh teammate hits this on day one.
Run dbt init inside the existing project. It asks for connection details and adds a profile under the name the project already uses, writing it to ~/.dbt/profiles.yml.
Check the folder, then initialise
ls -la ~/.dbt/
cd path/to/your-dbt-project
dbt initStage 3
The file exists in a folder dbt does not search
In dbt-core 1.11 and later, dbt checks --profiles-dir, DBT_ENGINE_PROFILES_DIR, the legacy DBT_PROFILES_DIR, the current working directory and ~/.dbt, in that order. A file in a repo subfolder, a mounted volume or another user's home is invisible. Under a different account or inside a container, ~ means that account's home, not where you saved the file.
Name the folder per command, or once in the environment of the shell or CI job.
Locate the file, then point dbt at it
find . -name profiles.yml -not -path './dbt_packages/*'
dbt run --profiles-dir ./ci
# or for every command in this shell or job
export DBT_ENGINE_PROFILES_DIR="$PWD/ci"Stage 4
The two profile names differ
dbt takes the profile: value from dbt_project.yml and looks it up as a top-level key in profiles.yml. A project asking for jaffle_shops against a file that defines jaffle_shop fails with the same message although the credentials are fine. Plurals, dashes and underscores are the usual culprits.
Compare the names, then make them match
grep -n "^profile:" dbt_project.yml
grep -nE "^[A-Za-z0-9_-]+:" ~/.dbt/profiles.yml
# dbt_project.yml
profile: jaffle_shopWhen several projects share one profiles.yml, changing profile: in dbt_project.yml is the smaller edit.
Stage 5
Stopping it recurring
Once dbt debug finds the profile and the failure moves to the connection test, the problem has become credentials, network access or the adapter.
- Commit a
profile_template.ymlnext todbt_project.ymlsodbt initcan build a working profile for each new teammate. - Set
DBT_ENGINE_PROFILES_DIRin the CI job definition instead of relying on a runner's home folder. - Run
dbt debugas the first CI step so a missing or misnamed profile fails before any model builds.
If you only keep one thing
- dbt debug prints the profiles.yml path it picked; start there.
- No file: dbt init. Wrong folder: --profiles-dir or DBT_ENGINE_PROFILES_DIR.
- The profile: name in dbt_project.yml must equal a top-level key in profiles.yml.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.