Uncaught unspecified "error" event
Hi, I am getting this error and I am unable to trace it because it occurs rarely.
TypeError: Uncaught, unspecified "error" event.
at TypeError (<anonymous>)
at EventEmitter.emit (events.js:74:15)
at Handshake._callback (/var/app/current/node_modules/sequelize/lib/dialects/mysql/connector-manager.js:286:19)
at Handshake.Sequence.end (/var/app/current/node_modules/mysql/lib/protocol/sequences/Sequence.js:75:24)
at Protocol.handleNetworkError (/var/app/current/node_modules/mysql/lib/protocol/Protocol.js:238:14)
at Connection._handleNetworkError (/var/app/current/node_modules/mysql/lib/Connection.js:155:18)
at Socket.EventEmitter.emit (events.js:117:20)
at net.js:830:16
at process._tickDomainCallback (node.js:459:13)
Thanks in advance. Waqas Ahmed
You're having a network connection during error. You get no information because sequelize is throwing strings, not error objects, but is awful: https://github.com/sequelize/sequelize/blob/v2.0.0-dev11/lib/dialects/mysql/connector-manager.js#L307 You need to apparently attach some error listener to their connector. I've never used sequelize, though, so I don't know how to do that. You'll want to open an issue there if you don't know how to catch the errors it's emitting.
The point is why there is a connection error on host server like amazon ? My website is deployed on amazon elasticbeaskstalk.
People have made many issues in here and other MySql libraries in other languages with errors in amazon services, so it doesn't seem to be unheard of. I'm sure they have network issues just like anyone else.
P.S. I see from your other issue you got Error: getaddrinfo ENOTFOUND which is a DNS lookup issue. That is what I see people who use Amazon services complain about the most, so it seems to be a common issue among many people. I do not use Amazon, so I don't have any more insight.
FYI @waqas1991 your DNS issue may be a core issue (see https://github.com/joyent/node/issues/7729). It's possible your process is running out of file descriptors and apparently that can lead to Error: getaddrinfo ENOTFOUND for DNS lookups.