user19868155
user19868155

Reputation:

"fe_sendauth: no password supplied" During pg_upgrade Process

I'm encountering an error "fe_sendauth: no password supplied" while attempting to run pg_upgrade to migrate from PostgreSQL 11 to 14. I've set up a .pgpass file with the password and configured the PGPASSFILE environment variable. During the execution of pg_upgrade, an error occurred while attempting to start the old server using the following command.


Performing Consistency Checks

Checking cluster versions ok

fe_sendauth: no password supplied

could not connect to source postmaster started with the command:

"/home/postgres/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "/home/postgres/data" -o "-p 5433 -b -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directories='/home/'" start


When initiating the server with this command locally, the PostgreSQL server starts up without any apparent issues with password authentication. However, when attempting to use pg_upgrade, the error persists.

I've attempted to replace "localhost" with the Unix socket directories in the pgpass file and have also tried setting both PGHOST and PG_UNIX_SOCKET_DIR environment variables, but the issue remains unresolved.

The pg_upgrade command I used: ./pg_upgrade --check --link (I exported all the env variables for data and bin directory, port, user and pgpassfile)

I don't want to change pg_hba.conf file to add a 'method' 'trust' for localhost.

I've explored various solutions online, but unfortunately, none of them have resolved the issue for me.

Upvotes: 0

Views: 2310

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 247270

pg_upgrade starts the servers on a different port and connects to them using Unix sockets. Your password file must match that, for example

localhost:*:*:postgres:mypassword

The alternative is to modify pg_hba.conf so that postgres is allowed to connect locally without a password.

Upvotes: 0

Related Questions