{"issue":{"pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"state":"closed","milestone":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/cbedee4cc18f7b19c859e24939690897?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"cbedee4cc18f7b19c859e24939690897","url":"https://api.github.com/users/jeffallen6767","login":"jeffallen6767","id":1063272},"assignee":null,"updated_at":"2011-11-15T18:39:09Z","labels":[],"closed_at":"2011-11-10T11:05:09Z","comments":5,"url":"https://api.github.com/repos/christkv/node-mongodb-native/issues/366","body":"Hi, \r\n Thanks for the great module, it's worked great for us so far, but \r\nhere's a new problem we're having: \r\n\r\nwe've been using mongoose@2.2.3 which uses this driver\r\n\r\nWe've set-up: \r\n a primary dedicated server with a fail-over/backup \r\n\r\nwe connect like so: \r\nmongoDb = Mongoose.createSetConnection(\"mongodb:// \r\n<user>:<pass>@<domain>:<port>/<dbName>,mongodb://<user>:<pass>@<back- \r\nup-domain>:<port>/<dbName>\"); \r\n\r\nworks until we step-down the primary to test the fail-over then we \r\nget: \r\n============================================ checkMaster_::1 \r\n============================================ checkMaster_::3 \r\n============================================ checkMaster_::0::[ { \r\nhost: '<domain>', \r\n   port: '<port>', \r\n   options: {}, \r\n   internalMaster: true, \r\n   autoReconnect: [Getter], \r\n   connection: [Getter/Setter], \r\n   master: [Getter/Setter], \r\n   masterConnection: [Getter], \r\n   internalConnection: \r\n    { host: '<domain>', \r\n      port: '<port>', \r\n      autoReconnect: false, \r\n      drained: true, \r\n      messages: [], \r\n      sizeOfMessage: 0, \r\n      bytesRead: 0, \r\n      buffer: '', \r\n      stubBuffer: '', \r\n      _events: [Object], \r\n      connection: [Object], \r\n      receiveListener: [Function] } }, \r\n { host: '<back-up-domain>', \r\n   port: '<port>', \r\n   options: {}, \r\n   internalMaster: false, \r\n   autoReconnect: [Getter], \r\n   connection: [Getter/Setter], \r\n   master: [Getter/Setter], \r\n   masterConnection: [Getter], \r\n   internalConnection: \r\n    { host: '<back-up-domain>', \r\n      port: '<port>', \r\n      autoReconnect: false, \r\n      drained: true, \r\n      messages: [], \r\n      sizeOfMessage: 0, \r\n      bytesRead: 0, \r\n      buffer: '', \r\n      stubBuffer: '', \r\n      _events: [Object], \r\n      connection: [Object], \r\n      receiveListener: [Function] } } ] \r\n============================================ checkMaster_::1 \r\n============================================ checkMaster_::3 \r\nnode.js:134 \r\n       throw e; // process.nextTick error, or 'error' event on first \r\ntick \r\n       ^ \r\nError: Socket is not writable \r\n   at Socket._writeOut (net.js:391:11) \r\n   at Socket.write (net.js:377:17) \r\n   at [object Object].sendwithoutReconnect \r\n(/opt/unifi/node/tools/node_modules/mongoose/support/node-mongodb- \r\nnative/lib/mongodb/connection.js:158:27) \r\n   at /opt/unifi/node/tools/node_modules/mongoose/support/node-mongodb- \r\nnative/lib/mongodb/db.js:623:23 \r\n   at Array.forEach (native) \r\n   at [object Object].checkMaster_ \r\n(/opt/unifi/node/tools/node_modules/mongoose/support/node-mongodb- \r\nnative/lib/mongodb/db.js:601:31) \r\n   at [object Object].executeCommand \r\n(/opt/unifi/node/tools/node_modules/mongoose/support/node-mongodb- \r\nnative/lib/mongodb/db.js:546:12) \r\n   at [object Object].findOne \r\n(/opt/unifi/node/tools/node_modules/mongoose/support/node-mongodb- \r\nnative/lib/mongodb/collection.js:445:11) \r\n   at Array.<anonymous> \r\n(/opt/unifi/node/tools/node_modules/mongoose/lib/mongoose/drivers/node- \r\nmongodb-native/collection.js:65:25) \r\n   at EventEmitter._tickCallback (node.js:126:26) \r\n\r\nSo we tried updating to the latest mongoose, version:\r\n\r\nmongoose@2.3.0 ../node_modules/mongoose\r\n├── hooks@0.1.9\r\n├── colors@0.5.0\r\n└── mongodb@0.9.6-20\r\n\r\nran the same test, and now we get:\r\n\r\nnode.js:134\r\n       throw e; // process.nextTick error, or 'error' event on first tick\r\n       ^\r\nTypeError: Cannot call method 'getRequestId' of null\r\n   at [object Object].executeCommand\r\n(/opt/unifi/node/tools/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:764:48)\r\n   at Collection.update\r\n(/opt/unifi/node/tools/node_modules/mongoose/node_modules/mongodb/lib/mongodb/collection.js:421:26)\r\n   at Collection.save\r\n(/opt/unifi/node/tools/node_modules/mongoose/node_modules/mongodb/lib/mongodb/collection.js:343:10)\r\n   at Array.<anonymous>\r\n(/opt/unifi/node/tools/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js:66:25)\r\n   at EventEmitter._tickCallback (node.js:126:26)\r\n\r\nAny help is appreciated. \r\nThanks, \r\nJeff ","html_url":"https://github.com/christkv/node-mongodb-native/issues/366","title":"replication set failover error","number":366,"id":1850596,"created_at":"2011-10-08T00:28:49Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/cbedee4cc18f7b19c859e24939690897?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"cbedee4cc18f7b19c859e24939690897","url":"https://api.github.com/users/jeffallen6767","login":"jeffallen6767","id":1063272},"updated_at":"2011-11-15T18:39:09Z","url":"https://api.github.com/repos/christkv/node-mongodb-native/issues/comments/2749009","body":"sweet! thanks!","id":2749009,"created_at":"2011-11-15T18:39:09Z"}}