Lab: Deploy a Replica Set step 6 failure

Hi. can’t pass step 6 of the procedure.

My command is: mongo --host “m103-repl/localhost:27001” -u “m103-admin”-p “m103-pass” --authenticationDatabase “admin”

Response is:

MongoDB shell version v4.0.5
Enter password: 
connecting to: mongodb://localhost:27001/m103-pass?authSource=admin&gssapiServiceName=mongodb&replicaSet=m103-repl
2021-03-10T14:38:11.217+0000 I NETWORK  [js] Starting new replica set monitor for m103-repl/localhost:27001
2021-03-10T14:38:11.239+0000 I NETWORK  [js] Successfully connected to localhost:27001 (1 connections now open to localhost:27001 with a 5 second timeout)
2021-03-10T14:38:11.270+0000 I NETWORK  [js] Marking host localhost:27001 as failed :: caused by :: Location40659: can't connect to new replica set master [localhost:27001], err: AuthenticationFailed: Authentication failed.
2021-03-10T14:38:11.272+0000 I NETWORK  [js] Marking host localhost:27001 as failed :: caused by :: Location40659: can't connect to new replica set master [localhost:27001], err: AuthenticationFailed: Authentication failed.
2021-03-10T14:38:11.773+0000 I NETWORK  [js] Marking host localhost:27001 as failed :: caused by :: Location40659: can't connect to new replica set master [localhost:27001], err: AuthenticationFailed: Authentication failed.
2021-03-10T14:38:12.275+0000 I NETWORK  [js] Marking host localhost:27001 as failed :: caused by :: Location40659: can't connect to new replica set master [localhost:27001], err: AuthenticationFailed: Authentication failed.
2021-03-10T14:38:12.276+0000 E QUERY    [js] Error: can't authenticate against replica set node localhost:27001 :: caused by :: can't connect to new replica set master [localhost:27001], err: AuthenticationFailed: Authentication failed. :
connect@src/mongo/shell/mongo.js:328:13
@(connect):1:6
exception: connect failed

Can you advise me of the reason of that failure ?

Regards
Boris

The clue to your problem is that you were prompt for Enter password:, despite the fact you used the -p option. You were prompted because you are missing a space between the closing double quotes of the user name and -p.

4 Likes

Thank you , that was the problem with my command !
Boris

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.