P
Prismaā€¢2mo ago
Jay

Prisma Accelerate: ConnectorError. SUPABASE

[2024-05-21T05:34:31.404Z] GET http://localhost:3001/api/banners Error fetching Banners: Invalid prisma.banner.findMany() invocation: Error occurred during query execution: ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "42P05", message: "prepared statement "s2" already exists", severity: "ERROR", detail: None, column: None, hint: None }), transient: false }) UNKNOWN
5 Replies
Jay
Jayā€¢2mo ago
DATABASE_URL=postgres://postgres.lsxwnndvcppunnpvxcij:@aws-0-ap-southeast-1.pooler.supabase.com:6543/postgres?pgbouncer=true&connection_limit=1
DATABASE_URL=postgres://postgres.lsxwnndvcppunnpvxcij:@aws-0-ap-southeast-1.pooler.supabase.com:6543/postgres?pgbouncer=true&connection_limit=1
this is the transaction url from supabase not session should i use session for this? After some time it just work idk why and some time it does not
Nurul
Nurulā€¢2mo ago
Hey @Jay šŸ‘‹ Can you try using Accelerate with the non-pooled connection string provided by Supabase (the one with port 5432) and check if you get the same error?
Jay
Jayā€¢2mo ago
I tried. cant reach database supabase prisma accelerate
197 shopItemId: number
198 ): Promise<PromotionItem | null> {
199 // Fetch all ongoing promotion items for the given shop item ID
ā†’ 200 const promotionItems = await this.prisma.promotionItem.findMany(
Can't reach database server at `aws-0-ap-southeast-1.pooler.supabase.com:5432`

Please make sure your database server is running at `aws-0-ap-southeast-1.pooler.supabase.com:5432`. UNKNOWN
197 shopItemId: number
198 ): Promise<PromotionItem | null> {
199 // Fetch all ongoing promotion items for the given shop item ID
ā†’ 200 const promotionItems = await this.prisma.promotionItem.findMany(
Can't reach database server at `aws-0-ap-southeast-1.pooler.supabase.com:5432`

Please make sure your database server is running at `aws-0-ap-southeast-1.pooler.supabase.com:5432`. UNKNOWN
I got different error now im using prisma accelerate but with normal connection to db with pgbouncer=true just work but I want to use prisma accelreate
Nurul
Nurulā€¢2mo ago
@Jay Can you share with me the connection string format that you provided while creating the environment on your Acclerate project. Had you passed ?pgbouncer=true in the connection string?
Jay
Jayā€¢2mo ago
Yes I did but now i got different error {"name":"Error","message":"Error retrieving shop items: \nInvalid prisma.shopItem.count() invocation:\n\n\nThis request could not be understood by the server: {"type":"UnknownJsonError","body":{"code":"P6008","message":"Accelerate was not able to connect to your database. The underlying error is: "}} (The request id was: 88bd196649a27dc1)"}