bobthecow / genghis

The single-file MongoDB admin app
http://genghisapp.com
MIT License
1.45k stars 164 forks source link

Database command 'dbStats' failed #94

Closed cgfarmer4 closed 11 years ago

cgfarmer4 commented 11 years ago

Database command 'dbStats' failed: (errmsg: 'no such cmd'; bad cmd: '{"dbStats"=>true}'; ok: '0.0').

Starting happening after upgrade from 2.2 => 2.3

bobthecow commented 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?

cgfarmer4 commented 11 years ago

mongodb: stable 2.2.3-x86_64

Was running 2.2.2 and tried upgrading but no change.

bobthecow commented 11 years ago

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})
cgfarmer4 commented 11 years ago

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 }

bobthecow commented 11 years ago

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
}
cgfarmer4 commented 11 years ago

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.

bobthecow commented 11 years ago

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?

cgfarmer4 commented 11 years ago

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

bobthecow commented 11 years ago

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?

cgfarmer4 commented 11 years ago

Upgraded. Same problem

 Database command 'dbStats' failed: (errmsg: 'no such cmd'; bad cmd: '{"dbStats"=>true}'; ok: '0.0').
bobthecow commented 11 years ago

Boo. Okay. It was worth a shot.

bobthecow commented 11 years ago

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.