Chalama Reddy
02/27/2026, 4:25 PMMarvin
02/27/2026, 4:26 PMMarvin
02/27/2026, 4:31 PMserver_settings). It does not forward other connection options from the URL/query string, so Kerberos-specific options are not available to the listener.
References (source):
- Postgres listener implementation: https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/postgres_listener.py
- Database configuration (for comparison): https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/configurations.py
What this means
- Even if your main ORM connection to Postgres is working with Kerberos, the separate LISTEN/NOTIFY connection the listener establishes cannot be configured to use Kerberos today.
- The error you’re seeing (GSS failure “Server not found in Kerberos database”) typically requires setting Kerberos-related connection options (e.g., service principal), but the listener does not expose a way to pass those through.
Workarounds you can use now
- Allow password auth for the single listener connection only (keep Kerberos for your other connections). Postgres can accept multiple auth methods per host/database in pg_hba.conf.
- Put a proxy in front of Postgres (e.g., pgbouncer or stunnel) that authenticates to Postgres with Kerberos and presents a password/TLS endpoint to Prefect’s listener.
- Maintain a small fork/patch of Prefect to pass through extra asyncpg connect kwargs (e.g., from the DB URL query string or env vars) in get_pg_notify_connection() in postgres_listener.py.
Next steps
- If Kerberos for the listener is a hard requirement for you, I recommend opening a feature request so we can track and prioritize it. Here’s the link to start a new issue: https://github.com/PrefectHQ/prefect/issues/new/choose
- If you want, I can file the request for you with your environment details and error message.
If any of the above workarounds could work in your environment, let me know which direction you’d prefer and I can help with concrete steps.Chalama Reddy
02/27/2026, 4:34 PMMarvin
02/27/2026, 4:34 PMMarvin
02/27/2026, 4:35 PM