Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CT-2956] [Regression] dbt debug returns success (0 exit code) when connection test fails #8350

Closed
2 tasks done
jtcohen6 opened this issue Aug 10, 2023 · 0 comments · Fixed by #8351 · May be fixed by #10437
Closed
2 tasks done

[CT-2956] [Regression] dbt debug returns success (0 exit code) when connection test fails #8350

jtcohen6 opened this issue Aug 10, 2023 · 0 comments · Fixed by #8351 · May be fixed by #10437
Labels

Comments

@jtcohen6
Copy link
Contributor

jtcohen6 commented Aug 10, 2023

Is this a regression in a recent version of dbt-core?

  • I believe this is a regression in dbt-core functionality
  • I have searched the existing issues, and I could not find an existing issue for this regression

I'm guessing that this is related to our changes to dbt debug in:

Reading through that PR, I don't believe this was one of the intended changes.

Current Behavior

dbt debug is passing even if the connection test fails

Expected/Previous Behavior

dbt debug should return a nonzero exit code if the connection test fails, and details on what failed

Steps To Reproduce

Run dbt debug with a connection error

Relevant log output

$ dbt debug
12:15:33  Running with dbt=1.5.4
12:15:33  dbt version: 1.5.4
12:15:33  python version: 3.10.11
12:15:33  python path: /Users/jerco/dev/product/dbt-core/env/bin/python3
12:15:33  os info: macOS-13.4.1-arm64-arm-64bit
12:15:33  Using profiles.yml file at /Users/jerco/.dbt/profiles.yml
12:15:33  Using dbt_project.yml file at /Users/jerco/dev/internal/internal-analytics/dbt_project.yml
12:15:33  Configuration:
12:15:34    profiles.yml file [OK found and valid]
12:15:34    dbt_project.yml file [OK found and valid]
12:15:34  Required dependencies:
12:15:34   - git [OK found]

12:15:34  Connection:
...
12:15:34  Registered adapter: snowflake=1.5.2
12:15:38    Connection test: [ERROR]

12:15:38  1 check failed:
12:15:38  dbt was unable to connect to the specified database.
The database returned the following error:

  >Database Error
  250001: Could not connect to Snowflake backend after 1 attempt(s).Aborting

Check your database credentials and try again. For more information, visit:
https://docs.getdbt.com/docs/configure-your-profile


$ echo $?
1

----

$ dbt debug
12:17:29  Running with dbt=1.6.0
12:17:29  dbt version: 1.6.0
12:17:29  python version: 3.10.11
12:17:29  python path: /Users/jerco/dev/product/dbt-core/env/bin/python3
12:17:29  os info: macOS-13.4.1-arm64-arm-64bit
12:17:30  Using profiles dir at /Users/jerco/.dbt
12:17:30  Using profiles.yml file at /Users/jerco/.dbt/profiles.yml
12:17:30  Using dbt_project.yml file at /Users/jerco/dev/internal/internal-analytics/dbt_project.yml
12:17:30  adapter type: snowflake
12:17:30  adapter version: 1.6.0
12:17:30  Configuration:
12:17:30    profiles.yml file [OK found and valid]
12:17:30    dbt_project.yml file [OK found and valid]
12:17:30  Required dependencies:
12:17:30   - git [OK found]

12:17:30  Connection:
...
12:17:30  Registered adapter: snowflake=1.6.0
12:17:33    Connection test: [ERROR]

12:17:33  All checks passed!
$ echo $?
0

Environment

- OS: macOS-13.4.1-arm64-arm-64bit
- Python: 3.10.11
- dbt (working version): 1.5.4
- dbt (regression version): 1.6.0

Which database adapter are you using with dbt?

snowflake

Additional Context

No response

@jtcohen6 jtcohen6 added bug Something isn't working triage regression labels Aug 10, 2023
@github-actions github-actions bot changed the title [Regression] dbt debug returns success (0 exit code) when connection test fails [CT-2956] [Regression] dbt debug returns success (0 exit code) when connection test fails Aug 10, 2023
@dbeatty10 dbeatty10 removed the triage label Aug 10, 2023
github-actions bot pushed a commit that referenced this issue Oct 10, 2023
aranke added a commit that referenced this issue Oct 10, 2023
…tatuses for dbt debug (#8802)

Co-authored-by: Kshitij Aranke <kshitij.aranke@dbtlabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants