petere / homebrew-postgresql

🐘 PostgreSQL formulae for the Homebrew package manager
295 stars 34 forks source link

unsupported frontend protocol 1234.5679 #51

Closed coriolinus closed 2 years ago

coriolinus commented 4 years ago

Using version 12.1 installed from this repo, I cannot connect to my databases:

$ psql -h localhost -U guest
Wed Nov 20 15:33:58 CET 2019
psql: error: could not connect to server: FATAL:  unsupported frontend protocol 1234.5679: server supports 2.0 to 3.0
$ psql --version
Wed Nov 20 15:34:05 CET 2019
psql (PostgreSQL) 12.1 (Homebrew petere/postgresql)

Using version 11.5 from standard homebrew, I can:

$ psql -h localhost -U guest
Wed Nov 20 15:45:49 CET 2019
psql (11.5, server 12.0)
WARNING: psql major version 11, server major version 12.
         Some psql features might not work.
Type "help" for help.

Somehow, the frontend protocol version string from this distribution is entirely broken.

petere commented 4 years ago

This appears to be an upstream bug in the PostgreSQL 12 client library. See discussion here: https://www.postgresql.org/message-id/flat/87h82kzwqn.fsf%40news-spur.riddles.org.uk

You might be able to work around this by setting GSSENCMODE=disable in the environment.

coriolinus commented 4 years ago

Hm, it definitely seems related, but that fix doesn't work:

$ GSSENCMODE=disable psql -h localhost
Wed Dec  4 14:01:27 CET 2019
psql: error: could not connect to server: FATAL:  unsupported frontend protocol 1234.5679: server supports 2.0 to 3.0
$ psql --version
Wed Dec  4 14:01:33 CET 2019
psql (PostgreSQL) 12.1
vhiairrassary commented 4 years ago

@petere To fix the issue I had to to set PGGSSENCMODE=disable and not GSSENCMODE=disable (as found in your link https://www.postgresql.org/message-id/flat/87h82kzwqn.fsf%40news-spur.riddles.org.uk).

@coriolinus PGGSSENCMODE=disable fixes the issue on my side until it is fixed upstream.

huxaiphaer commented 4 years ago

Where should we set it @vhiairrassary , in the environment variables ? I kindly suggest you specify for others for simplicity.

And thanks for link.

vhiairrassary commented 4 years ago

@huxaiphaer yes, PGGSSENCMODE=disable is an env. var. here: https://www.postgresql.org/docs/current/libpq-envars.html

petere commented 4 years ago

This should be fixed as of PostgreSQL 12.2.

kaliopane commented 4 years ago

I'm running PostgreSQL 12.2 and it's NOT fixed.

yogson commented 4 years ago

Any workarounds?

kaliopane commented 4 years ago

This issue should be reopened, because it is not fixed in 12.2. Furthermore, using a client such as DBeaver limits the utilization of environment variables. Currently I see no workaround.

petere commented 4 years ago

Sorry, the issue is still open. It's an upstream issue, so I'll keep it open until it's fixed there.

SarahHill0778 commented 4 years ago

Anyone know how to fix this issue in layman's terms? Not a programmer but needing to use postgresql through pgadmin and keep running into this error

br-dr3 commented 4 years ago

I don't know exactly the root cause, but I experienced this behaviour using pg_dump as well

PericlesTheo commented 4 years ago

it seems to have been fixed with 12.3

can someone else verify this?

tudor-pop commented 4 years ago

@PericlesTheo experienced today on 12.0...upgraded to 12.4 and I'll have to wait a couple of hours...it usually doesn't take long... if by tomorrow the issue does not happen, then I guess is fixed

tudor-pop commented 4 years ago

@PericlesTheo I think is fixed because I didn't encounter the issue anymore