sequelize: TimeoutError: ResourceRequest timed out at ResourceRequest._fireTimeout
What are you doing?
Trying to run basic CRUD operations
{
"username": "localhost@arun",
"password": "",
"database": "test",
"host": "localhost",
"dialect": "mysql",
"pool": {
"max": 5,
"min": 0
}
}
What do you expect to happen?
Run the code without any errors.
What is actually happening?
Server starts normally. After a few calls to the APIs, it stops the server and displays the following issue:
{ TimeoutError: ResourceRequest timed out at ResourceRequest._fireTimeout (C:\Users\arun-awnics\Documents\workspace\node-samples\mm-node\node_modules\generic-pool\lib\ResourceRequest.js:58:17) at Timeout.bound (C:\Users\arun-awnics\Documents\workspace\node-samples\mm-node\node_modules\generic-pool\lib\ResourceRequest.js:8:15) at ontimeout (timers.js:475:11) at tryOnTimeout (timers.js:310:5) at Timer.listOnTimeout (timers.js:270:5) name: ‘TimeoutError’ }
Dialect: mysql Dialect version: 2.15.0 Database version: 10.1.24-MariaDB Sequelize version: 4.22.5 Tested with latest release: No
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 19 (3 by maintainers)
Hi @sushantdhiman
I spoke with @mickhansen yesterday in slack and resolved this issue. I was using transactions in my GET methods but didn’t manage them properly. Hence the pool was getting filled with transactions and causing the issue.
Now I changed my code to look like this(without transactions):
It works fine now. You may close the issue. Thank you for your time.
{ SequelizeConnectionAcquireTimeoutError: Operation timeout at pool.acquire.catch.error (/www/wwwroot/doumi/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:282:52) name: ‘SequelizeConnectionAcquireTimeoutError’, parent: Error: Operation timeout at Timeout._timeout.setTimeout (/www/wwwroot/doumi/node_modules/sequelize-pool/lib/Deferred.js:19:19) at ontimeout (timers.js:436:11) at tryOnTimeout (timers.js:300:5) at listOnTimeout (timers.js:263:5) at Timer.processTimers (timers.js:223:10), original: Error: Operation timeout at Timeout._timeout.setTimeout (/www/wwwroot/doumi/node_modules/sequelize-pool/lib/Deferred.js:19:19) at ontimeout (timers.js:436:11) at tryOnTimeout (timers.js:300:5) at listOnTimeout (timers.js:263:5) at Timer.processTimers (timers.js:223:10) } There are occasional errors, and the only solution is to restart