{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/mongoose/issues/3945","repository_url":"https://api.github.com/repos/Automattic/mongoose","labels_url":"https://api.github.com/repos/Automattic/mongoose/issues/3945/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/mongoose/issues/3945/comments","events_url":"https://api.github.com/repos/Automattic/mongoose/issues/3945/events","html_url":"https://github.com/Automattic/mongoose/issues/3945","id":138506078,"number":3945,"title":"MongoError: no mongos proxy available, after upgrading from 4.1.2 to 4.4.6","user":{"login":"aartiles","id":92608,"avatar_url":"https://avatars.githubusercontent.com/u/92608?v=3","gravatar_id":"","url":"https://api.github.com/users/aartiles","html_url":"https://github.com/aartiles","followers_url":"https://api.github.com/users/aartiles/followers","following_url":"https://api.github.com/users/aartiles/following{/other_user}","gists_url":"https://api.github.com/users/aartiles/gists{/gist_id}","starred_url":"https://api.github.com/users/aartiles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aartiles/subscriptions","organizations_url":"https://api.github.com/users/aartiles/orgs","repos_url":"https://api.github.com/users/aartiles/repos","events_url":"https://api.github.com/users/aartiles/events{/privacy}","received_events_url":"https://api.github.com/users/aartiles/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/Automattic/mongoose/milestones/97","html_url":"https://github.com/Automattic/mongoose/milestones/4.4.10","labels_url":"https://api.github.com/repos/Automattic/mongoose/milestones/97/labels","id":1661122,"number":97,"title":"4.4.10","description":"","creator":{"login":"vkarpov15","id":1620265,"avatar_url":"https://avatars.githubusercontent.com/u/1620265?v=3","gravatar_id":"","url":"https://api.github.com/users/vkarpov15","html_url":"https://github.com/vkarpov15","followers_url":"https://api.github.com/users/vkarpov15/followers","following_url":"https://api.github.com/users/vkarpov15/following{/other_user}","gists_url":"https://api.github.com/users/vkarpov15/gists{/gist_id}","starred_url":"https://api.github.com/users/vkarpov15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkarpov15/subscriptions","organizations_url":"https://api.github.com/users/vkarpov15/orgs","repos_url":"https://api.github.com/users/vkarpov15/repos","events_url":"https://api.github.com/users/vkarpov15/events{/privacy}","received_events_url":"https://api.github.com/users/vkarpov15/received_events","type":"User","site_admin":false},"open_issues":15,"closed_issues":0,"state":"open","created_at":"2016-03-23T01:55:44Z","updated_at":"2016-03-23T01:57:22Z","due_on":"2016-03-24T07:00:00Z","closed_at":null},"comments":7,"created_at":"2016-03-04T15:43:48Z","updated_at":"2016-03-23T13:47:59Z","closed_at":null,"body":"After upgrading from 4.1.2 to 4.4.6 we are randomly getting `MongoError: no mongos proxy available`.\r\nDowngrading to 4.1.2 makes it work stable.\r\n\r\nMongoDB cluster with 6 shards (Primary/Secondary/Arbiter each), 2 mongos and 3 config servers MongoDB v3.0.9\r\nNode.js v0.10.24\r\n\r\n**Options**\r\n```\r\n    options.server = {\r\n      auto_reconnect: true,\r\n      poolSize: 5,\r\n      socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 },\r\n      reconnectTries: 3000\r\n    };\r\n    options.replset = {\r\n      auto_reconnect: true,\r\n      poolSize: 5,\r\n      socketOptions: { keepAlive: 1, connectTimeoutMS : 30000 },\r\n      reconnectTries: 3000\r\n    };\r\n    options.mongos = true;\r\n``` \r\n\r\nThe connection string is something like this:\r\n```\r\nvar uri = \"mongodb://mongodb-streaming-mongos01.mymongo.com:15000,mongodb-streaming-mongos02.mymongo.com:15000/dbname\";\r\nvar db = mongoose.createConnection(uri, options);\r\n```\r\n\r\n**Stack trace**\r\n```\r\nMongoError: no mongos proxy available\r\nMongoError: no mongos proxy available\r\nat [object Object].State.pickServer (/data/home/socialb/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/mongos.js:192:33)\r\nat [object Object].Mongos.command (/data/home/socialb/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/mongos.js:595:33)\r\nat [object Object].Mongos.command (/data/home/socialb/node_modules/mongoose/node_modules/mongodb/lib/mongos.js:342:17)\r\nat executeCommand (/data/home/socialb/node_modules/mongoose/node_modules/mongodb/lib/db.js:298:19)\r\nat [object Object].Db.command (/data/home/socialb/node_modules/mongoose/node_modules/mongodb/lib/db.js:322:44)\r\nat [object Object].wrapped (/data/home/socialb/node_modules/newrelic/lib/instrumentation/mongodb.js:185:25)\r\nat count (/data/home/socialb/node_modules/mongoose/node_modules/mongodb/lib/collection.js:1963:13)\r\nat [object Object].Collection.count (/data/home/socialb/node_modules/mongoose/node_modules/mongodb/lib/collection.js:1923:44)\r\nat [object Object].wrapped (/data/home/socialb/node_modules/newrelic/lib/transaction/tracer/index.js:155:28)\r\nat [object Object].wrappedQuery (/data/home/socialb/node_modules/newrelic/lib/instrumentation/mongodb.js:218:53)\r\nat [object Object].wrapped [as count] (/data/home/socialb/node_modules/newrelic/lib/instrumentation/mongodb.js:188:22)\r\nat NativeCollection.(anonymous function) [as count] (/data/home/socialb/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js:124:26)\r\nat NodeCollection.count (/data/home/socialb/node_modules/mongoose/node_modules/mquery/lib/collection/node.js:46:19)\r\nat Query._count (/data/home/socialb/node_modules/mongoose/lib/query.js:1276:20)\r\nat /data/home/socialb/node_modules/mongoose/node_modules/kareem/index.js:156:8\r\nat /data/home/socialb/node_modules/mongoose/node_modules/kareem/index.js:18:7\r\nat wrapped (/data/home/socialb/node_modules/newrelic/lib/transaction/tracer/index.js:155:28)\r\nat process._tickDomainCallback (node.js:459:13)\r\nat process.wrappedFunction (/data/home/socialb/node_modules/newrelic/lib/transaction/tracer/index.js:245:51)\r\n```\r\n\r\nGiven the complexity of the topology and the random nature of the error we can't provide a test case."},"comment":{"url":"https://api.github.com/repos/Automattic/mongoose/issues/comments/200350894","html_url":"https://github.com/Automattic/mongoose/issues/3945#issuecomment-200350894","issue_url":"https://api.github.com/repos/Automattic/mongoose/issues/3945","id":200350894,"user":{"login":"enicholson","id":1942686,"avatar_url":"https://avatars.githubusercontent.com/u/1942686?v=3","gravatar_id":"","url":"https://api.github.com/users/enicholson","html_url":"https://github.com/enicholson","followers_url":"https://api.github.com/users/enicholson/followers","following_url":"https://api.github.com/users/enicholson/following{/other_user}","gists_url":"https://api.github.com/users/enicholson/gists{/gist_id}","starred_url":"https://api.github.com/users/enicholson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enicholson/subscriptions","organizations_url":"https://api.github.com/users/enicholson/orgs","repos_url":"https://api.github.com/users/enicholson/repos","events_url":"https://api.github.com/users/enicholson/events{/privacy}","received_events_url":"https://api.github.com/users/enicholson/received_events","type":"User","site_admin":false},"created_at":"2016-03-23T13:47:59Z","updated_at":"2016-03-23T13:47:59Z","body":"I'm encountering the same error using the mongodb driver directly after upgrading from 2.1.7 to 2.1.10.  It's intermittent/spontaneous and I haven't seen it on my dev system, so I can't give any repro advice."}}