Hey friends! I am a newbie to DE coming from Anal...
# plugins-general
m
Hey friends! I am a newbie to DE coming from Analytics. Going through ‘Data Stacks for Fun and Non-Profit’ and trying to run elt workflow right now with:
meltano elt tap-spreadsheets-anywhere target-postgres
but i got this error:
Copy code
psycopg2.OperationalError: FATAL:  password authentication failed for user "postgres"
target-postgres           | 
meltano                   | Loading failed (1): (see above)
meltano                   | ELT could not be completed: Loader failed
ELT could not be completed: Loader failed
i had the same error when I was trying to run:
meltano add loader target-postgres --variant meltano
and unblocked via going to my pgcli and typing in:
grant all privileges on database ds4fnp to postgres;
Copy code
GRANT
Copy code
Installing loader 'target-postgres'...
Installed loader 'target-postgres'
got through that time. so re-ran the above command and still got the pw authentication error. Please advise. Thanks!
d
cc @andrew_stewart
@mindy_ng Let's start by checking out the exact configuration that
target-postgres
is invoked with:
Copy code
meltano config target-postgres list
Does that show the expected values for all settings?
m
Copy code
user [env: TARGET_POSTGRES_USER, PG_USERNAME, POSTGRES_USER] (default: 'warehouse') current value: 'postgres' (from `meltano.yml`)
password [env: TARGET_POSTGRES_PASSWORD, PG_PASSWORD, POSTGRES_PASSWORD] current value: 'warehouse' (default)
host [env: TARGET_POSTGRES_HOST, PG_ADDRESS, POSTGRES_HOST] (default: 'localhost') current value: '127.0.0.1' (from `meltano.yml`)
port [env: TARGET_POSTGRES_PORT, PG_PORT, POSTGRES_PORT] (default: 5502) current value: 5432 (from `meltano.yml`)
dbname [env: TARGET_POSTGRES_DBNAME, PG_DATABASE, POSTGRES_DBNAME] (default: 'warehouse') current value: 'ds4fnp' (from `meltano.yml`)
url [env: TARGET_POSTGRES_URL, PG_URL, POSTGRES_URL] current value: None (default)
	URL: Lets you set `user`, `password`, `host`, `port`, and `dbname` in one go using a `postgresql://` URI. Takes precedence over the other settings when set.
schema [env: TARGET_POSTGRES_SCHEMA, PG_SCHEMA, POSTGRES_SCHEMA] current value: None (default: '$MELTANO_EXTRACT__LOAD_SCHEMA')

To learn more about loader 'target-postgres' and its settings, visit <https://meltano.com/plugins/loaders/postgres--meltano.html>
d
OK that looks good. And you're actually running a local postgres server matching those specifications? Can you connect with it using a different tool? Like psql in your shell, or TablePlus on Mac?
m
TablePlus:
checked my port and server#. they are matching
does that help?
d
I assume the password matches as well?
It has a default setting of
warehouse
as you can see in that
meltano config target-postgres list
output
If you don't want it, add
password: ""
in
meltano.yml
under
config
m
ok. just did that. to make sure i have things straight: my target is postgres, which is my DB username, right?
d
The value for user is currently
postgres
. The name of the loader plugin is
target-postgres
If you run
meltano config target-postgres
(without
list
) you'll see exactly what JSON config target-postgres is instantiated with
m
in my psql, username postgres’ pw was not set to ‘warehouse’. that’s where im getting confused
i just ran the last command you gave me
and output is more clear than the first one
d
The first one is a lot more wordy but it does give me some useful information like whether the value is coming from your own
meltano.yml
or from the default value 🙂
m
looks like i thought the pw i set for postgres user was not what I thought and is actually ‘warehouse’. so ill change it and try to run the elt command again
d
Yeah, either unset the password using
meltano.yml
, or actually add a password on the postgres user
m
Copy code
meltano                   | Extract & load complete!
meltano                   | Transformation skipped.
Sucess!
d
🥳
m
i owe you 😀
d
Haha, not at all, glad I could help, and hope you'll be a happy Meltano user!
m
i switched my user to ds4fnp since postgres user and target-postgres was tripping me up
d
Good call
m
alright, pressing on 🙂