dbt "Credentials in profile target invalid" in CI
dbt parsed profiles.yml but the credentials block for the active target is missing a required key or has an empty value. In CI this is almost always an env_var that resolved to an empty string because a secret was not set.
What this error means
dbt debug or dbt run fails at startup with "Credentials in profile 'X', target 'Y' invalid" and a Validation Error naming the missing or empty field.
Runtime Error
Credentials in profile "my_project", target "ci" invalid: 'account' is a required propertyCommon causes
A required connection field is absent for this target
The target block omits a key the adapter requires (account, host, database, schema), so validation rejects the profile before any connection is attempted.
An env_var rendered to empty in CI
A field set to "{{ env_var('DBT_ACCOUNT') }}" produced an empty value because the secret was never exposed to the job, so the field reads as absent.
How to fix it
Complete the target block and inject secrets
- Read the field named in the Validation Error and add it to the active target.
- Set the corresponding secret in CI so any env_var resolves to a real value.
- Run
dbt debug --target cito confirm the credentials validate.
my_project:
target: ci
outputs:
ci:
type: snowflake
account: "{{ env_var('DBT_ACCOUNT') }}"
user: "{{ env_var('DBT_USER') }}"
password: "{{ env_var('DBT_PASSWORD') }}"
database: analytics
schema: dbt_ciExpose the secrets to the step
Map repository secrets into the job env so profiles.yml env_var calls have values at parse time.
env:
DBT_ACCOUNT: ${{ secrets.DBT_ACCOUNT }}
DBT_USER: ${{ secrets.DBT_USER }}
DBT_PASSWORD: ${{ secrets.DBT_PASSWORD }}How to prevent it
- Keep all connection secrets in CI secrets and reference them via env_var.
- Run
dbt debugas an early CI step so a bad profile fails fast. - Validate profiles.yml against the adapter fields for each target.