Hi everyone :slightly_smiling_face: <@U06CQSJ5KFT>...
# troubleshooting
v
Hi everyone 🙂 @Stéphane Burwash and I would like to use two target-bigquery (adswerve) in one environment (prod), sending data to two different GCP projects. Hence, we need to pass two
GOOGLE_APPPLICATION_CREDENTIALS
environment variables in one environment (prod) but we are really stuck on how to do that. Does anyone have a hunch please? 🙂 My idea is to set the environment variable per target
g
I'm not sure if this is of help with your intention. Perhaps you can configure a plugin with an inherit_from property in the project. Please refer to https://docs.meltano.com/concepts/project for detail information as to the usage.
v
I’m trying to pass an env variable within the plugin loader but I still have problems. Still investigating but what do you think of this lead ? https://docs.meltano.com/guide/configuration#overriding-discoverable-plugin-properties:~:text=e[…]20MY_ENV_VAR%3A%20environment_level_plugin_env_var
something like that, be in prod environment and have 2 loaders: one for prod and one for staging
p
@vinh_nguyen__potloc_ having two loaders sounds like a reasonable way to do it. Treating them as two separate loaders is probably better than trying to toggle an env var because it's more explicit in the code/config. Do you need the env key in that screenshot config though? You already set the credentials path config so I think it might be redundant, right?
v
Hello @pat_nadolny! I totally agree with you but when I tried to run without specifying an env key, I got this error:
google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run the application.
Still investigating, only setting up credentials path in the loader config would be so much easier!
Actually setting the env within the loader definition works (as explained here). Thanks for your help!!
p
Sounds like you got it figured out but you can also run your command with “—log-level=debug” to see the list of environment variables set. It sounds like a target bug if that env var isn't getting set automatically when you have the credentials path config set.