dbt debug Command: Diagnosing Connection and Setup Problems Fast
Before spending time debugging what looks like a broken model, itโs worth ruling out the much more mundane possibility that dbt simply canโt connect to your warehouse correctly โ a wrong password, an expired token, a typo in a schema name in profiles.yml. dbt debug exists to check exactly this category of problem, fast, before you go looking for a bug that isnโt there.
Running dbt debug
dbt debugThis checks, in order: whether dbt_project.yml is valid, whether profiles.yml exists and is readable, whether the configured connection details actually work, and whether a test query against the warehouse succeeds.
dbt version: 1.8.0python version: 3.11.4python path: /usr/bin/python3os info: macOS-14.5-arm64
Configuration: profiles.yml file [OK found and valid] dbt_project.yml file [OK found and valid]
Connection: host: my-warehouse.snowflakecomputing.com account: xy12345 user: analytics_svc_account database: analytics warehouse: transforming_wh role: transformer_role schema: dbt_alice Connection test: [OK connection ok]
All checks passed!When everything is configured correctly, this is the entire output โ a clean bill of health across configuration, credentials, and an actual live connection.
Reading a Failed Debug Output
Configuration: profiles.yml file [OK found and valid] dbt_project.yml file [OK found and valid]
Connection: host: my-warehouse.snowflakecomputing.com account: xy12345 user: analytics_svc_account database: analytics warehouse: transforming_wh role: transformer_role schema: dbt_alice Connection test: ERROR
1 check failed:Could not connect to Snowflake backend after 3 attempts.This immediately tells you the configuration files themselves are structurally fine โ the problem is specifically in the connection, narrowing the investigation to credentials, network access, or warehouse-side permissions rather than a dbt project misconfiguration.
Common Failure Categories and What They Mean
Configuration errors (caught before any connection attempt):
dbt_project.yml file [ERROR not found]Usually means dbt debug is being run from the wrong directory โ it needs to run from the dbt project root, where dbt_project.yml actually lives.
Profile errors:
profiles.yml file [ERROR invalid] Runtime Error Credentials in profile "my_project", target "dev" invalidAlmost always a missing or misspelled required field for that specific warehouse adapter (each adapter โ Snowflake, BigQuery, Redshift, Postgres โ has different required fields).
Connection errors:
Connection test: ERROR Database Error Incorrect username or passwordCredentials issue, distinct from configuration structure being wrong โ the YAML is well-formed, but whatโs in it doesnโt authenticate successfully.
Using โconfig-dir to Locate profiles.yml
A common early confusion: dbt looks for profiles.yml in ~/.dbt/ by default, not inside the project directory itself. dbt debug --config-dir shows exactly where dbt is looking.
dbt debug --config-dirUsing profiles.yml file at /Users/alice/.dbt/profiles.ymlIf your profiles.yml exists somewhere else โ a different path, or youโre relying on the DBT_PROFILES_DIR environment variable โ this immediately confirms whether dbt is even looking in the right place.
dbt debug in CI Setup
New CI pipelines almost always hit connection issues before anything else, since CI environments need their own credentials, separate from a developerโs local profiles.yml. Running dbt debug as the very first step in a new CI configuration catches this immediately, rather than getting a confusing failure several steps into a longer pipeline.
# Example CI pipeline- run: dbt deps- run: dbt debug- run: dbt buildIf dbt debug fails, the pipeline stops before wasting time on dbt deps or attempting a build that was never going to succeed anyway.
Checking a Specific Target
If profiles.yml defines multiple targets, dbt debug checks whichever one is currently active โ specify explicitly to check a target other than the default.
dbt debug --target prodThis is useful for confirming production credentials work correctly from your local machine (if you have access) before assuming a deploy will succeed, without needing to actually run any models against production to find out.
Checking Only Configuration Without Testing the Connection
For situations where you just want to confirm your YAML files are structurally valid โ without necessarily having network access to the actual warehouse, useful in some restricted local setups โ a narrower check is available.
dbt debug --no-connectionThis skips the live connection test entirely and only validates that dbt_project.yml and profiles.yml parse correctly as configuration files. Itโs a smaller, faster check than the full dbt debug, useful specifically when you already know the connection works and just want to confirm a configuration file edit didnโt introduce a YAML syntax error.
Common Mistakes
Skipping dbt debug and jumping straight to dbt run when something seems broken. If the actual problem is a connection or configuration issue, dbt runโs error output is often more confusing than dbt debugโs targeted, structured checks โ always rule out connection issues first.
Not running dbt debug as the first step in new CI setups. This is the single highest-value place to add it โ catching credential/configuration issues before the pipeline attempts anything more expensive.
Assuming a passing dbt debug means the whole project is healthy. It only validates connection and configuration โ it says nothing about model correctness, test coverage, or data quality, which is what the rest of this series covers.
Summary
| Check | What it validates |
|---|---|
dbt_project.yml structure | The project file itself is present and valid YAML |
profiles.yml structure | Connection profile is present and structurally valid |
| Connection test | Credentials actually authenticate and a test query succeeds |
--config-dir | Shows exactly where dbt is looking for profiles.yml |
dbt debug is the fastest possible first step whenever something seems broken and youโre not yet sure whether the problem is in your SQL or in your setup โ running it costs seconds and immediately narrows where the real problem lives.