edge-data-latency
edge-data-latency copied to clipboard
Supabase w/ Prisma ORM & Drizzle sometimes fails with 500 errors
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:
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?
⨯ 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
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:
- Before:
postgres://postgres.oxlykxtvjloaxlizpwti:[email protected]:5432/postgres - After:
postgres://postgres.oxlykxtvjloaxlizpwti:[email protected]:5432/postgres?pgbouncer=true
More context in this issue: https://github.com/prisma/prisma/issues/11643