Skip to content

[CT-3363] [Feature] interactive dbt init flow's instructions don't results in a successful dbt debug, because you need to enter the new subdirectory #9041

@joellabes

Description

@joellabes

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

I went through the dbt init flow as follows:


(dbt-prod) joel@Joel-Labes joel-sandbox-profile-generation % dbt init
20:11:51  Running with dbt=1.7.0
Enter a name for your project (letters, digits, underscore): joel_profile_generation_test
20:12:01  
Your new dbt project "joel_profile_generation_test" was created!

[...]

20:12:01  Setting up your profile.

[...]

20:15:10  Profile joel_profile_generation_test written to /Users/joel/.dbt/profiles.yml using target's profile_template.yml and your supplied values. Run 'dbt debug' to validate the connection.
(dbt-prod) joel@Joel-Labes joel-sandbox-profile-generation % dbt debug
20:15:22  Running with dbt=1.7.0
20:15:22  dbt version: 1.7.0
20:15:22  python version: 3.8.10
20:15:22  python path: /Users/joel/venvs/dbt-prod/bin/python3
20:15:22  os info: macOS-10.16-x86_64-i386-64bit
20:15:22  Using profiles dir at /Users/joel/.dbt
20:15:22  Using profiles.yml file at /Users/joel/.dbt/profiles.yml
20:15:22  Using dbt_project.yml file at /Users/joel/Documents/GitHub/joel-sandbox-profile-generation/dbt_project.yml
20:15:22  Encountered an error:
Internal Error
  Profile should not be None if loading profile completed

After some faffing, I discovered that dbt init made a new subdirectory. Once I switched to it and ran dbt debug, it succeeded:

(dbt-prod) joel@Joel-Labes joel-sandbox-profile-generation % ls
joel_profile_generation_test    logs
(dbt-prod) joel@Joel-Labes joel-sandbox-profile-generation % cd joel_profile_generation_test 
(dbt-prod) joel@Joel-Labes joel_profile_generation_test % dbt debug
[...]
20:31:31  Configuration:
20:31:31    profiles.yml file [OK found and valid]

Expected Behavior

  • The instructions should tell me to cd to the newly-created dbt project's directory before running dbt debug
  • Honestly I'm surprised that it didn't complain about no dbt_project.yml file first, which would have at least put me on the right track. It claims to be using the file at /Users/joel/Documents/GitHub/joel-sandbox-profile-generation/dbt_project.yml, but the ls in the joel-sandbox-profile-generation directory only contains those two dirs shown above.

Steps To Reproduce

Replay commands in the above logs

Relevant log output

No response

Environment

- OS:
- Python:
- dbt: 1.7.0

Which database adapter are you using with dbt?

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood_first_issueStraightforward + self-contained changes, good for new contributors!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions