vercel-labs / function-database-latency

Visualize the latency of databases from Vercel Functions.
https://db-latency.vercel.app/
171 stars 29 forks source link

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

Open nikolasburk opened 4 months ago

nikolasburk commented 4 months ago

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?

leerob commented 4 months ago
⨯ 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
nikolasburk commented 4 months ago

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