TylerBrock / mongo-hacker

MongoDB Shell Enhancements for Hackers
tylerbrock.github.io/mongo-hacker
MIT License
1.79k stars 235 forks source link

Error while trying to show server startup warnings #98

Closed kimsyversen closed 5 years ago

kimsyversen commented 10 years ago

$ mongo MongoDB shell version: 2.6.3 connecting to: test Mongo-Hacker 0.0.4 Error while trying to show server startup warnings: not authorized on admin to execute command { getLog: "startupWarnings" }

TylerBrock commented 10 years ago

This could be a nicer message but basically this is completely normal, you just need to login as you don't yet have permissions to call ismaster() to display the prompt. Would you like it better if we just showed the normal prompt until login under auth conditions?

kimsyversen commented 10 years ago

I'd love it :) Btw, thanks for making this. It's great!

TylerBrock commented 10 years ago

Ok cool, I think that is the right thing to do. Thanks Kim.

Quentin01 commented 10 years ago

I have this error, and also another error when I do a query

profile command failed: {
  "ok": 0,
  "errmsg": "not authorized on development to execute command { profile: -1.0 }",
  "code": 13
}

What are the roles needed to use all features of Mongo-hacker?

TylerBrock commented 10 years ago

@Quentin01 you can get around that by turning index paranoia off.

There are several built-in roles that allow you to read to profile collection, you can check them out here:

http://docs.mongodb.org/manual/reference/built-in-roles/

pathak333 commented 5 years ago

I have this error, when i try to connect with mongo shell to atlas cluster MongoDB server version: 4.0.5 Error while trying to show server startup warnings: user is not allowed to do action [getLog] on [admin.] MongoDB Enterprise Sandbox-shard-0:PRIMARY>

stennie commented 5 years ago

As of Mongo Hacker 0.0.16, show startupWarnings is handled by the mongo shell and I don't think it makes sense to override this behaviour.

Note: modern versions of the mongo shell will ignore some of the startup warnings that were originally reported when this issue was created in 2014 (see: mongo/shell/utils.js).