edge-data-latency icon indicating copy to clipboard operation
edge-data-latency copied to clipboard

Supabase w/ Prisma ORM & Drizzle sometimes fails with 500 errors

Open nikolasburk opened this issue 1 year ago • 2 comments

The Supabase-based tests using Prisma ORM and Drizzle sometimes seem to fail with a 500 error.

The corresponding API route are api/supabase-prisma-node and api/supabase-drizzle-node.

When it breaks, this is the output in the browser console:

image

In these cases, the rendered chart areas stay empty.

@leerob would you be able to take a look at the logs for the above routes and see if there are any errors related to the Supabase DB or some other thing?

nikolasburk avatar May 03 '24 13:05 nikolasburk

⨯ PrismaClientUnknownRequestError: 
Invalid `prisma.employees.findMany()` invocation:
Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "42P05", message: "prepared statement \"s0\" already exists", severity: "ERROR", detail: None, column: None, hint: None }), transient: false })
at In.handl

leerob avatar May 09 '24 22:05 leerob

This may be related to Supabase's usage of pgBouncer.

@leerob can you append pgbouncer=true as a URL argument to the SUPABASE_DATABASE_URL?

For example:

More context in this issue: https://github.com/prisma/prisma/issues/11643

nikolasburk avatar May 10 '24 06:05 nikolasburk