[JAVA-2545] Get stats query on shard router fails - "all servers down/unreachable" Created: 25/Jun/17  Updated: 27/Oct/23  Resolved: 06/Sep/17

Status: Closed
Project: Java Driver
Component/s: None
Affects Version/s: 3.4.2
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Dharshan Rangegowda Assignee: Ross Lawley
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mongod server version 3.2.12
Mongo driver 3.4.2



 Description   

Collection.getStats() query on shard router fails with following stack trace. Server names have been blanked out for privacy reasons.

127.0.0.1:27017. The full response is { "code" : 6, "ok" : 0.0, "errmsg" : "all servers down/unreachable when querying: serverxxx1-10314.servers.xxx.com:27019,serverxxx2-10315.servers.xxx.com:27019,server3-10316.servers.xxx.com:27019" }
25 Jun 2017 05:54:50,358 ERROR ~ com.mongodb.MongoCommandException: Command failed with error 6: 'all servers down/unreachable when querying: server1xxx-10314.servers.xx.com:27019,SG-server1-10315.servers.xxx.com:27019,SG-server2-10316.servers.xx.com:27019' on server 127.0.0.1:27017. The full response is { "code" : 6, "ok" : 0.0, "errmsg" : "all servers down/unreachable when querying: server1-10314.servers.xxx.com:27019,server2-10315.servers.xxx.com:27019,server3-10316.servers.xxx.com:27019" }
	at com.mongodb.connection.ProtocolHelper.getCommandFailureException(ProtocolHelper.java:115)
	at com.mongodb.connection.CommandProtocol.execute(CommandProtocol.java:114)
	at com.mongodb.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:168)
	at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:289)
	at com.mongodb.connection.DefaultServerConnection.command(DefaultServerConnection.java:176)
	at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:216)
	at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:187)
	at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:179)
	at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:92)
	at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:85)
	at com.mongodb.operation.CommandReadOperation.execute(CommandReadOperation.java:55)
	at com.mongodb.Mongo.execute(Mongo.java:836)
	at com.mongodb.Mongo$2.execute(Mongo.java:823)
	at com.mongodb.DB.executeCommand(DB.java:729)
	at com.mongodb.DBCollection.getStats(DBCollection.java:2197)
	at utils.MongoDBHelper2.getInstanceDBs(MongoDBHelper2.java:502)
	at controllers.MongoDBInstance.getDBStats(MongoDBInstance.java:519)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcc

Mongos logs from that invocation contain the following traces

5167:2017-06-25T05:54:50.080+0000 I ACCESS   [conn57435] Successfully authenticated as principal admin on admin
5168:2017-06-25T05:54:50.304+0000 I NETWORK  [conn57435] SyncClusterConnection connecting to [serverxxx1-10314.servers.xxx.com:27019]
5169:2017-06-25T05:54:50.306+0000 I NETWORK  [conn57435] SyncClusterConnection connecting to [serverxxx1-10315.servers.xxx:27019]
5170:2017-06-25T05:54:50.309+0000 I NETWORK  [conn57435] SyncClusterConnection connecting to [serverxxx1-10316.servers.xxx:27019]
5171:2017-06-25T05:54:50.356+0000 I NETWORK  [conn57435] query on admin.$cmd: { query: "1", help: 1 } failed to: serverxxx1-10314.servers.xxx.com:27019 (10.117.5.208) exception: "query" had the wrong type. Expected Object, found String
5172:2017-06-25T05:54:50.356+0000 I NETWORK  [conn57435] query on admin.$cmd: { query: "1", help: 1 } failed to: serverxxx1-10315.servers.xxx.com:27019 (10.117.11.217) exception: "query" had the wrong type. Expected Object, found String
5173:2017-06-25T05:54:50.356+0000 I NETWORK  [conn57435] query on admin.$cmd: { query: "1", help: 1 } failed to: serverxxx1-10316.servers.xxx.com:27019 (10.117.4.136) exception: "query" had the wrong type. Expected Object, found String



 Comments   
Comment by Ross Lawley [ 26/Jun/17 ]

Hi dharshanr@scalegrid.net,

I'm not sure this is a Java driver issue - the MongoS sent an error back to the Java driver with a "all servers down/unreachable when querying" error message. Seems from the MongoS logs that there may be some incompatibility / version issues between the MongoS and the MongoDs.

All the best,

Ross

Generated at Thu Feb 08 08:57:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.