Error running validate-hw-1.2.sh

My replicaset is ok, rs.status() shows me the 3 nodes. I have created user admin as root but when I run the validation script it shows me:

{ unauthorizedStatus: {“ok”:0,“errmsg”:“not authorized on admin to execute command { replSetGetStatus: 1.0 }”,“code”:13}, memberStatuses: [“PRIMARY”
,“SECONDARY”,“SECONDARY”] }

What could be wrong in my environment? Thanks.

The user is not create with the appropriate role.

Verify that the lab does not require a specific user.

Its ok, Steeve.
db.createUser({user:‘admin’, pwd: ‘webscale’,roles: [‘root’]})

I am not sure what is ok. Is the script ok now, or is the user ok?

I have just went back to the course material and this one is a bit confusing. Sometimes the good answer is an error. The note at the end says:

Note: If you’ve successfully enabled authentication on the replica set, then the validation script should output a JSON object with two keys: unauthorizedStatus and memberStatuses. The first key confirms that authentication is enabled, and the second verifies that all members are still up and running.

So it looks like you are getting what you are supposed to get so nothing is wrong with your setup.

The user is ok. I can login with --auth enabled, My replica set is up and some commands like rs.status() are ok.
I have no idea whats wrong with my lab.

I posted the following just a couple of minutes before your reply.

1 Like

Incredible. The wrong answer is the right answer. I was expecting an answer like a hash…
Thanks.

3 Likes