sqitchers / sqitch

Sensible database change management
https://sqitch.org
MIT License
2.77k stars 215 forks source link

.pgpass not picked up when database is connected to via ssh #770

Closed plrtn closed 1 year ago

plrtn commented 1 year ago

I am running into an issue where I am unable to provide password via .pgpass. This is the message I ran into when executing sqitch status:

fe_sendauth: no password supplied

The following is the sqitch.conf file:

[core]
    engine = pg
    plan_file = sqitch.plan
    top_dir = .
[engine "pg"]
    target = db:pg://postgres@ip:port/dbname
    registry = sqitch
    client = psql

To ensure that I am able to get a connection altogether, I tried the method of last resort of putting the password into the URI. It worked.

I did the following to ensure that the .pgpass was correct:

However I am still not able to create a connection. I searched the mailing list and did not find anything that would help. Any assistance is appreciated.

theory commented 1 year ago

Can you connect via psql? If you’re connecting over ssh, your .pgpass file must be on the remote host.

plrtn commented 1 year ago

Can you connect via psql?

Yes via password authentication.

If you’re connecting over ssh, your .pgpass file must be on the remote host.

Make sense, however, that would not be ideal. What is your recommendation to using Sqitch with passwords? Due to organizational policy I do not have the ability to switch to password-less auth.

Thanks for the help.

theory commented 1 year ago

What was the fix, @plrtn?