PgBouncer Error: prepared statement already exists
See original GitHub issueI am getting a following error: You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection: error: prepared statement "public.rate_limiter:undefined" already exists
.
It seems that the rejection happens during the creation of the limiter:
const rateLimiterHours1 = new RateLimiter.RateLimiterPostgres({
storeClient: pool,
points: 250,
duration: 3600,// 1 hour
tableName: 'public.rate_limiter',
keyPrefix: 'limiter_hours_1',
});
And I consume this limiter only in one place where it has a catch:
rateLimiterUnion.consume(ip) // union of 1 RateLimiterMemory and 1 RateLimiterPostgres
.then(_limiter => {
next();
})
.catch((_err) => {
console.log(_err)
next(new HTTP429Error())
});
Please feel free to let me know if if I can provide some additional details!
Issue Analytics
- State:
- Created 9 months ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Postgres - ERROR: prepared statement "S_1" already exists
This turned out to be a pgBouncer issue that occurs when using anything other than session pooling. We were using transaction pooling, which ......
Read more >prepared statement \"s0\" already exists when connecting to ...
Bug description. I'm connecting to postgres on digital ocean with pgbouncer as guided here: https://www.prisma.io/docs/concepts/database ...
Read more >prepared statement already exists - Google Groups
This is a cross-post to both pgbouncer and jooq lists, as I am unsure where in my stack I need to address this...
Read more >pgbouncer/pgbouncer - Gitter
Caused by: org.postgresql.util.PSQLException: ERROR: prepared statement "S_2" already exists can you help me?
Read more >Prepared statement already exists - PostgreSQL
I'm trying to use prepared statements in an application and I'm running into this error: "Query failed: prepared statement already exists".
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, thanks, I am closing this issue for now. I think, it is not related to this package. Feel free to reopen.
@harryn Thanks. I found a lot of similar issues with PGBouncer on the internet. Try
pg prepared statement error
orpgbouncer prepared statement already exists
search. I don’t share any here, since you better know what exactly should be checked.