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-1653] [Bug] DBT uses wrong PROFILES_DIR, even if DBT_PROFILES_DIR env variable is set. #6436

Closed
2 tasks done
codycrossley opened this issue Dec 13, 2022 · 3 comments
Closed
2 tasks done
Labels
bug Something isn't working wontfix Not a bug or out of scope for dbt-core

Comments

@codycrossley
Copy link

codycrossley commented Dec 13, 2022

Is this a new bug in dbt-core?

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

Current Behavior

Using dbt-core 1.3.1, dbt commands are using the wrong profiles.yml file, despite being told which file to use by the DBT_PROFILES_DIR env variable. It will try to use a profiles.yml file that exists in the current working directory instead.

Expected Behavior

dbt commands should use the profiles.yml located at the DBT_PROFILES_DIR directory when the environment variable is set; instead, it attempts to use the local profiles.yml file.

Steps To Reproduce

I have defined the environment variable DBT_PROFILES_DIR=/Users/my_username/.dbt/

When I run dbt debug --config-dir, I get the following

16:04:00 Running with dbt=1.3.1
16:04:00 To view your profiles.yml file, run:

open /Users/my_username/.dbt

However, when I execute any dbt run command from a directory where another profiles.yml file exists, it attempts to use the local profile instead.

Relevant log output

No response

Environment

- OS:MacOS 12.6
- Python: 3.9
- dbt: 1.3.1

Which database adapter are you using with dbt?

redshift

Additional Context

No response

@codycrossley codycrossley added bug Something isn't working triage labels Dec 13, 2022
@github-actions github-actions bot changed the title [Bug] DBT uses wrong PROFILES_DIR, even if DBT_PROFILES_DIR env variable is set. [CT-1653] [Bug] DBT uses wrong PROFILES_DIR, even if DBT_PROFILES_DIR env variable is set. Dec 13, 2022
@jtcohen6
Copy link
Contributor

@codycrossley Thanks for opening — I haven't been able to reproduce this locally:

$ DBT_PROFILES_DIR=/something/else dbt debug --config-dir
16:46:49  Running with dbt=1.3.1
16:46:49  To view your profiles.yml file, run:

open /something/else

Are you sure you're setting the env var correctly? What do you see if you run this in the same environment?

$ echo $DBT_PROFILES_DIR

@codycrossley
Copy link
Author

Oh my god. I am so sorry. After all this time, I realized my env variable was DBT_PROFILES_PATH rather than DBT_PROFILES_DIR.

And when I ran the debug command, it was outside of any directory that contained a profiles.yml file, so it defaulted to the HOME/.dbt directory.

Please forgive me for wasting precious time. 🙏

@jtcohen6
Copy link
Contributor

@codycrossley No worries!! Glad you were able to get to the bottom of it :)

@jtcohen6 jtcohen6 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2022
@jtcohen6 jtcohen6 added wontfix Not a bug or out of scope for dbt-core and removed triage labels Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix Not a bug or out of scope for dbt-core
Projects
None yet
Development

No branches or pull requests

2 participants