{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/7616","repository_url":"https://api.github.com/repos/sequelize/sequelize","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/7616/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/7616/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/7616/events","html_url":"https://github.com/sequelize/sequelize/issues/7616","id":227065853,"number":7616,"title":"Unhandled rejection SequelizeConnectionError: read ECONNRESET","user":{"login":"tongshouyu1019","id":20529477,"avatar_url":"https://avatars2.githubusercontent.com/u/20529477?v=3","gravatar_id":"","url":"https://api.github.com/users/tongshouyu1019","html_url":"https://github.com/tongshouyu1019","followers_url":"https://api.github.com/users/tongshouyu1019/followers","following_url":"https://api.github.com/users/tongshouyu1019/following{/other_user}","gists_url":"https://api.github.com/users/tongshouyu1019/gists{/gist_id}","starred_url":"https://api.github.com/users/tongshouyu1019/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tongshouyu1019/subscriptions","organizations_url":"https://api.github.com/users/tongshouyu1019/orgs","repos_url":"https://api.github.com/users/tongshouyu1019/repos","events_url":"https://api.github.com/users/tongshouyu1019/events{/privacy}","received_events_url":"https://api.github.com/users/tongshouyu1019/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-08T14:33:29Z","updated_at":"2017-05-11T15:10:16Z","closed_at":null,"body":"when call functions to insert or get data from mysql at the first time, i got this error, please help\r\n\r\n\"sequelize\": \"~3.21.0\", \"mysql\": \r\n\r\n> pool:{\r\n        maxConnections:10,\r\n        minConnections:1,\r\n        maxIdleTime:12000\r\n    },\r\n\r\n> Unhandled rejection SequelizeConnectionError: read ECONNRESET\r\n    at Quit._callback (/Users/tsy/devspace/builder/server/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:133:30)\r\n    at Quit.Sequence.end (/Users/tsy/devspace/builder/server/node_modules/mysql/lib/protocol/sequences/Sequence.js:96:24)\r\n    at Protocol.handleNetworkError (/Users/tsy/devspace/builder/server/node_modules/mysql/lib/protocol/Protocol.js:364:14)\r\n    at Connection._handleNetworkError (/Users/tsy/devspace/builder/server/node_modules/mysql/lib/Connection.js:421:18)\r\n    at emitOne (events.js:96:13)\r\n    at Socket.emit (events.js:188:7)\r\n    at emitErrorNT (net.js:1276:8)\r\n    at _combinedTickCallback (internal/process/next_tick.js:74:11)\r\n    at process._tickCallback (internal/process/next_tick.js:98:9)\r\nFrom previous event:\r\n    at ConnectionManager.disconnect (/Users/tsy/devspace/builder/server/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:130:10)\r\n    at ConnectionManager.$disconnect (/Users/tsy/devspace/builder/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:253:41)\r\n    at Object.destroy (/Users/tsy/devspace/builder/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:99:14)\r\n    at Pool.destroy (/Users/tsy/devspace/builder/server/node_modules/generic-pool/lib/generic-pool.js:193:17)\r\n    at Pool.removeIdle [as _removeIdle] (/Users/tsy/devspace/builder/server/node_modules/generic-pool/lib/generic-pool.js:224:10)\r\n    at Timeout._onTimeout (/Users/tsy/devspace/builder/server/node_modules/generic-pool/lib/generic-pool.js:248:12)\r\n    at ontimeout (timers.js:365:14)\r\n    at tryOnTimeout (timers.js:237:5)\r\n    at Timer.listOnTimeout (timers.js:207:5)\r\n"},"comment":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/comments/300819874","html_url":"https://github.com/sequelize/sequelize/issues/7616#issuecomment-300819874","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/7616","id":300819874,"user":{"login":"MRLuowen","id":7732448,"avatar_url":"https://avatars2.githubusercontent.com/u/7732448?v=3","gravatar_id":"","url":"https://api.github.com/users/MRLuowen","html_url":"https://github.com/MRLuowen","followers_url":"https://api.github.com/users/MRLuowen/followers","following_url":"https://api.github.com/users/MRLuowen/following{/other_user}","gists_url":"https://api.github.com/users/MRLuowen/gists{/gist_id}","starred_url":"https://api.github.com/users/MRLuowen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MRLuowen/subscriptions","organizations_url":"https://api.github.com/users/MRLuowen/orgs","repos_url":"https://api.github.com/users/MRLuowen/repos","events_url":"https://api.github.com/users/MRLuowen/events{/privacy}","received_events_url":"https://api.github.com/users/MRLuowen/received_events","type":"User","site_admin":false},"created_at":"2017-05-11T15:10:16Z","updated_at":"2017-05-11T15:10:16Z","body":"i met the same questIon,\r\nthe first , the program call  self.$disconnect(connection); in the function ConnectionManager.prototype.getConnection() of the file lib/dialect/connection-manager.js.\r\nthen, the error occour in lib/dualects/mysql/connection-manager.js\r\n`ConnectionManager.prototype.disconnect = function(connection) {\r\n  console.log(\"disconnect\",connection);\r\n  // Dont disconnect connections with an ended protocol\r\n  // That wil trigger a connection error\r\n  if (connection._protocol._ended) {\r\n    return Promise.resolve();\r\n  }\r\n\r\n  return new Promise(function (resolve, reject) {\r\n    connection.end(function(err) {\r\n      if (err) return reject(new sequelizeErrors.ConnectionError(err));   //this position\r\n      resolve();\r\n    });\r\n  });\r\n};`\r\ni‘m not sure why happen,maybe the connection is doing some other query？so .any body come with the same question,and solve it!!\r\ni need helps!"}}
{"actor":{"display_login":"MRLuowen"}}