Homework 1.2 - Validation error

Hello all,

I have a problem with the understanding of this lab, at least with the return JSON that I have to find with the validation script.

Here are the steps I did.
1 - I launched the implementation of replicaset. => no worries, the replica is operational and without --auth => OK

2 - I logged in on each instance starting with the secondary to stop them (db.shutdownserver ()) => OK

3 - create the keyfile file and launch the instances taking into account this file :slight_smile:
still no --auth enabled, as requested in the lab
4 - connect to the primary and create the user in the admin database
5 - after : restart replicaset with --auth to enable authentication on the replica set.
6 - launching the validation script
if I interpreted the script correctly, initially I should take an authentication error and then a correct result because I am authenticated …

output :
{ unauthorizedStatus: {“operationTime”:{"$timestamp":{“t”:1561022520,“i”:1}},“ok”:0,“errmsg”:“command replSetGetStatus requires authentication”,“code”:13,"$clusterTime":{“clusterTime”:{"$timestamp":{“t”:1561022520,“i”:1}},“signature”:{“hash”:{"$binary":“tbd3UzN9sO0/OavZGm+oJFQaTCM=”,"$type":“00”},“keyId”:{"$numberLong":“6704532468331970562”}}}}, memberStatuses: [“SECONDARY”,“SECONDARY”,“SECONDARY”] }

and … that’s not the expected answer … Can you tell me what I did not understand? I repeated the lab several times and started all over again but I come across the same return …

thank you in advance for your help

Your setup seems to have issues.Please check again the steps
Your dbpath is writing to same directory r0?
For each instance it should write to a different directory like r0,r1,r2 etc
Same for logpath


Please follow Forum guidelines and do not post answers or code to the Forum. I have edited yout post to remove those parts that are in violation.

Notice also that your final result shows 3 secondaries and no PRIMARY. Clearly your setup is not correct. Go back and check how you set up the replica set. Good luck.

Sorry for my mistake I did not want to violate the rules of the forum.
May I discuss privately with labs 1.2 and 1.3 please.


I finally found my worries. As all my infra structure is under mongodb 4.0 I used the same version to perform the lab … error the message obtained is not the same.
Nevertheless it is noted on the system requirements: MongoDB: 3.2.x + Enterprise. So I thought I could use version 4.0 but no.
Thanks a lot for your help

1 Like


I would point out to you that this is why the course supplies Vagrant VMs for your use. If you use the supplied VMs, you will not have these problems. Also, to be clear, future labs will absolutely require that you use the VMs as supplied, as the two supplied VMs – ‘database’ and ‘infrastructure’ will need to talk to one another.