Error homework 2.3 - Create custom role

Hello everyone. I’m having issues with Homework 2.3 of M310 (MongoDB Security). When I run the validation script I got an error:

vagrant@database:~/shared$ ./validate-hw-2.3.sh
2020-09-23T02:27:18.911+0000 E QUERY [thread1] Error: not authorized on admin to execute command { rolesInfo: 1.0, showPrivileges: true } : _getErrorWithCode@src/mongo/shell/utils.js:25:13 DB.prototype.getRoles@src/mongo/shell/db.js:1663:1 @(shell eval):2:23

I created a user in order to create the roles. But I do not know how the validation script works if the lab ask me for no user.

Thanks in advanced.

May be the user is not created properly or created on the wrong DB

1 Like

I created the roles using admin database. It works.

Thanks.

1 Like