Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mNEpn-0007KQ-U3 for pgsql-general@arkaria.postgresql.org; Mon, 06 Sep 2021 13:38:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mNEpl-0007VN-IJ for pgsql-general@arkaria.postgresql.org; Mon, 06 Sep 2021 13:38:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mNEpl-0007VE-9V for pgsql-general@lists.postgresql.org; Mon, 06 Sep 2021 13:38:49 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mNEpg-0003a9-Hp for pgsql-general@lists.postgresql.org; Mon, 06 Sep 2021 13:38:48 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 186DcRfg3012845; Mon, 6 Sep 2021 09:38:27 -0400 From: Tom Lane To: "Nick Renders" cc: pgsql-general@lists.postgresql.org Subject: Re: pg_upgrade - fe_sendauth: no password supplied In-reply-to: <0AEF45A3-8E3C-424E-B746-189AE19B2D3E@arcict.com> References: <0AEF45A3-8E3C-424E-B746-189AE19B2D3E@arcict.com> Comments: In-reply-to "Nick Renders" message dated "Mon, 06 Sep 2021 09:51:21 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3012843.1630935507.1@sss.pgh.pa.us> Date: Mon, 06 Sep 2021 09:38:27 -0400 Message-ID: <3012844.1630935507@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Nick Renders" 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