question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[CT-1364] [Bug] profiles.yml in project dir doesn't work when running dbt from outside with --project-dir

See original GitHub issue

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

Assume your profiles.yml is located at the root of your project’s directory. Since dbt 1.3, this is supposed to be the first location dbt looks in. However, running dbt from outside with:

dbt run --project-dir /path/to/project

returns a “profile not found” error.

Expected Behavior

dbt should look for profiles.yml in the project’s root directory, regardless of whether dbt is ran from the directory itself or from outside.

Steps To Reproduce

  1. Put profiles.yml in project’s directory
  2. dbt run --project-dir /path/to/project

Relevant log output

No response

Environment

- OS:
- Python:
- dbt:

Which database adapter are you using with dbt?

No response

Additional Context

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
dbeatty10commented, Oct 19, 2022

Indeed our messages got crossed – I started a draft and forgot to check for any responses before hitting “send”!

Your opinion on this is rational and reasonable. For the 5% use case, I buy into your assumption that the project directory rather than the current working directory would be the more common one.

You hit the nail on the head that our design decision was focused on the 95% use case, and we decided leave the 5% use case to be handled with the explicit flags. This allowed the code changes to be much more simple while still retaining the ability for more advanced configuration.

0reactions
seubcommented, Oct 19, 2022

Thank you for your reply! I expressed my humble opinion in my second message above, I think our messages probably got crossed 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

[CT-462] [Bug] profiles.yml cannot be profiles.yaml · Issue #5002
Create a new project; Name your profiles file profiles.yaml; Run dbt --profiles-dir /directory/with/profiles/yaml/file/in/it debug ...
Read more >
profiles-dir fails for dbt test and dbt compile - dbt Discourse
I have a profiles/profiles.yml under my dbt project. I am able to do dbt run --profiles-dir ./profiles, it'll successfully create tables at ...
Read more >
How to set location of profiles.yml and dbt_project.yml files in ...
This command will reassign the location of your profiles.yml to the folder mentioned in /path/to/folder . Once it is done, run: dbt debug...
Read more >
Custom path for DBT's profiles.yml - Troubleshooting - Airbyte
When I run my Airbyte sync, I have the following error during dbt phase : Could not find profile named 'normalize' Problem is...
Read more >
Setting up dbt™ Projects in Git - Hevo Data
yml, which is created by dbt for your project. This configuration file helps dbt identify the dbt project directory and also how dbt...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found