Hi there, I recently turned on Fluid Compute in my project which uses Next.js and Supabase Postgres + Prisma ORM. I set up my Prisma like this:
generator client {
provider = "prisma-client-js"
previewFeatures = []
}
datasource db {
provider = "postgresql"
url = env("SUPABASE_POSTGRES_PRISMA_URL") // uses connection pooling
directUrl = env("SUPABASE_POSTGRES_URL_NON_POOLING") // uses a direct connection
}
And my keys are:
SUPABASE_POSTGRES_PRISMA_URL ="postgres://postgres.foo:bar@aws-0-us-east-1.pooler.supabase.com:6543/postgres?pgbouncer=true&connection_limit=1"
SUPABASE_POSTGRES_URL_NON_POOLING="postgres://postgres.foo:bar@aws-0-us-east-1.pooler.supabase.com:5432/postgres"
Recently I have started seeing this error quite often, after 1 year of never seeing it (and no code changes related to this):
Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 1)
at Hr.handleRequestError (/var/task/node_modules/@prisma/client/runtime/library.js:122:6999)
at Hr.handleAndLogRequestError (/var/task/node_modules/@prisma/client/runtime/library.js:122:6388)
at Hr.request (/var/task/node_modules/@prisma/client/runtime/library.js:122:6108)
at async l (/var/task/node_modules/@prisma/client/runtime/library.js:126:10298)
at async characterCount (/var/task/apps/web/.next/server/chunks/1576.js:860:21)
at async GET (/var/task/apps/web/.next/server/app/api/characters/total-pages/route.js:104:23)
at async /var/task/apps/web/.next/server/chunks/9854.js:4110:37 {
code: 'P2024',
clientVersion: '5.1.1',
meta: { connection_limit: 1, timeout: 10 }
}
So I’m curious, does turning on Fluid compute affect the behavior here?
Note that I have connection limit = 1 because of the advice in this article: Database connections | Prisma Documentation
Thank you!