vercel / vercel/storage

POSTGRES_URL_NON_POOLING error

Open
#775 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
595
Forks
101
Avg merge
2h 24m
Merged PRs (30d)
1

Description

I'm getting the below error while running a nextjs app, using postgresDB in vercel. It is working fine on server, getting this error only on localhost. I have increase the time to 30 seconds still getting the same error.

GET /api/user/snmbala@gmail.com 500 in 10645ms
(node:44061) Warning: Label 'Database Query Time' already exists for console.time()
(Use `node --trace-warnings ...` to show where the warning was created)
(node:44061) Warning: Label 'Database Query Time' already exists for console.time()
(node:44061) Warning: Label 'Database Query Time' already exists for console.time()
Error fetching user details: PrismaClientInitializationError: 
Invalid `prisma.user.findUnique()` invocation:


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: 17)
    at _n.handleRequestError (/Users/balamm/github/goalbook/app.goalbook/node_modules/@prisma/client/runtime/library.js:122:7227)
    at _n.handleAndLogRequestError (/Users/balamm/github/goalbook/app.goalbook/node_modules/@prisma/client/runtime/library.js:122:6235)
    at _n.request (/Users/balamm/github/goalbook/app.goalbook/node_modules/@prisma/client/runtime/library.js:122:5919)
    at async l (/Users/balamm/github/goalbook/app.goalbook/node_modules/@prisma/client/runtime/library.js:131:9116)
    at async GET (webpack-internal:///(rsc)/./app/api/user/[email]/route.ts:20:22)
    at async /Users/balamm/github/goalbook/app.goalbook/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:55778
    at async eO.execute (/Users/balamm/github/goalbook/app.goalbook/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:46527)
    at async eO.handle (/Users/balamm/github/goalbook/app.goalbook/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:57112)
    at async doRender (/Users/balamm/github/goalbook/app.goalbook/node_modules/next/dist/server/base-server.js:1352:42)
    at async cacheEntry.responseCache.get.routeKind (/Users/balamm/github/goalbook/app.goalbook/node_modules/next/dist/server/base-server.js:1562:40)
    at async DevServer.renderToResponseWithComponentsImpl (/Users/balamm/github/goalbook/app.goalbook/node_modules/next/dist/server/base-server.js:1482:28)
    at async DevServer.renderPageComponent (/Users/balamm/github/goalbook/app.goalbook/node_modules/next/dist/server/base-server.js:1908:24)
    at async DevServer.renderToResponseImpl (/Users/balamm/github/goalbook/app.goalbook/node_modules/next/dist/server/base-server.js:1946:32)
    at async DevServer.pipeImpl (/Users/balamm/github/goalbook/app.goalbook/node_modules/next/dist/server/base-server.js:921:25)
    at async NextNodeServer.handleCatchallRenderRequest (/Users/balamm/github/goalbook/app.goalbook/node_modules/next/dist/server/next-server.js:272:17)
    at async DevServer.handleRequestImpl (/Users/balamm/github/goalbook/app.goalbook/node_modules/next/dist/server/base-server.js:817:17)
    at async /Users/balamm/github/goalbook/app.goalbook/node_modules/next/dist/server/dev/next-dev-server.js:339:20
    at async Span.traceAsyncFn (/Users/balamm/github/goalbook/app.goalbook/node_modules/next/dist/trace/trace.js:154:20)
    at async DevServer.handleRequest (/Users/balamm/github/goalbook/app.goalbook/node_modules/next/dist/server/dev/next-dev-server.js:336:24)
    at async invokeRender (/Users/balamm/github/goalbook/app.goalbook/node_modules/next/dist/server/lib/router-server.js:173:21)
    at async handleRequest (/Users/balamm/github/goalbook/app.goalbook/node_modules/next/dist/server/lib/router-server.js:350:24)
    at async requestHandlerImpl (/Users/balamm/github/goalbook/app.goalbook/node_modules/next/dist/server/lib/router-server.js:374:13)
    at async Server.requestListener (/Users/balamm/github/goalbook/app.goalbook/node_modules/next/dist/server/lib/start-server.js:141:13) {
  clientVersion: '5.16.1',
  errorCode: undefined
}
Error fetching user details: PrismaClientInitializationError: 
Invalid `prisma.user.findUnique()` invocation:

Not sure what error i'm doing.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at app/api/user/[email]/route.ts:20 and inspect how the local POSTGRES_URL_NON_POOLING configuration is used for prisma.user.findUnique(). Reproduce the GET /api/user/snmbala@gmail.com request locally and compare the local connection setup with the working server setup; done means the request no longer times out fetching a pooled connection.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, postgresql, typescript
Domain
api, backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.