Skip to content

[Bug]: Environment Variable Not Parsing #239

@jdbodyfelt

Description

@jdbodyfelt

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I have utilised environment variables within my profiles.yaml, for example:

<projectName>:
      outputs:
          dev:
              type: dremio
              software_host: "{{ env_var('DREMIO_HOST') }}"
              ...

A call to dbt --version gives (running on Ubuntu 22):

Core:
  - installed: 1.7.13
  - latest:    1.8.5  - Update available!

  Your version of dbt-core is out of date!
  You can find instructions for upgrading here:
  https://docs.getdbt.com/docs/installation

Plugins:
  - dremio: 1.7.0 - Up to date!

When I run dbt seed, I get the following error:

02:12:06  Running with dbt=1.7.13
02:12:06  Encountered an error:
Parsing Error
  Env var required but not provided: 'DREMIO_HOST'

I verify they exist:

$ echo $DREMIO_HOST 
beast.local

I can go in and "hand-code" those variables, and everything works great. It's just not reading them for some reason with this adapter. Any clue why?

Expected Behavior

Expectation is for environment variable to be resolved within Jinja sequence, as dictated here.

Steps To Reproduce

  1. Create an environment variable, say for software_host.
  2. Jinja out the variable in profiles.yaml.
  3. See if it resolves.

Environment

- OS: Ubuntu 22.04
- dbt-dremio: 1.7.0
- Dremio Software: 24.3.2
- Dremio Cloud: N/A (self-hosted)

Relevant log output

============================== 14:17:09.915401 | f25517e2-6f04-4a15-94fc-cf6566f2318d ==============================
�[0m14:17:09.915401 [info ] [MainThread]: Running with dbt=1.7.13
�[0m14:17:09.916404 [debug] [MainThread]: running dbt with arguments {'printer_width': '80', 'indirect_selection': 'eager', 'log_cache_events': 'False', 'write_json': 'True', 'partial_parse': 'True', 'cache_selected_only': 'False', 'warn_error': 'None', 'fail_fast': 'False', 'version_check': 'True', 'log_path': '/home/jdbodyfelt/Projects/tapeTally/dbt_pipeline/logs', 'debug': 'False', 'profiles_dir': '/home/jdbodyfelt/Projects/tapeTally/dbt_pipeline', 'use_colors': 'True', 'use_experimental_parser': 'False', 'no_print': 'None', 'quiet': 'False', 'warn_error_options': 'WarnErrorOptions(include=[], exclude=[])', 'introspect': 'True', 'log_format': 'default', 'static_parser': 'True', 'target_path': 'None', 'invocation_command': 'dbt seed', 'send_anonymous_usage_stats': 'True'}
�[0m14:17:09.923525 [error] [MainThread]: Encountered an error:
Parsing Error
  Env var required but not provided: 'DREMIO_HOST'
�[0m14:17:09.924872 [debug] [MainThread]: Resource report: {"command_name": "seed", "command_wall_clock_time": 0.08556916, "process_user_time": 3.362351, "process_kernel_time": 0.179911, "process_mem_max_rss": "91880", "process_out_blocks": "16", "command_success": false, "process_in_blocks": "0"}
�[0m14:17:09.925949 [debug] [MainThread]: Command `dbt seed` failed at 14:17:09.925672 after 0.09 seconds
�[0m14:17:09.926706 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7ec9377aded0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7ec93581dfc0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7ec93581df00>]}
�[0m14:17:09.927467 [debug] [MainThread]: Flushing usage events

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions