Error establishing secure connection with self hosted mongodb

Hi everyone, We have been using Tutor 15.0.0 for the last 9–10 months. We’ve installed it using AWS Marketplace ami of tutor by overhang.io. (one-click installation)
Now we want our databases (mongodb and mysql) out of that LMS EC2 and host them separately.
So far, we were able to -

  1. Restore all our data to AWS RDS v5.7 and connect it to our LMS by updating the config values as mentioned here.
  2. Along with MySQL, we also successfully restored all our data from mongodb.dump into our self-hosted mongodb instance, resulting in smooth operations of all of our services.

But in this initial testing of the MongoDB connection, authorization was not required.

File : mongod.conf (mongodb v7.0.6)

As soon as we updated our mongo.conf file with Authorization flag set to enabled and then updated our config.yml file for the tutor, the server started returning an “internal server error. [500]”. After debugging it for hours, we were able to find out the error

Error logs from LMS logs

But we’re providing usernames and other required parameters in the config file , even though we are able to connect to the MongoDB server from other remote machines.

Our Config.yml file snippet
Config.yml

Here, I’am attaching screenshot of all the available users in my mongodb along with their roles.

1 Like

Hi @j.thorat10!

Try adding the mongouser user to the openedx db, with roles ['dbAdmin', 'readWrite'].

Something like

use openedx;
db.createUser({user:"mongouser", pwd:"mongopassword", roles:['dbAdmin', 'readWrite']);

Hey Andres, I also tried the same but still no luck in solving that issue.

1 Like

You said you are running tutor v15.0.0, right? I believe this issue was fixed in 15.3.7: fix: use correct case for authsource mongo by johanseto · Pull Request #841 · overhangio/tutor · GitHub

Thank you so much @regis. I will give it a try on our dev env and will let you know .