2
votes

I am trying to launch a Mongodb instance as follows and running into error as below, how do I debug this?please provide guidance on how to fix this error

mongo automation --host machine40.scv.company.com -u admin -p passd

2018-05-15T21:11:30.346-0700 I ACCESS   [conn3] SCRAM-SHA-1 authentication failed for admin on automation from client 17.xxx.xxx.x:54756 ; UserNotFound: Could not find user admin@automation
1
add --authenticationDatabase automation or wherever you actually created the user. You're really "supposed to" create the user in the admin database, but you've created it in a different database so you need to specify which database that is.Neil Lunn
@Jeremyapple The command to connect to mongo server passes username as admin and password as passd, this user is being authenticated against automation database. The Mongo error shows that the user admin wasn't created under automation database Could not find user admin@automation. Use the database in which the username admin was created. Also, as Neil mentioned in the above comment use the new standard --authenticationDatabase automationmintekhab
Ex : mongo --port 27017 -u "myUserAdmin" -p "abc123" --authenticationDatabase "admin" Useful Link : stackoverflow.com/questions/4881208/…IftekharDani

1 Answers

4
votes

Please refer below step.

1) log into mongo console as super admin user.

mongo admin --host machine40.scv.company.com -u admin -p passd

2) Then check, is there any user call admin who can authenticate to access "automation" DB. Sample output given below

{
    "_id" : "XXXXXX",
    "user" : "admin",
    "db" : "automation",
    "roles" : [
        {
            "role" : "root",
            "db" : "automation"
        }
    ]
}