-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Query compiler displays confusing error message when connection cannot be established #28055
Copy link
Copy link
Open
Labels
bug/1-unconfirmedBug should have enough information for reproduction, but confirmation has not happened yet.Bug should have enough information for reproduction, but confirmation has not happened yet.kind/bugA reported bug.A reported bug.topic: @prisma/adapter-pgtopic: connectionstopic: errortopic: queryCompiler
Description
Bug description
Using the new prisma-client and the postgres db adapter, I got the following error message:
"PrismaClientKnownRequestError: ",
"Invalid `prisma.user.findUnique()` invocation:",
"",
"",
"",
" at di.handleRequestError (C:\\home\\site\\wwwroot\\functions\\node_modules\\@prisma\\client\\runtime\\client.js:81:7283)",
" at di.handleAndLogRequestError (C:\\home\\site\\wwwroot\\functions\\node_modules\\@prisma\\client\\runtime\\client.js:81:6608)",
" at di.request (C:\\home\\site\\wwwroot\\functions\\node_modules\\@prisma\\client\\runtime\\client.js:81:6315)",
" at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
" at async a (C:\\home\\site\\wwwroot\\functions\\node_modules\\@prisma\\client\\runtime\\client.js:90:9551)",
" at async AuthService.getUserById (file:///C:/home/site/wwwroot/functions/chunks/_/nitro.mjs:7008:12)",
" at async Query.user (file:///C:/home/site/wwwroot/functions/chunks/_/nitro.mjs:7408:12)"
]
Apart from the fact that it's triggered in the findUnique call, this doesn't contain any helpful information.
Patching prisma to simply rethrow the underlying exception in handleRequestError revealed that the connection string was wrong:
"AggregateError [EACCES]: ",
" at C:\\home\\site\\wwwroot\\functions\\node_modules\\pg-pool\\index.js:45:11",
" at process.processTicksAndRejections (node:internal/process/task_queues:105:5)",
" at async PrismaPgAdapter.performIO (file:///C:/home/site/wwwroot/functions/node_modules/@prisma/adapter-pg/dist/index.mjs:618:22)",
" at async PrismaPgAdapter.queryRaw (file:///C:/home/site/wwwroot/functions/node_modules/@prisma/adapter-pg/dist/index.mjs:568:30)",
" at async C:\\home\\site\\wwwroot\\functions\\node_modules\\@prisma\\client\\runtime\\client.js:71:12688",
" at async qn (C:\\home\\site\\wwwroot\\functions\\node_modules\\@prisma\\client\\runtime\\client.js:71:12527)",
" at async e.interpretNode (C:\\home\\site\\wwwroot\\functions\\node_modules\\@prisma\\client\\runtime\\client.js:71:30949)",
" at async e.interpretNode (C:\\home\\site\\wwwroot\\functions\\node_modules\\@prisma\\client\\runtime\\client.js:71:31373)",
" at async e.interpretNode (C:\\home\\site\\wwwroot\\functions\\node_modules\\@prisma\\client\\runtime\\client.js:71:32539)",
" at async e.run (C:\\home\\site\\wwwroot\\functions\\node_modules\\@prisma\\client\\runtime\\client.js:71:29816)",
Severity
Reproduction
No reproduction atm (happened on Azure)
Expected vs. Actual Behavior
See above
Frequency
Consistently reproducible
Does this occur in development or production?
Only in production (e.g., query engine, generated client)
Is this a regression?
No
Workaround
Patching prisma as above
Prisma Schema & Queries
// Add relevant schema.prisma snippet// Add relevant Prisma Client queryPrisma Config
// Add your `prisma.config.ts`Logs & Debug Info
// Debug logs here
Environment & Setup
- OS:
- Database:
- Node.js version:
Prisma Version
Latest
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug/1-unconfirmedBug should have enough information for reproduction, but confirmation has not happened yet.Bug should have enough information for reproduction, but confirmation has not happened yet.kind/bugA reported bug.A reported bug.topic: @prisma/adapter-pgtopic: connectionstopic: errortopic: queryCompiler