Hi @Everyone, Good Day ! I am trying to run a me...
# best-practices
s
Hi @Everyone, Good Day ! I am trying to run a meltano pipeline using environment variables. So I set the env variables $env:MELTANO_SETTING_TAP_POSTGRES_DATABASE="meltano"; $env:MELTANO_SETTING_TAP_POSTGRES_HOST="localhost"; $env:MELTANO_SETTING_TAP_POSTGRES_PORT="5432"; $env:MELTANO_SETTING_TAP_POSTGRES_USER="postgres"; $env:MELTANO_SETTING_TAP_POSTGRES_PASSWORD="****"; $env:MELTANO_SETTING_TAP_POSTGRES_FILTER_SCHEMAS="public"; $env:MELTANO_SETTING_TAP_POSTGRES_SQLALCHEMY_URL="postgresql://postgres:siba1234@localhost:5432/meltano" and commented the config sections in the meltano.yml file, then I locked the plugin. When I executed 2025-04-02T034115.605289Z [warning ] Failed to create symlink to 'meltano.exe': administrator privilege required 2025-04-02T034115.616596Z [info ] The default environment 'dev' will be ignored for
meltano config
. To configure a specific environment, please use the option
--environment=<environment name>
. (meltanoEnv) PS C:\Siba_\Work\POC_ConnectorFactory\Gerrit\Connector_Factory_Development\meltano-backend> I am getting no values. Is it the right way to set configuration if I want to use env variables. The purpose is not to store the config parameters in meltano.yml file. note: there is no .env file under my meltano project root directory. Thanks in advance !
r
Take out the
MELTANO_SETTING_
prefix, then I think you're good to go.
v
also
meltano config tap-postgres list
will list out what everything is currently set to and where it's coming from which can be very helpful in debugging this kind of thing! (@Reuben (Matatika) is right)
s
@Reuben (Matatika) its not working even after removing MELTANO_SETTING_ @visch If I comment my config section in meltano.yml, then the output of
meltano config tap-postgres list
comes as blank.
Copy code
- name: tap-postgres
    namespace: tap_postgres
    pip_url: ./connectors/tap-postgres
    executable: tap-postgres
    capabilities:
    - state
    - catalog
    - discover
    - metrics
    - about
    - stream-maps
    - inline-schemas
    # config:
    #   database: meltano
    #   host: localhost
    #   port: 5432
    #   user: postgres
    #   password: ******
    #   filter_schemas: [public]
    #   sqlalchemy_url: <postgresql://postgres:siba1234@localhost:5432/meltano>
    # select:
    #   #- '*.*'
    # - public-employees.*
I have set the env variable for this shell.
Copy code
(meltanoEnv) PS C:\Siba_\Work\POC_ConnectorFactory\Gerrit\Connector_Factory_Development\meltano-backend> Get-ChildItem Env:TAP_POSTGRES_* | Format-Table Name, Value

Name                        Value
----                        -----
TAP_POSTGRES_SQLALCHEMY_URL <postgresql://postgres:siba1234@localhost:5432/meltano>
TAP_POSTGRES_HOST           localhost
TAP_POSTGRES_DATABASE       meltano
TAP_POSTGRES_USER           postgres
TAP_POSTGRES_PORT           5432
TAP_POSTGRES_PASSWORD       *****
TAP_POSTGRES_FILTER_SCHEMAS harman


(meltanoEnv) PS C:\Siba_\Work\POC_ConnectorFactory\Gerrit\Connector_Factory_Development\meltano-backend>
The output is coming as blank. Not sure why !!!
Copy code
(meltanoEnv) PS C:\Siba_\Work\POC_ConnectorFactory\Gerrit\Connector_Factory_Development\meltano-backend> meltano config tap-postgres list 
2025-04-02T13:00:29.222183Z [warning  ] Failed to create symlink to 'meltano.exe': administrator privilege required
2025-04-02T13:00:29.233587Z [info     ] The default environment 'dev' will be ignored for `meltano config`. To configure a specific environment, please use the option `--environment=<environment name>`.
(meltanoEnv) PS C:\Siba_\Work\POC_ConnectorFactory\Gerrit\Connector_Factory_Development\meltano-backend>
v
Your tap is a custom tap which is why our advice isn't working (normally when someone says tap-postgres they mean the defaults here https://hub.meltano.com/extractors/tap-postgres You're missing the settings block here https://docs.meltano.com/tutorials/custom-extractor/#2-edit-your-existing-meltanoyml-file
1
s
Yes I took it from MeltanoLab and installed on my system using
meltano install extractor tap-postgres
https://github.com/MeltanoLabs/tap-postgres
If I want to set the configurations via environment variables then also I need the
settings:
section for tap-postgres ??
r
Yes, Meltano won't know what configuration your custom plugin accepts until you define
settings
.
👍 1