## TL;DR

The profiles.yml dbt is reading has no top-level profile named ci, or dbt is reading a different profiles.yml than the one you edited. Add a ci profile with a dev or ci output, or point DBT_PROFILES_DIR and the --profile flag at the file that defines it. Confirm with dbt debug --profile ci before running jobs.

```text
Runtime Error: No profile named 'ci' found in profiles.yml
```

## Use this when

- dbt fails immediately with Runtime Error No profile named ci found in profiles.yml
- the failure happens in CI but not on a developer machine
- you pass --profile ci or set the profile in dbt_project.yml to ci

## Not for this skill when

- dbt says target not found inside an existing profile, add the target output instead
- the profile exists but the connection fails, that is a credentials or network problem
- you use dbt Cloud, which manages its own profiles and does not read your local file

## Steps

1. Run dbt debug --profile ci --profiles-dir on the exact directory CI uses, or echo the DBT_PROFILES_DIR value in the CI job, and open that profiles.yml.
   Verify: you are looking at the same profiles.yml file dbt reads in CI.

2. Check the top-level keys of that file. The profile key must match the name in dbt_project.yml under profile: or the --profile flag exactly, including case. Add a ci profile with at least one output and a target pointing at it if it is absent.
   Verify: profiles.yml contains a top-level ci key with a target and outputs.

3. Fill the ci output with the CI warehouse credentials supplied through environment variables using env_var calls, and make sure those variables are set in the CI job environment.
   Verify: dbt debug --profile ci reaches the connection check instead of the profile lookup error.

4. Run dbt debug --profile ci fully, then a cheap command such as dbt ls --profile ci in CI.
   Verify: debug reports connection ok and dbt ls lists models.

## Variant phrasings

### profile exists locally, missing in CI
The CI image usually mounts or generates its own profiles.yml. Commit a CI-specific profiles file or generate it in the pipeline step; do not assume the developer file travels with the repo if it is gitignored.

### name mismatch after rename
Renaming the project profile in dbt_project.yml without renaming the profiles.yml key produces this exact error. Align the two names.

Compatibility: dbt-core 1.x profiles.yml, local and CI runners. dbt Cloud jobs do not use a repo profiles.yml. Profile names are case sensitive.

## Why it happens

dbt resolves the profile name from dbt_project.yml or the --profile flag, then looks that exact key up in the profiles.yml found via --profiles-dir, DBT_PROFILES_DIR, or the default home directory location. If none of the searched files define that key, dbt stops before opening any warehouse connection.

## Edge cases / pitfalls

- profiles.yml is commonly gitignored, so a fresh CI checkout has none unless the pipeline creates it.
- Two profiles files on a machine (project dir vs home dir) cause edit-the-wrong-file loops; always verify with --profiles-dir.
- An output named ci inside a differently named profile does not count; the lookup is on the top-level profile name.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_Cuxx0GZL70idwKiRKv1DQQ
