pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_upgrade - fe_sendauth: no password supplied
2+ messages / 2 participants
[nested] [flat]

* pg_upgrade - fe_sendauth: no password supplied
@ 2021-09-06 07:51 Nick Renders <postgres@arcict.com>
  2021-09-06 13:38 ` Re: pg_upgrade - fe_sendauth: no password supplied Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Nick Renders @ 2021-09-06 07:51 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Hello,

I have been trying to use the pg_upgrade command to update a PostgreSQL 
11 environment to 13 on macOS 11.

I have followed the steps in the documentation, but the command always 
fails when trying to connect to the original database. This is the 
command that is sent:

	/Library/PostgreSQL/13/bin/pg_upgrade -b /Library/PostgreSQL/11/bin -B 
/Library/PostgreSQL/13/bin -d /Volumes/Postgres_Data/PostgreSQL/11/data 
-D /Volumes/Postgres_Data/PostgreSQL/13/data -p 49156 -P 49155 -U 
postgres -j 24 -v

And this is what is logged:

	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
	"/Library/PostgreSQL/11/bin/pg_ctl" -w -D 
"/Volumes/Postgres_Data/PostgreSQL/11/data" -o "" -m fast stop >> 
"pg_upgrade_server.log" 2>&1


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

The .pgpass file works without problems with the pg_dump and pg_restore 
commands, so I'm fairly certain its contents and privileges are set 
correctly.


The PostgreSQL documentation also mentions that you can update the 
pg_hba.conf file to use authentication method "peer". This has no effect 
either, however when I set it to "trust", the command goes through just 
fine.

So I have been able to do the upgrade, but I am still wondering why I 
got the error in the first place. Any idea why the .pgpass file isn't 
working with the pg_upgrade command?

Best regards,

Nick Renders





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: pg_upgrade - fe_sendauth: no password supplied
  2021-09-06 07:51 pg_upgrade - fe_sendauth: no password supplied Nick Renders <postgres@arcict.com>
@ 2021-09-06 13:38 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2021-09-06 13:38 UTC (permalink / raw)
  To: Nick Renders <postgres@arcict.com>; +Cc: pgsql-general@lists.postgresql.org

"Nick Renders" <postgres@arcict.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





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2021-09-06 13:38 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-09-06 07:51 pg_upgrade - fe_sendauth: no password supplied Nick Renders <postgres@arcict.com>
2021-09-06 13:38 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox