pgcat icon indicating copy to clipboard operation
pgcat copied to clipboard

PGcat raises confusing error when client attempts to connect with GSSAPI encoding request

Open AndrewJackson2020 opened this issue 5 months ago • 4 comments

LDescribe the bug PGcat does not support GSSAPI encoding (which is fine) but by default psql will try to use GSSAPI when there is an entry available in klist. Normally when no GSSAPI encoded connection is available it will downgrade to an unencoded connection but with pgcat it will raise the following error message. The workaround is to specify the libc parameter gssencmode=disable but this workaround is not obvious from the error message that is presented to the client.

Problem

$ psql  'postgresql://postgres:postgres@hostname:6433/pgml'
psql: error: connection to server at "hostname" (xx.xx.x.xx), port 6433 failed: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.

Workaround

$ psql  'postgresql://postgres:postgres@hostname:6433/pgml?gssencmode=disable'
Timing is on.
psql (15.1, server 15.5)
Type "help" for help.

Expected behavior The client should be able to gracefully handle not being able to connect with GSSAPI encoding.

Graceful handling of gssapi encoding rejection

$ psql  'postgresql://postgres:postgres@hostname:6433/pgml'
Timing is on.
psql (15.1, server 15.5)
Type "help" for help.

Expected error when gssencmode=require

$ psql  'postgresql://postgres:postgres@hostname:6433/pgml?gssencmode=require'
psql: error: connection to server at "hostname" (xx.xx.x.xx), port 6433 failed: connection to server at "hostname" (xx.xx.x.xx), port 6433 failed: GSSAPI encryption required but was impossible (possibly no credential cache, no server support, or using a local socket)

Desktop

  • OS: Rocky9 Linux
  • Version
$ ./target/debug/pgcat --version
pgcat 1.1.2-dev4

AndrewJackson2020 avatar Sep 04 '24 15:09 AndrewJackson2020