prisma: Issues with PgBouncer on DigitalOcean - `CODE: 26000 ERROR: prepared statement \"PGBOUNCER_34\" does not exist`
Bug description
I use prisma 5.5.2, with pgbouncer=true in the connection string. I get the following error:
CODE: 26000 ERROR: prepared statement \"PGBOUNCER_34\" does not exist
max_prepared_statements is as default (0)
Strangely enough it used to work before with pgbouncer=true without any issues. The issue started a few hours ago. DigitalOcean is also investigating this meanwhile
How to reproduce
Using digitalocean postgres pool with prisma does not work.
Expected behavior
No response
Prisma information
N/A
Environment & setup
- OS: macOS or linux both not working
- Database: PostgreSQL
- Node.js version: 18 LTS
Prisma Version
5.5.2
About this issue
- Original URL
- State: open
- Created 8 months ago
- Reactions: 2
- Comments: 15 (4 by maintainers)
The server connection is fried at this point so it needs to be forcibly closed. There’s two ways of doing that:
RECONNECT
in pgbouncer its admin consoleIt very much sounds like max_prepared_statements is not actually set to 0. The PGBOUNCER_36 name for the prepared statement is only used by PgBouncer when max_prepared_statements is set to a non-zero value.
In case it’s useful to others. I opened a ticket to DO and they disabled prepared statements for pgBouncer. After they made the change, I had to add again
&pgbouncer=true
to the connection string, otherwise I was getting the usual error. Anyway, I’ll keep monitoring the situation in the upcoming days.Thanks all for your support.
@janpio
Yes, I am pretty sure. I only have 3 clients.
@JelteF I am not aware of any way to interact with pgBouncer directly on a managed database on DO. But I opened a ticket asking for help.
Thanks for your help!