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

An empty profile returns an un-useful error #2292

Closed
clrcrl opened this issue Apr 2, 2020 · 5 comments · Fixed by #2297
Closed

An empty profile returns an un-useful error #2292

clrcrl opened this issue Apr 2, 2020 · 5 comments · Fixed by #2297
Labels
bug Something isn't working good_first_issue Straightforward + self-contained changes, good for new contributors!

Comments

@clrcrl
Copy link
Contributor

clrcrl commented Apr 2, 2020

Steps To Reproduce

  1. Create a profile that's empty (in profiles.yml):
jaffle_shop: 
  1. Ensure your project uses this profile
  2. Run any dbt command

Expected behavior

Some sort of helpful error message, like "your profile is empty"

Actual behaviour

Running with dbt=0.16.0
Encountered an error:
'NoneType' object has no attribute 'get'

Screenshots and log output

If applicable, add screenshots or log output to help explain your problem.

System information

The output of dbt --version:
0.16.0

Additional context

Add any other context about the problem here.

@clrcrl clrcrl added bug Something isn't working triage labels Apr 2, 2020
@drewbanin drewbanin removed the triage label Apr 3, 2020
@drewbanin
Copy link
Contributor

Ooh, good catch, thanks @clrcrl! This was actually fixed (maybe inadvertently) in #2290

09:51:26 ~/fishtown/clients/debug $ head dbt_project.yml

name: 'my_project'
version: '1.0'

profile:

09:51:30 ~/fishtown/clients/debug $ dbt run
Running with dbt=0.16.1-a1
Encountered an error while reading the project:
  ERROR: Runtime Error
  dbt cannot run because no profile was specified for this dbt project.
  To specify a profile for this project, add a line like the this to
  your dbt_project.yml file:

  profile: [profile name]

  Here, [profile name] should be replaced with a profile name
  defined in your profiles.yml file. You can find profiles.yml here:

  /Users/drew/.dbt/profiles.yml

Encountered an error:
Runtime Error
  Could not run dbt

It's going to ship in 0.16.1 next week :)

@clrcrl
Copy link
Contributor Author

clrcrl commented Apr 3, 2020

Hey @drewbanin, I'm not sure if that's the same issue.

I'm talking about having an empty profile in your profiles.yml, whereas the above is talking about having an empty profile: key in your dbt_project.yml

@drewbanin drewbanin reopened this Apr 3, 2020
@drewbanin
Copy link
Contributor

drewbanin commented Apr 3, 2020

oooh, i understand, thanks for clarifying!

Adding this to the Octavius Catto milestone, should be a quick fix

For the implementer: we should add more validation around profile parsing code, raising a sensible error indicating what went wrong. We should not assume that profiles are well-formed at all in this part of the codebase.

@drewbanin drewbanin added this to the Octavius Catto milestone Apr 3, 2020
@drewbanin drewbanin added the good_first_issue Straightforward + self-contained changes, good for new contributors! label Apr 3, 2020
@mshayeb
Copy link

mshayeb commented Apr 22, 2020

I got error when I tried to run: dbt run:

dbt_project.yml

name: 'jaffle_shop'
version: '0.1'
profile: 'my_dbt'
source-paths: ["models"]
analysis-paths: ["analysis"]
test-paths: ["tests"]
data-paths: ["data"]
macro-paths: ["macros"]

target-path: "target"
clean-targets:
- "target"
- "dbt_modules"
- "logs"

models:
jaffle_shop:
materialized: table
staging:
materialized: view
tags: ["staging", "hourly"]

Running with dbt=0.16.1
Encountered an error:
'NoneType' object has no attribute 'get'

@drewbanin
Copy link
Contributor

hey @mshayeb - this is fixed in the next release of dbt, v0.17.0, due out around mid-May:

#2297

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good_first_issue Straightforward + self-contained changes, good for new contributors!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants