Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages

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.

  • Applies to dbt-core 1.12.7, dbt-core 1.11 and later (profiles directory lookup)
  • Updated
  • By Maaz Zindani, Senior Software Engineer

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 showsGo to
profiles.yml file [ERROR not found]No file yet on this machine
A path that is not where your file isFolder dbt does not search
File found, name not in its keysNames 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 init

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_shop

When 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.yml next to dbt_project.yml so dbt init can build a working profile for each new teammate.
  • Set DBT_ENGINE_PROFILES_DIR in the CI job definition instead of relying on a runner's home folder.
  • Run dbt debug as 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.

Next step

Want a second pair of eyes on it?

Send me the error and what changed before it started. I reply within 24 hours.