Re: pg_upgrade - fe_sendauth: no password supplied

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Nick Renders" <postgres(at)arcict(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: pg_upgrade - fe_sendauth: no password supplied
Date: 2021-09-06 13:38:27
Message-ID: 3012844.1630935507@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Nick Renders" <postgres(at)arcict(dot)com> writes:
> [ pg_upgrade fails with ]
> connection to database failed: fe_sendauth: no password supplied
> could not connect to source postmaster started with the command:
> "/Library/PostgreSQL/11/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D
> "/Volumes/Postgres_Data/PostgreSQL/11/data" -o "-p 49156 -b -c
> listen_addresses='' -c unix_socket_permissions=0700 -c
> unix_socket_directories='/Volumes/Free/Upgrade'" start

> According to the documentation, the connection should be established
> with the data in the .pgpass file. Its contents look like this (the
> password has been changed) :
> localhost:49155:*:postgres:password1234
> localhost:49156:*:postgres:password1234

I think this is explained by this statement in the libpq documentation:

The host name localhost is also searched for when the connection is a
Unix-domain socket connection and the host parameter matches libpq's
default socket directory path.

pg_upgrade will use a Unix-domain socket (unless on Windows), but it
intentionally puts it in a non-default place --- we can see
unix_socket_directories='/Volumes/Free/Upgrade'
in your example. That's meant to ensure that outside clients can't
connect to the postmaster(s) during the upgrade, but it's not interacting
too well with this behavior of libpq.

I don't recall for sure, but I think you could have made this work
by putting the socket path (/Volumes/Free/Upgrade) instead of
"localhost" in the .pgpass file.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2021-09-06 14:13:07 Re: update non-indexed value is slow if some non-related index/fk are enabled
Previous Message PALAYRET Jacques 2021-09-06 12:50:55 PostgreSQL : column value filtering in Logical Replication