Cannot import database create users on a newly created mongodb cluster


I have created a new cluster using the percona mongodb operator. I am trying to create users and import a database into the cluster but it failing with the error that it’s saying that I have no permission to execute command db.createUser() or not authorized on admin to execute command { enableSharding: “vpsie”, lsid:
I have used the clusterAdmin user, the databaseAdmin user and also tried with userAdmin user they are fail.

Steps to Reproduce:

create a new cluster with 3 replicasets and 1 shard then try to create a user on it.




[If applicable, include any relevant log files or error messages]

Expected Result:

user to be created and assigned to the database.

Actual Result:

an error has been occured saying that I have no permission

Additional Information:

Hi, please show us the actual error as well as the steps you are taking to import the database

Aparently I have used the command using the wrong admin user. Once I used the userAdmin I was able to create the account for the database which then I was able to use to import the dump.

1 Like