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.

bug: env inheritance global env -> plugin env

See original GitHub issue

Prereq:


Meltano Version

2.9.0

Python Version

3.8

Bug scope

Configuration (settings parsing, validation, etc.)

Operating System

Ubuntu

Description

  1. Copy meltano.yml
  2. meltano install
  3. export MELTY=melty
  4. `meltano invoke --print-var GLOBALMELTY–print-var DEVMELTY target-jsonl
visch@visch-ubuntu:~/git/meltano-projects/env_multiple_values_inheritance$ meltano invoke --print-var DEVMELTY --print-var GLOBALMELTY target-jsonl
2022-11-16T02:46:06.088209Z [info     ] Environment 'dev' is active
DEVMELTY=MELTY
GLOBALMELTY=$MELTY

Code

version: 1
default_environment: dev
project_id: bea6b7f5-2f98-416a-9a6b-b602b56efff6
environments:
- name: dev
  env:
    DEVMELTY: $MELTY
- name: staging
- name: prod
plugins:
  loaders:
  - name: target-jsonl
    variant: andyh1203
    pip_url: target-jsonl
env:
  GLOBALMELTY: $MELTY

Issue Analytics

  • State:open
  • Created 10 months ago
  • Reactions:2
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
cjohnhansoncommented, Nov 16, 2022

@tayloramurphy – yes we have these tests for inheritance.

The logic itself is consolidated in plugin_invoker.py and is well-commented there.

I was able to replicate this locally. I think the fix itself is fairly straightforward – it looks like we’re expanding the top-level env vars in the plugin invoker, but then the plugin itself is still getting the unexpanded top-level values in its env and those take precedence over top-level env vars when we pass the full environment into the plugin at invocation. So scope here would be to update that precedence order and/or potentially expand env vars with plugin settings directly and then figure out why this behavior isn’t cropping up in unit tests and update the test suite to catch it (probably also add an integration test for this as well)

1reaction
tayloramurphycommented, Nov 16, 2022

@cjohnhanson thanks for the details! Can you give this a prelim weight on the Product Roadmap project and I’ll work with AJ to get it prioritized?

Read more comments on GitHub >

github_iconTop Results From Across the Web

env variables set in main process are not inherited by ... - GitHub
Describe the bug first i make sure there is no process.env.LD_LIBRARY_PATH in os env variables. i wanna set env variables programmatically.
Read more >
Environment Injector - Jenkins Plugins
This plugin makes it possible to setup a custom environment for your jobs. Features: Removes inherited environment variables by the Jenkins ...
Read more >
GOLAND Environment Vars in .env file - Stack Overflow
You can go to Tools | Create command line launcher... and then start GoLand from the command line, which will then inherit those...
Read more >
Jenkins Pipeline Environment Variables - The Definitive Guide
Jenkins Environment Variable is a global variable exposed through the env variable and used anywhere in the Jenkinsfile .
Read more >
How can environment variables inherited to sub scripts in a ...
my $perl_var=$ENV{bamboo_var}; print "Bamboo global var script 2: $perl_var";; Created a global variable called var with the value hello ...
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