Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sAFuO-008XBc-BR for pgsql-general@arkaria.postgresql.org; Thu, 23 May 2024 21:23:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sAFuN-00GZbA-Qj for pgsql-general@arkaria.postgresql.org; Thu, 23 May 2024 21:23:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sAFuN-00GZb1-FN for pgsql-general@lists.postgresql.org; Thu, 23 May 2024 21:23:31 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sAFuI-001gBS-5R for pgsql-general@postgresql.org; Thu, 23 May 2024 21:23:30 +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 44NLNELB524371; Thu, 23 May 2024 17:23:14 -0400 From: Tom Lane To: "Peter J. Holzer" cc: pgsql-general@postgresql.org Subject: Re: expected authentication request from server, but received H In-reply-to: <20240523070649.7j6r2lidqrmhmr3o@hjp.at> References: <20240523070649.7j6r2lidqrmhmr3o@hjp.at> Comments: In-reply-to "Peter J. Holzer" message dated "Thu, 23 May 2024 09:06:49 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <524369.1716499394.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 23 May 2024 17:23:14 -0400 Message-ID: <524370.1716499394@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Peter J. Holzer" writes: > One of our users reports getting the error message > "expected authentication request from server, but received H" > when trying to connect to the database. That's very bizarre, and I don't recall any similar reports in the recent past. > Server is PostgreSQL 15.7 (Ubuntu 15.7-1.pgdg22.04+1) > I haven't been able to find out what client version they are using yet, > but I suspect it's quite old. It would definitely be interesting to find out what the client-side code is, including the openssl version being used. > We've been on 15.x for quite a while now and it did work until at least > a month ago, so I wouldn't expect an incompatible protocol change, > however, I think the upgrade from 15.6 to 15.7 was just last week, so > maybe something changed between these minor versions? A look at the release notes doesn't suggest that anything was changed in that area. But I wonder if your new build could differ in some other relevant way, such as being linked to a newer openssl version. > I'm especially intrigued by "received H". According to > https://www.postgresql.org/docs/current/protocol-message-formats.html > Byte1('H') could mark a Copy Out response or a Flush command. Both don't > make sense in that context. Yeah, that couldn't be a valid message type byte here. I guess that either (a) the TLS stuff is going wrong and delivering garbage data, or (b) libpq is somehow out of sync with the server, such that it's taking a data byte as a message type byte. I found a description of an ancient instance of (b) here: https://www.postgresql.org/message-id/flat/CAAZKuFaxdPccCs9%2B2hTbMM5iwPZP= 6C494sAVz6qZhOPcYSGkTQ%40mail.gmail.com Of course we fixed that a dozen years ago, and anyway that particular problem required a server that is in dire straits. regards, tom lane