Closed cgfarmer4 closed 11 years ago
Hmm. 2.2 used a different command to get the stats, but that command had problems with single-db auth.
What Mongo version are you running?
mongodb: stable 2.2.3-x86_64
Was running 2.2.2 and tried upgrading but no change.
I just installed 2.2.3-x86_64 on my machine, and it works great. What happens if you run this in the mongo shell:
db.runCommand({dbStats:1})
So if i run it as such below, it seems to work. However opening the shell and running it, still fails. Odd behavior.
mongo somedb --eval "db.runCommand({dbStats:1})" MongoDB shell version: 1.4.0 url: somedb connecting to: somedb [object bson_object]
$ mongo MongoDB shell version: 1.4.0 url: test connecting to: test type "help" for help
use somedb switched to db somedb db.runCommand({dbStats:1}) { "errmsg" : "no such cmd", "bad cmd" : { "dbStats" : 1 }, "ok" : 0 }
Could it be your mongo shell version? Mine claims to be 2.4.1
(or 2.2.3
when I installed that).
MongoDB shell version: 2.4.1
connecting to: test
> db.runCommand({dbStats: 1})
{
"db" : "test",
"collections" : 0,
"objects" : 0,
"avgObjSize" : 0,
"dataSize" : 0,
"storageSize" : 0,
"numExtents" : 0,
"indexes" : 0,
"indexSize" : 0,
"fileSize" : 0,
"nsSizeMB" : 0,
"dataFileVersion" : {
},
"ok" : 1
}
MongoDB shell version: 2.4.1 connecting to: test Error while trying to show server startup warnings: no such cmd
db.runCommand({dbStats: 1}) { "errmsg" : "no such cmd", "bad cmd" : { "dbStats" : 1 }, "ok" : 0 }
Same error. Must be something with my mongo install and not the app. Not too worried about it. Downgraded and it does what I need. Thanks for the help.
I'd still like to make it work for people like you, so I'll keep looking into it :)
What platform are you running? Are you using any sort of auth, or restricted user? Any other info that might help me track this down?
OSX 10.7.5, full permissions.
This part worries me when I start the mongo shell.
Error while trying to show server startup warnings: no such cmd
Just on the off chance that it was the same issue (or related to) #100, do you mind upgrading to v2.3.4
and trying that out?
Upgraded. Same problem
Database command 'dbStats' failed: (errmsg: 'no such cmd'; bad cmd: '{"dbStats"=>true}'; ok: '0.0').
Boo. Okay. It was worth a shot.
Since you seem to be the only one affected by this, and since you have mongo shell issues in general, I'm going to assume this is an environment issue, not one caused by Genghis. I'm closing the issue, but feel free to reopen if you (or anyone else) runs into this elsewhere.
Database command 'dbStats' failed: (errmsg: 'no such cmd'; bad cmd: '{"dbStats"=>true}'; ok: '0.0').
Starting happening after upgrade from 2.2 => 2.3