dbt-setup-example icon indicating copy to clipboard operation
dbt-setup-example copied to clipboard

dbt cannot render {{ env_var('USERNAME') }}

Open avoutsas67 opened this issue 4 years ago • 1 comments

Many thanks for the excellent example!

I seem to have an issue though when executing dbt debug --profiles-dir .

I get the following error: `Using dbt_project.yml file at /Users//Development/sandbox/dbt-tutorial/dbt-setup-example/dvd-rentals/dbt_project.yml

Configuration: profiles.yml file [ERROR invalid] dbt_project.yml file [OK found and valid]

Required dependencies:

  • git [OK found]

1 check failed: Profile loading failed for the following reason: Runtime Error Compilation Error Could not render {{ env_var('USERNAME') }}: Env var required but not provided: 'USERNAME'`

I am able to overcome the error if I replace the env_var with the value of the environment variable or if I set a default value for the variable.

I have validated that the environment variable is set using echo.

Also, I think it would be useful to include .venv in your .gitignore file.

Many thanks for the support.

Achilleas

avoutsas67 avatar Nov 14 '21 10:11 avoutsas67

Thanks @avoutsas67! This repo is pretty seriously out of date at this point so I'm not surprised it doesn't work -- I think dbt has great guides for getting started so I'd follow one of those instead :)

mikekaminsky avatar Nov 14 '21 17:11 mikekaminsky