Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

authentication fails #150

Open
kurktchiev opened this issue Mar 10, 2015 · 7 comments
Open

authentication fails #150

kurktchiev opened this issue Mar 10, 2015 · 7 comments

Comments

@kurktchiev
Copy link

Seems no matter what I do when i pass in a -u and a -p I keep getting:
CRITICAL - General MongoDB Error: command SON([('authenticate', 1), ('user', u'admin'), ('nonce', u'b2e8a643682ce8fc'), ('key', u'eaa1cc360ee11f47cd7a722ff46e7f13')]) on namespace admin.$cmd failed: auth fails

But if I run: mongo and then, use admin, db.auth("blah","blah") it works as expected. Not sure what I am doing wrong.

@emanuelis
Copy link

+1

@rgevaert
Copy link

Are you using mongodb 3.0? Many things changed and you need to update pymongo to a newer version.

@kurktchiev
Copy link
Author

I am using mongo 2.4.6 on RHEL 6.

@tzhroth3
Copy link

I am using pymongo 3.0.2 on ubuntu 14.04 with mongodb > 3.
Still get an error:
General MongoDB Error: command SON([('saslStart', 1), ('mechanism', 'SCRAM-SHA-1'), ('payload', Binary('n,,n=Auser,r=SDASDASDASD', 0)), ('autoAuthorize', 1)]) on namespace admin.$cmd failed: Authentication failed.

@und1sk0
Copy link

und1sk0 commented Sep 28, 2015

Getting this with pymongo 3.10, Shinken 2.4 with the updated Nagios plug-in on Ubuntu 12/Python 2.7.6, MongoDB 3.0.6.

@TDaltonC
Copy link

I'm getting a similar error with pyMongo 3.0 on Ubuntu trying to connect to MongoDB 2.4.9

@mhdali
Copy link

mhdali commented Jun 27, 2017

If you're using mongodb 3.4 like me then you need to change authSchema to 3 (default is 5)

mongo
use admin
db.system.users.remove({})
db.system.version.update({"_id": "authSchema"}, { "_id" : "authSchema", "currentVersion" : 3 })

restart mongodb

db.createUser({user: "nagios", pwd: "<PASSWORD>", roles: [ { "role" : "readAnyDatabase", "db" : "admin" }, { "role" : "clusterAdmin", "db" : "admin" } ]})

Don't forget to add admin user as well

refrence: https://stackoverflow.com/questions/29006887/mongodb-cr-authentication-failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants