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
{{ message }}
Repository navigation
sequelize.sync does not return error if DB unavailable #1207
Yup! Wierd isn't it? As far as I can see it only happens when there is a failure to connect to the database. Other errors e.g. no permission to CREATE tables are emitted as expected.
I don't think it's a major issue as you can work around it by syncing a single model first to test the connection, and then doing the full sync.
I'm sure everyone has bigger fish to fry - I just figured it might be useful to post issues for any bugs I find so people have some vague background awareness...
It's not a major issue, but a minor annoyance ;) We're probably going to do a feature freeze for 1.7.0 now and get out a RC - So fixing a few bugs wouldn't hurt.
No, I'm afraid the problem is still there with 1.7.0-rc2 on MySQL
When there is more than one model to sync, neither success(), error() or done() is called and there is an uncaught exception.
When there is only one model, error()/done() is called, but there is still an uncaught exception as well.
Here's the error message (same stack trace whether there is one model or two):
TypeError: Uncaught, unspecified "error" event.
at TypeError (<anonymous>)
at EventEmitter.emit (events.js:74:15)
at Handshake._callback (/Programming/test/node_modules/sequelize/lib/dialects/mysql/connector-manager.js:278:19)
at Handshake.Sequence.end (/Programming/test/node_modules/mysql/lib/protocol/sequences/Sequence.js:75:24)
at Protocol.handleNetworkError (/Programming/test/node_modules/mysql/lib/protocol/Protocol.js:255:14)
at Connection._handleNetworkError (/Programming/test/node_modules/mysql/lib/Connection.js:187:18)
at Socket.EventEmitter.emit (events.js:117:20)
at net.js:441:14
at process._tickCallback (node.js:415:13)
NB the problem I describe doesn't happen if the db username/password are wrong, but when the database cannot be reached at all e.g. db server has crashed or connection details (port etc) are wrong
I'm experiencing this issue on Sequelize 1.7.9, but relatively recent versions of postgres (9.3.4-4, 9.1.13-4 are the ones I have tried), x86 and x86-64. I am on Windows 7 as well.
When I run sync without defining any models, it completes fine. When I define one model, it never calls back. I switched to node x86 and postgres x86 after a string of Assertion failed:0 issues referencing a g:\jenkins\workspace folder that does not exist. Unsolvable for me.
That is strange @Roam-Cooper. If you could provide a single self contained test file for @janmeier to try out that would be great (jan is the only one with a windoze box)
Activity
overlookmotel commentedon Jan 6, 2014
...on Sequelize 1.7.0-beta7, MySQL 5.6.14, OS X 10.8.5
mickhansen commentedon Jan 6, 2014
If you remove 1 of your 2 model definitions it will correctly emit a database error? Wth
overlookmotel commentedon Jan 6, 2014
Yup! Wierd isn't it? As far as I can see it only happens when there is a failure to connect to the database. Other errors e.g. no permission to CREATE tables are emitted as expected.
mickhansen commentedon Jan 7, 2014
Well hopefully it's reproduceable, i'll take a look at it :)
mickhansen commentedon Jan 7, 2014
But yeah connection errors are an issue in general it seems
overlookmotel commentedon Jan 7, 2014
I don't think it's a major issue as you can work around it by syncing a single model first to test the connection, and then doing the full sync.
I'm sure everyone has bigger fish to fry - I just figured it might be useful to post issues for any bugs I find so people have some vague background awareness...
mickhansen commentedon Jan 7, 2014
It's not a major issue, but a minor annoyance ;) We're probably going to do a feature freeze for 1.7.0 now and get out a RC - So fixing a few bugs wouldn't hurt.
mickhansen commentedon Jan 7, 2014
Issues that gives us a easily reproduceable test case are always more than welcome :)
mickhansen commentedon Jan 18, 2014
@overlookmotel This is with postgres right?
overlookmotel commentedon Jan 18, 2014
No, this was Sequelize 1.7.0-beta7, MySQL 5.6.14, OS X 10.8.5.
I'll update to rc2 and see if it's solved - will let you know.
overlookmotel commentedon Jan 18, 2014
No, I'm afraid the problem is still there with 1.7.0-rc2 on MySQL
When there is more than one model to sync, neither
success(),error()ordone()is called and there is an uncaught exception.When there is only one model,
error()/done()is called, but there is still an uncaught exception as well.Here's the error message (same stack trace whether there is one model or two):
mickhansen commentedon Jan 18, 2014
Hmm, i wasn't able to reproduce that with a unit test that matched your gist.
Could you perhaps try and create a PR with a failing unit test?
overlookmotel commentedon Jan 18, 2014
OK I'll try! Never wrote a unit test, or did a pull request!
It'll take me some time to figure it out...
overlookmotel commentedon Jan 18, 2014
Could you post your unit test here to give me a starting point?
mickhansen commentedon Jan 19, 2014
https://github.com/sequelize/sequelize/blob/master/test/sequelize.test.js#L420
Is the one where i identified an issue with PG atleast.
overlookmotel commentedon Jan 21, 2014
Pull request for a test: #1278
NB the problem I describe doesn't happen if the db username/password are wrong, but when the database cannot be reached at all e.g. db server has crashed or connection details (port etc) are wrong
sdepold commentedon Jan 21, 2014
Isn't this #1012 ?
mickhansen commentedon Jan 21, 2014
@sdepold dnu, but @overlookmotel provided an actual failing test case so i'll look at that :)
overlookmotel commentedon Jan 21, 2014
@sdepold Ah yes, you're right. Sorry, didn't notice the issue had already been reported.
sdepold commentedon Jan 22, 2014
No problem.
mickhansen commentedon Jan 22, 2014
Should be fixed by #1282
Roam-Cooper commentedon Jun 22, 2014
I'm experiencing this issue on Sequelize 1.7.9, but relatively recent versions of postgres (9.3.4-4, 9.1.13-4 are the ones I have tried), x86 and x86-64. I am on Windows 7 as well.
When I run sync without defining any models, it completes fine. When I define one model, it never calls back. I switched to node x86 and postgres x86 after a string of Assertion failed:0 issues referencing a g:\jenkins\workspace folder that does not exist. Unsolvable for me.
I can provide more details if necessary.
mickhansen commentedon Jun 23, 2014
That is strange @Roam-Cooper. If you could provide a single self contained test file for @janmeier to try out that would be great (jan is the only one with a windoze box)