supabase: error connecting to server due to GSSAPI negotiation
Bug report
- [ X] I confirm this is a bug with Supabase, not with my own application.
- [ X ] I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
When connecting via pooling the following error is thrown:
psql: error: connection to server at "aws-0-ap-southeast-1.pooler.supabase.com" (52.77.146.31), port 6543 failed: received invalid response to GSSAPI negotiation:
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Previously when I first started the project a few days ago, this connection worked:
psql -h aws-0-ap-southeast-1.pooler.supabase.com -p 6543 -d postgres -U postgres.rkijdoxezclpigxoeacp
But suddenly, it doesn’t.
Only this works:
psql -h db.rkijdoxezclpigxoeacp.supabase.co -p 5432 -d postgres -U postgres
Tried the connection URI method on my application with similar outcomes.
Tested that: curl -6 https://ifconfig.co/ip and curl -4 https://ifconfig.co/ip both return ip addresses.
Expected behavior
Previously it is expected that connecting via psql -h aws-0-ap-southeast-1.pooler.supabase.com -p 6543 -d postgres -U postgres.rkijdoxezclpigxoeacp worked.
Screenshots
Most of the settings are at default.
System information
- OS: macOS
- Browser: Chrome / zshell
- psql (PostgreSQL) 17.0 (Homebrew)
Additional context
Add any other context about the problem here.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 3
- Comments: 18
If anyone ran into this, I found this SO post useful as it seems you need to be using Postgres 16 locally. Was able to fix with
brew install postgresql@16andbrew link --overwrite postgresql@16GSSAPI Negotiation Error in Supabase PostgreSQL Connections (SOLUTION)
Problem
You may encounter:
This occurs due to GSSAPI encryption incompatibility with Supabase’s pooler.
Solution
Add
gssencmode=disableto your connection settings.Connection Examples
Django
SQLAlchemy
psql Command
Upgrade PostgreSQL Client
Update PostgreSQL client to version 16+:
References
I fixed this issue on my system by upgrading postgreSQL 14.5 to 17.2. I’m on MacOS 15.2 (24C101) and using homebrew.
followed @NestorXX-XX suggestion (using
psql [host=...]and it worked for meEven after upgrading PostgreSQL to version 16, your system might still be using older versions internally.
One reliable solution is to remove all PostgreSQL versions except version 16 - this approach resolved the issue in my environment.
well still got the same issue as above notihing works