-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blocker - Mongoose v4.9.9 hangs on call to connect() #5249
Comments
Same here, had to downgrade to v4.9.8 |
Same here. downgraded. |
Same issue. As a workaround, using promises resolved it for me. |
Hm, that's weird. The callback executes for me: const mongoose = require('mongoose');
const co = require('co');
mongoose.Promise = global.Promise;
const GITHUB_ISSUE = `gh-5249`;
exec();
function exec() {
mongoose.connect(`mongodb://localhost:27017/${GITHUB_ISSUE}`, function() {
co(function* () {
const schema = new mongoose.Schema({
name: String
});
const Model = mongoose.model('Model', schema);
yield Model.remove({});
const doc = yield Model.create({ name: 'test' });
console.log('successfully created doc');
}).catch(error => console.error(error));
});
} Can you try this script and see if it works? If not, could I see the context in which your |
Apologies, I apparently did not mention important information:
Here's a reproducible example: var mongoose = require('mongoose');
var bluebird = require('bluebird');
mongoose.Promise = bluebird;
var conn = 'mongodb://primary,secondary/test?replicaSet=test';
mongoose.connect(conn, function(err, result) {
console.error('Error:', err);
}); Notice that I don't even use a promise notation for the connect. |
I am having the issue and I connect to a replica set as well. I do not override the promise library, but promises are hanging. |
Fixed, my sincerest apologies for the trouble, some of the refactoring work for #5229 made it so that the callback to |
It simply hangs during the mongoose.connect() (callback is never called)
The text was updated successfully, but these errors were encountered: