Ticket: Principle of Least Privilege(Error)

I’m getting following error

Principle of Least Privilege: It doesn’t appear you have configured the application user

I have updated the new user in the MongoDB Atlas but still getting this error.

Hi!

You should also change the SRV in the configure file in mflix folder, that file one you’ve set when began this course module.

I hope this help you.

Hi @Krishnapriya_25299,

Please make sure you have whitelisted the IP address and also you are able to ping “cluster0-shard-00-00-jxeqq.mongodb.net”.

If it does not solve the issue, please share the user’s role.

Kanika

Hi @Kanika,
Even after adding my new user, updating whitelist IP address when I tried to connect from mongoDB atlas I’m getting the same Connection string URI. Is that correct?

Hi @Rogerio_50904, @Kanika,
Thanks for your help. I solved this issue. I changed the SRV in the configure file but forgot to run the command “mv dotini_unix .ini”
After running this command I restart the server then it works!!

   Thanks again for your time.
1 Like

@kanikasingla

i have the same issue in this ticket as well . here is my srv connection string
mongodb+srv://mflixAppUser:mflixAppPwd@…

user is created with ReadWrite (full) access privilege

Note:

  • i have tested in my jupyter notebook using the above svr string, it works . but unable to get the ticket in the App

is there any think that i am supposed to do, you are welcome to point out

This is a 2 year old post
Try to create a new thread for faster response

Have you renamed your dot_ini file?
After creating the user you have to choose default privileges and assign readwrite role

Please search our forum threads.You will get more details

@Ramachandra_37567 @kanikasingla @Rogerio_50904

  • yes renamed dot_ini file , no issue with this part .
  • granted full privilege (readWrite)
    mflixAppUser
    mflixAppPwd

I had a same issue like these
i had created a new user as per instruction and
i had modified the .ini file correctly

when i try to get validation code , it throws error,

even i downloaded a fresh copy from the beginning and i copy the dot_ini file and modified with new user and renamed it through cmd, it throws same error

i double check .ini file by notebook .ini command, Though its correct , it throws error, how can i fix it? any other ideas?

That should not be happening :thinking: @Deepak_S, @Asfetaw_Abay_Abera Please share the full connection string. I can test with my app.

Kanika

here is the connection string .

mongodb+srv://mflixAppUser:mflixAppPwd@mflix.rzepg.mongodb.net/test

Screenshot of what you are doing that shows the error you are getting.

i have the same problem, change the srv: MFLIX_DB_URI=mongodb+srv://mflixAppUser:mflixAppPwd@
in the .env doc, with the new user readWrite-anydatabase role in Atlas
then start the server, the db-connection-test works well and all the tickets works to, but the last ticked Principle of Least Privilege dont works
M220JS date: 22/03/2021

MFLIX_DB_URI=mongodb+srv://mflixAppUser:mflixAppPwd@clusterbank.5fkz2.mongodb.net/sample_mflix?retryWrites=true&w=majority

1 Like

Hi @Freddy_Mansilla

Thanks for raising your question, however as this is an old thread, we recommend that you post a fresh/new thread with your issue and the relevant information to ensure it gets visibility.

Have you renamed your dot_ini file?
Have you restarted your server after making these changes?
Can you share the output from app.py when you try the “Principle of Least Privilege” check?

Kindest regards,
Eoin