mongoc-shard-00-00-wddpo(mongos-3.6.0)[mongos] mydb> sh.status() printStackTrace@src/mongo/shell/utils.js:73:15 DBCollection.prototype.aggregate@/Users/jondoe/.mongorc.js:98:13 sh.getRecentMigrations@/Users/jondoe/.mongorc.js:1388:28 printShardingStatus@/Users/jondoe/.mongorc.js:1497:30 sh.status@src/mongo/shell/utils_sh.js:89:5 @(shell):1:1 2017-12-12T16:31:59.985+0100 E QUERY [thread1] uncaught exception: aggregate failed: { "ok": 0, "errmsg": "The 'cursor' option is required, except for aggregate with the explain argument", "code": 9, "codeName": "FailedToParse", "$clusterTime": { "clusterTime": Timestamp(1513092719, 27), "signature": { "hash": BinData(0, "Ok0isqe1nHr+D/I9344pcNdxapA="), "keyId": NumberLong("6496824061736255491") } }, "operationTime": Timestamp(1513092719, 27) }
When running sh.status on an Atlas Cluster, I get the following Exceptionmongoc-shard-00-00-wddpo(mongos-3.6.0)[mongos] mydb> sh.status() printStackTrace@src/mongo/shell/utils.js:73:15 DBCollection.prototype.aggregate@/Users/jondoe/.mongorc.js:98:13 sh.getRecentMigrations@/Users/jondoe/.mongorc.js:1388:28 printShardingStatus@/Users/jondoe/.mongorc.js:1497:30 sh.status@src/mongo/shell/utils_sh.js:89:5
Hi Medhi,
Based on this stack trace it looks like you are running Mongo Hacker, which overrides sh.status()
and some other built-in functions in the mongo shell. It looks like Mongo Hacker needs to be updated for full compatibility with newer MongoDB server versions.
Try starting the mongo shell without any extensions: mongo --norc
.
If the sh.status()
command works as expected please file an issue in the mongo-hacker project on GitHub (which is unaffiliated with MongoDB): https://github.com/TylerBrock/mongo-hacker/issues.
If you are still having issues after starting mongo
with no shell extensions, please confirm the shell version reported by version()
.
Thanks,Stennie