Repository navigation
Description
What are you doing?
Just connect to the server and do normal CRUD operations.
{
"username": "SA",
"password": "Sl19840911*",
"database": "aliya",
"host": "192.168.0.66",
"dialect": "mssql",
"pool": {
"max": 20,
"min": 5,
"idle": 20000,
"acquire": 20000
}
}What do you expect to happen?
Just want the application can work continually
What is actually happening?
I check the application status everyday, and find this error everyday. The only way to make it work again is to restart the application.
Unhandled rejection TypeError: connectionLock.unwrap is not a function
at ConnectionManager.validate (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/sequelize/lib/dialects/mssql/connection-manager.js:149:39)
at ConnectionManager._validate (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:347:43)
at Pool._testOnBorrow (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/generic-pool/lib/Pool.js:163:45)
at Pool._dispense (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/generic-pool/lib/Pool.js:239:14)
at Pool.acquire (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/generic-pool/lib/Pool.js:449:10)
at promise.then (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:274:24)
From previous event:
at ConnectionManager.getConnection (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:273:20)
at Promise.try (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/sequelize/lib/sequelize.js:538:92)
From previous event:
at Sequelize.query (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/sequelize/lib/sequelize.js:445:23)
at QueryInterface.select (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/sequelize/lib/query-interface.js:1040:27)
at Promise.try.then.then.then (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/sequelize/lib/model.js:1565:34)
at runCallback (timers.js:781:20)
at tryOnImmediate (timers.js:743:5)
at processImmediate [as _immediateCallback] (timers.js:714:5)
From previous event:
at Function.findAll (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/sequelize/lib/model.js:1562:8)
at Function.findAndCount (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/sequelize/lib/model.js:1870:28)
at Object._callee$ (/Users/lushi/Documents/Aliya's Food/platform-backend/services/role_service.js:4:24)
at tryCatch (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:65:40)
at Generator.invoke [as _invoke] (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:303:22)
at Generator.prototype.(anonymous function) [as next] (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:117:21)
at step (/Users/lushi/Documents/Aliya's Food/platform-backend/services/role_service.js:51:191)
at /Users/lushi/Documents/Aliya's Food/platform-backend/services/role_service.js:51:437
at Promise ()
at Object. (/Users/lushi/Documents/Aliya's Food/platform-backend/services/role_service.js:51:99)
at Object.getAll (/Users/lushi/Documents/Aliya's Food/platform-backend/services/role_service.js:24:21)
at _callee$ (/Users/lushi/Documents/Aliya's Food/platform-backend/routes/role.js:10:41)
at tryCatch (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:65:40)
at Generator.invoke [as _invoke] (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:303:22)
at Generator.prototype.(anonymous function) [as next] (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:117:21)
at step (/Users/lushi/Documents/Aliya's Food/platform-backend/routes/role.js:20:191)
at /Users/lushi/Documents/Aliya's Food/platform-backend/routes/role.js:20:437
at Promise ()
at /Users/lushi/Documents/Aliya's Food/platform-backend/routes/role.js:20:99
at /Users/lushi/Documents/Aliya's Food/platform-backend/routes/role.js:8:1
at Layer.handle [as handle_request] (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/express/lib/router/layer.js:95:5)
at next (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/express/lib/router/layer.js:95:5)
at /Users/lushi/Documents/Aliya's Food/platform-backend/node_modules/express/lib/router/index.js:281:22
Dialect: mssql
tedious version: 2.1.1
Database version: SQL Server 2017 (RC1) - 14.0.800.90 (X64)
Sequelize version: 4.28.6
Tested with latest release: Yes, 4.28.6
Note : Your issue may be ignored OR closed by maintainers if it's not tested against latest version OR does not follow issue template.
Activity
sushantdhiman commentedon Jan 11, 2018
We can check if object that is being validated by pool is indeed a
connectionLocksequelize/lib/dialects/mssql/connection-manager.js
Line 149 in 1fff80f
shilu911 commentedon Jan 11, 2018
Hi @sushantdhiman , I was wondering if there is a workaround for now? I want to keep my app working instead of restarting it everyday. Thank you !
sushantdhiman commentedon Jan 12, 2018
You can override validate function yourself with config
pool.validatewhere you can checkconnection.unwrapexists before calling it.cedricVu commentedon Jan 15, 2018
Hi @sushantdhiman , I'm having the same problem. I did not get your idea. Could you please make it more clearly? Thanks
sushantdhiman commentedon Jan 15, 2018
@VictorVuSon you need to add a config
pool.validatelike thiscedricVu commentedon Jan 15, 2018
Big thanks to you @sushantdhiman