You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unhandled rejection SequelizeConnectionError: read ECONNRESET
at Quit._callback (/Users/tsy/devspace/builder/server/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:133:30)
at Quit.Sequence.end (/Users/tsy/devspace/builder/server/node_modules/mysql/lib/protocol/sequences/Sequence.js:96:24)
at Protocol.handleNetworkError (/Users/tsy/devspace/builder/server/node_modules/mysql/lib/protocol/Protocol.js:364:14)
at Connection._handleNetworkError (/Users/tsy/devspace/builder/server/node_modules/mysql/lib/Connection.js:421:18)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at emitErrorNT (net.js:1276:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
From previous event:
at ConnectionManager.disconnect (/Users/tsy/devspace/builder/server/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:130:10)
at ConnectionManager.$disconnect (/Users/tsy/devspace/builder/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:253:41)
at Object.destroy (/Users/tsy/devspace/builder/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:99:14)
at Pool.destroy (/Users/tsy/devspace/builder/server/node_modules/generic-pool/lib/generic-pool.js:193:17)
at Pool.removeIdle [as _removeIdle] (/Users/tsy/devspace/builder/server/node_modules/generic-pool/lib/generic-pool.js:224:10)
at Timeout._onTimeout (/Users/tsy/devspace/builder/server/node_modules/generic-pool/lib/generic-pool.js:248:12)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
Reacted by Douglas Nassif Roma Junior, MRLuowen and Nishank Kumar
i met the same questIon,
the first , the program call self.$disconnect(connection); in the function ConnectionManager.prototype.getConnection() of the file lib/dialect/connection-manager.js.
then, the error occour in lib/dualects/mysql/connection-manager.js
ConnectionManager.prototype.disconnect = function(connection) {
console.log("disconnect",connection);
// Dont disconnect connections with an ended protocol
// That wil trigger a connection error
if (connection._protocol._ended) {
return Promise.resolve();
}
return new Promise(function (resolve, reject) {
connection.end(function(err) {
if (err) return reject(new sequelizeErrors.ConnectionError(err)); //this position
resolve();
});
});
};
i‘m not sure why happen,maybe the connection is doing some other query?so .any body come with the same question,and solve it!!
i need helps!
the current easy solve method is cancel run self.$disconnect(connection),but i'm not sure if there is bad effects~~~
when i grep getConnection().there are two situations call this func.transation and this one, i really wander why you need to end it when first get server connection~~~looking foward it ~~
Seems like when database server has already closed the connection, the client sequelize connection pool still holds that connection as ss -antup | grep 3306 shows
Unhandled rejection SequelizeDatabaseError: read ECONNRESET
at Query.formatError (D:\Projects\loankeeper\node_modules\sequelize\lib\dial
ects\mysql\query.js:222:16)
at Query.connection.query [as onResult] (D:\Projects\loankeeper\node_modules
\sequelize\lib\dialects\mysql\query.js:55:23)
at Connection._notifyError (D:\Projects\loankeeper\node_modules\mysql2\lib\c
onnection.js:218:25)
at Connection._handleFatalError (D:\Projects\loankeeper\node_modules\mysql2\
lib\connection.js:178:14)
at Connection._handleNetworkError (D:\Projects\loankeeper\node_modules\mysql
2\lib\connection.js:183:8)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
仍然报错在以下版本:
"sequelize": "^4.4.2",
"mysql2": "^1.4.0"
Hi,
I faced same issue. And here is how I fixed it for me.
This isn't related to upgrading the version of sequelize but some other service is interrupting you while making DB connection. In my case my WiFi connection was the responsible for this issue, it was stopping other service to make TCP connection, however sequelize need to make TCP connection.
I just disconnected the wifi and run the server.
Activity
MRLuowen commentedon May 11, 2017
i met the same questIon,
the first , the program call self.$disconnect(connection); in the function ConnectionManager.prototype.getConnection() of the file lib/dialect/connection-manager.js.
then, the error occour in lib/dualects/mysql/connection-manager.js
i‘m not sure why happen,maybe the connection is doing some other query?so .any body come with the same question,and solve it!!
i need helps!
the current easy solve method is cancel run self.$disconnect(connection),but i'm not sure if there is bad effects~~~
when i grep getConnection().there are two situations call this func.transation and this one, i really wander why you need to end it when first get server connection~~~looking foward it ~~
sushantdhiman commentedon May 14, 2017
Try updating to latest
v3and report if issue still existsMRLuowen commentedon May 18, 2017
sequelize:3.30.4, node: 7.9.0,mysql:2.13.0 .this promblem still exits,but it can work well except this error report
douglasjunior commentedon Jun 19, 2017
This promblem still exits.
The wait timeout for MySQL is
28800inShow variables like 'wait_timeout';I've tried setting up the sequelize pool idle to
10000, but it did not work.Raptor2000 commentedon Jun 21, 2017
Same problem with
v0y4g3r commentedon Jul 10, 2017
Same problem
Seems like when database server has already closed the connection, the client sequelize connection pool still holds that connection as
ss -antup | grep 3306showsQuantBull commentedon Sep 4, 2017
xdamman commentedon Sep 5, 2017
Might be related to #8133
XidongHuang commentedon Sep 7, 2017
I had a same problem, but it fixed when I updated
sequelizeto the latest version. So the versions I am using now aredouglasjunior commentedon Sep 18, 2017
For me it did not resolve after update.
linkypi commentedon Feb 7, 2018
Same problem
nishankkumar1994 commentedon Sep 22, 2018
Hi,
I faced same issue. And here is how I fixed it for me.
This isn't related to upgrading the version of
sequelizebut some other service is interrupting you while making DB connection. In my case my WiFi connection was the responsible for this issue, it was stopping other service to make TCP connection, howeversequelizeneed to make TCP connection.I just disconnected the wifi and run the server.
Worked for me!
VAIMORSS commentedon Nov 22, 2018
It might be related to the firewall!
vimmisinghani commentedon Jul 25, 2019
@XidongHuang Thanks.. issue solved
elharony commentedon Mar 18, 2020
Until now, I couldn't find a working solution, and the issues are closed. Why? :)
MaxGenash commentedon May 11, 2020
Encountered a similar problem.
Disabling the VPN helped to solve it
thegkops commentedon Mar 10, 2022
I am getting this error intermittently
chiderlin commentedon Sep 28, 2022
still facing the same issue running on cloud run (I think after connecting 28800)
ephys commentedon Sep 28, 2022
We haven't updated to mariadb 3 yet (#14379), try using
mariadb@^2.5.6instead