# sh.status() error processing query: ns=config.mongosTree

if I run sh.status in mongos I get the error:

assert: command failed: {
"ok" : 0,
"errmsg" : "error processing query: ns=config.mongosTree: ping $gt new Date(1532712420740)\nSort: {}\nProj: {}\n No query solutions", "code" : 2 } : aggregate failed _getErrorWithCode@src/mongo/shell/utils.js:25:13 doassert@src/mongo/shell/assert.js:16:14 assert.commandWorked@src/mongo/shell/assert.js:290:5 DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1312:5 printShardingStatus@src/mongo/shell/utils_sh.js:611:13 sh.status@src/mongo/shell/utils_sh.js:78:5 @(shell):1:1 2018-07-27T11:28:05.644-0600 E QUERY [thread1] Error: command failed: { "ok" : 0, "errmsg" : "error processing query: ns=config.mongosTree: ping$gt new Date(1532712420740)\nSort: {}\nProj: {}\n No query solutions",
"code" : 2
} : aggregate failed :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
doassert@src/mongo/shell/assert.js:16:14
assert.commandWorked@src/mongo/shell/assert.js:290:5
DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1312:5
printShardingStatus@src/mongo/shell/utils_sh.js:611:13
sh.status@src/mongo/shell/utils_sh.js:78:5


I reinstalled all mongo-enterprise packages but still the error persist, all the shards are working correctly, since I can perform find from mongos.

thanks

• the mongo version is 3.2.20 – Willy Castillo Jul 30 '18 at 15:57
• I have 3 servers, on each server y have a mongod instance (3 shards and in each node have 1 replica set) I check and the sharding is working ok since I can perform inserts and find via mongos, but if i execute sh.status() I get the error described before, thanks – Willy Castillo Jul 30 '18 at 16:00

I was facing the same issue. It was becuase notablescan property enabled in my mongo config servers. After disable notablescan for config servers, command is working fine. you can check status of notablescan by running this command.

db.adminCommand( { getParameter: 1, notablescan: 1 } )


Output would be like below if notablescan is enabled.

{
"notablescan": true,
"ok": 1
}


As I am able to see that you are getting the exit error code : 2

As MongoDB documented here The error code :2 signifies The specified options are in error or are incompatible with other options.

As per MongoDB documentation here The sh.status(), When run on a mongos instance, prints a formatted report of the sharding configuration and the information regarding existing chunks in a sharded cluster. The default behavior suppresses the detailed chunk information if the total number of chunks is greater than or equal to 20.

For further your ref here and here