Homework 2.4 - Validation script not authenticating

At the request of a TA, opening a new thread.

I appear to be missing something regarding this homework. The gist of my misunderstanding is around how the validation script can possibly return an actual value.

Enabling TLS turns on authentication. This authentication makes it so the validation script can’t get the member info without authenticating first. The validation script doesn’t validate before requesting member info.

As an alternative, see the validation script from lab 1.3, which does validate first:

statusStr="var status = rs.status();
           delete status.codeName;
           print(JSON.stringify(status))"
memberStr="db = db.getSisterDB('\$external');
           db.auth({
             mechanism: 'MONGODB-X509',
             user: 'C=US,ST=New York,L=New York City,O=MongoDB,OU=University2,CN=M310 Client'
           });
           var status = rs.status();
           var statuses = status.members.map((member) => (member.stateStr)).sort();
           print(JSON.stringify(statuses));"

I don’t think my problem is in following the setup steps of the lab, because of the aforementioned behavior of Mongo auth. Even if it is, I feel that an explanation of where my reasoning is wrong will be more beneficial than discussing the lab setup specifically.

Please make sure that your replica set has necessary file for internal authentication.

Replica set is working correctly, thanks.