Switched to pooled connection, but still seeing `prepared statement XXXX` does not exist.
Hi, I am using the pooled connection string combined with Drizzle.
I am using the latest Neon packages and Drizzle packages.
Sentry is reporting some calls are 400'ing to
https://api.us-east-1.aws.neon.tech/sql
Weirdly, the TRPC responses that initiate the downstream Neon calls are coming back as 200 on the front-end, but intermediate batched queries appear to snag a 400 sometimes.
Is this intended with the new PGBouncer change? Worth noting I am not explicitly using .prepare statements, but I believe Postgres.js (which Drizzle might use under the hood...?) will auto convert certain statements to prepare.5 Replies
eastern-cyan•2y ago
@minty sorry to hear you're having trouble! Can you share any of the error messages associated with the 400 responses from
api.us-east-1.aws.neon.tech/sql
Did this only start happening after a certain date and time?harsh-harlequinOP•2y ago
This happened after we switched back to pooled connection strings this afternoon
I will try to get some logs, one sec
some other info:
prepared statement "s7971" does not exist is one instance of the error
Is there a way you recommending debugging the error messages? Since it is far down in the stack I am not entirely sure where to look
Sentry shows 400's within spans on requests to Neon, but I cannot see the actual response
here is my relevant DB code, if it's helpful:
DATABASE_URL is a -pooler string
We pass both TransactionalDb and NonTransactionalDb instances into our TRPC context (deferring to TransactionalDb unless we need transactions)eastern-cyan•2y ago
Is one of these instances generating the error, or are both?
We recently rolled out improvements to PgBouncer to support prepared statements, so prepared statements should be working with the
-pooler URL.
I wonder if @Conrad Ludgate or @jawj have some theories...
Actually, we just rolled out the prepared statements update everywhere today @minty. Can you keep an eye on your logs are let me know if the situation has improvedharsh-harlequinOP•2y ago
Will do, thanks!
eastern-cyan•2y ago
@minty all good now?