Error in connector: Error creating a database connection. (Operation timed out (mobc timeout))
See original GitHub issueBug description
Sometimes, due to DB connections limit, the client fails with this error:
Error in connector: Error creating a database connection. (Operation timed out (mobc timeout))
at PrismaClientFetcher.request (/home/nicosampler/develop/loan-system/node_modules/@prisma/client/runtime/index.js:78786:15)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async eval (webpack-internal:///./graphql/migration/resolver.ts:139:17)
(node:106069) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 75)
my DB configuration is like so: DATABASE_URL="mysql://someUser:somePass@host/db?connection_limit=10"
Note: connection_limit
How to reproduce
It happened to me when trying to create/update/delete several entities at the same time, for example:
const res = [largeArray]
res.forEach(async (client) => {
const createdClient = await context.prisma.client.create({data: {client}})
})
Expected behavior
The client should be able to recover from a timeout connection.
Environment & setup
- OS: Ubuntu
- Database: Mysql
- Node.js version: 14
- Prisma version: 2.11.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:44 (16 by maintainers)
Top Results From Across the Web
When connecting to my database I get a Connection Timed ...
A Connection Timed Out error occurs when the database's firewall won't allow you to connect to the database from your local machine or...
Read more >Cannot connect to PostgreSQL from client - Error timed out
In my experience, a connection timeout error is typically due to a windows/networking issue, for example a firewall on (or in front of)...
Read more >azure.core.exceptions.serviceresponseerror - You.com
Error in connector: Error creating a database connection. (Operation timed out (mobc timeout)) at PrismaClientFetcher.request ...
Read more >How to fix MongoDB connection timeout? - Bobcares
This error happens due to the wrong MongoDB server setting, bad connection parameters and much more.
Read more >Timeout expired messages when connecting to SQL Server
Before you start troubleshooting, check the prerequisites and go through the checklist. A timeout error means that a certain operation takes ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can reproduce this with a heroku database with connection limit of 10 and this simple script.
All timed out calls doesn’t recover. Connections in the heroku reaches max of 11 then it starts to give timeouts.
Reproduction: https://github.com/harshit-test-org/prisma-issue-4280
I am using the latest version of prisma (2.15.0). It’s throwing the new error (https://github.com/prisma/prisma-engines/pull/1515). But the error message doesn’t make sense. I have 150 connections as limit, 10 connections are used but it still fires an error:
The connection limit of my DB (postgres) is 180