Authentication error

Hi everyone!
I can’t auth into m103-csrs
MongoDB Enterprise m103-csrs:PRIMARY> db.auth(“m103-admin”, “m103-pass”)
Error: Authentication failed.
0
MongoDB Enterprise m103-csrs:PRIMARY>
But at the same time am able to authorise into my replica set with same user and password.
All nodes of replica set and sharding configs are running
vagrant@m103:~$ ps aux | grep mongo
vagrant 29117 0.7 4.9 1619012 101960 ? Sl 11:51 0:09 mongod -f mongod-repl-1.conf
vagrant 29195 0.7 5.1 1548176 105996 ? Sl 11:51 0:09 mongod -f mongod-repl-2.conf
vagrant 29282 0.7 4.5 1546224 93800 ? Sl 11:51 0:09 mongod -f mongod-repl-3.conf
vagrant 29403 0.0 1.0 778688 21580 pts/5 SLl+ 11:53 0:00 mongo --port 27001 -u m103-admin -p xxxxxxxxx
vagrant 29410 0.7 4.4 1556472 91208 ? Sl 11:53 0:08 mongod -f csrs_1.conf
vagrant 29494 0.4 3.0 1178024 62024 ? Sl 11:53 0:05 mongod -f csrs_2.conf
vagrant 29533 0.4 2.9 1178028 60324 ? Sl 11:53 0:04 mongod -f csrs_3.conf
vagrant 29825 0.0 1.0 778692 20808 pts/0 Sl+ 12:10 0:00 mongo --port 26001

What have i missed? Help me please!!

Are you using the correct db? Try switching to the test and admin db before running db.auth().

1 Like

Using admin and test databases doesn’t help! :neutral_face:
Maybe there is something else I have missed.

Share both sequence of events in a screenshot

Elaborate on this… perhaps with a screenshot.

Have you created the user on config server?
If you are sure then try to login with that user

1 Like

You create credentials for each replica set. For this exercise, we’re using the same credentials, but you have to do it for each replica set. You may also have typed the username or password incorrectly during creation.

Guys, thanks for helping!
I just cleaned up db and repeated everything again and now it works. And I can authorise!
It seems you were right, and maybe I have misstyped my username or password while creation. Or, maybe, there were some other reason)
So, now I can proceed.

Closing this thread as the issue has been resolved.