{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/4883","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/4883/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/4883/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/4883/events","html_url":"https://github.com/sequelize/sequelize/issues/4883","id":117802833,"number":4883,"title":"Sequelize::sync causes warning: \"a promise was created in a  handler but was not returned from it\"","user":{"login":"cfogelberg","id":1623345,"avatar_url":"https://avatars.githubusercontent.com/u/1623345?v=3","gravatar_id":"","url":"https://api.github.com/users/cfogelberg","html_url":"https://github.com/cfogelberg","followers_url":"https://api.github.com/users/cfogelberg/followers","following_url":"https://api.github.com/users/cfogelberg/following{/other_user}","gists_url":"https://api.github.com/users/cfogelberg/gists{/gist_id}","starred_url":"https://api.github.com/users/cfogelberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfogelberg/subscriptions","organizations_url":"https://api.github.com/users/cfogelberg/orgs","repos_url":"https://api.github.com/users/cfogelberg/repos","events_url":"https://api.github.com/users/cfogelberg/events{/privacy}","received_events_url":"https://api.github.com/users/cfogelberg/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-19T12:19:02Z","updated_at":"2015-11-19T22:25:21Z","closed_at":"2015-11-19T12:21:44Z","body":"Calling Sequelize::sync for a pg DB or a mysql DB in 3.14.0 causes a warning log message, apart from the different dialect files the stack trace is the same:\r\n\r\n    Warning: a promise was created in a  handler but was not returned from it\r\n        at ConnectionManager.disconnect (/home/christo/repos/sequelize/playground/tests/10-sync-warning-repro/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:162:10)\r\n        at ConnectionManager.$disconnect (/home/christo/repos/sequelize/playground/tests/10-sync-warning-repro/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:257:41)\r\n        at /home/christo/repos/sequelize/playground/tests/10-sync-warning-repro/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:223:16\r\n    From previous event:\r\n        ...\r\n\r\nThis warning occurs for me in 3.14 but not in 3.13 (but that might just be because bluebird was updated to ^3.0.5 from ^2.10.1 between those two versions) with both pg and mysql. I haven't tried any other DB's. It doesn't matter whether `force: true` is passed as an option to sync or not.\r\n\r\nLooking at the code referred to by the call stack there isn't an obvious place where a Promise is created without being returned. Reading around about this problem though ([link1](https://github.com/petkaantonov/bluebird/issues/854), [link2](https://github.com/Automattic/mongoose/issues/3570)) it might be that the stack trace is misleading.\r\n\r\nThere is a repro [here](https://github.com/cfogelberg/sequelize-playground/tree/master/tests/10-sync-warning-repro), ([permanent link to this commit](https://github.com/cfogelberg/sequelize-playground/tree/32377a33974712ab48735571e761cf94857406fa/tests/10-sync-warning-repro))."},"comment":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/comments/158219836","html_url":"https://github.com/sequelize/sequelize/issues/4883#issuecomment-158219836","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/4883","id":158219836,"user":{"login":"faceleg","id":1000759,"avatar_url":"https://avatars.githubusercontent.com/u/1000759?v=3","gravatar_id":"","url":"https://api.github.com/users/faceleg","html_url":"https://github.com/faceleg","followers_url":"https://api.github.com/users/faceleg/followers","following_url":"https://api.github.com/users/faceleg/following{/other_user}","gists_url":"https://api.github.com/users/faceleg/gists{/gist_id}","starred_url":"https://api.github.com/users/faceleg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faceleg/subscriptions","organizations_url":"https://api.github.com/users/faceleg/orgs","repos_url":"https://api.github.com/users/faceleg/repos","events_url":"https://api.github.com/users/faceleg/events{/privacy}","received_events_url":"https://api.github.com/users/faceleg/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T22:25:21Z","updated_at":"2015-11-19T22:25:21Z","body":"Note I'm cleaning up postgres, the same thing will need to be fixed across dialects likely."}}