Cannot connect to external MongoDB Atlas cluster

Greeting everyone, I am trying to configure an external MongoDB database instead of the Docker provided one to work locally with Tutor. For testing purposes I spun up the free MongoDB Atlas cluster and configured my Tutor installation like this:

RUN_MONGODB: false
MONGODB_AUTH_MECHANISM: ''
MONGODB_AUTH_SOURCE: admin
MONGODB_DATABASE: openedx
MONGODB_HOST: my-host.mongodb.net
MONGODB_PASSWORD: <omitted>
MONGODB_PORT: 27017
MONGODB_REPLICA_SET: ''
MONGODB_USERNAME: admin
MONGODB_USE_SSL: true

After this configuration, trying to launch the platform using tutor local launch results in the following error after a bit:

2025/04/02 22:20:12 Waiting for tcp://my-host.mongodb.net:27017: dial tcp: lookup my-host.mongodb.net on 127.0.0.11:53: no such host.
<same error repeated 20 times>
2025/04/02 22:20:34 Failed to wait: timed out: tcp://openedx-test.xwofp.mongodb.net:27017.

I have been troubleshooting this the past 2 weeks and I have not managed to resolve this.
I am on Tutor version 19.0.2. Any help or ideas would be greatly appreciated. Thanks in advance.

I have managed to resolve this and successfully connect my MongoDB Atlas cluster with Tutor!

The issue was with my configuration and specifically the MONGODB_HOST parameter. I had to specific the host string like this:
MONGODB_HOST: mongodb+srv://admin:<pwd>@my-host.mongodb.net

I feel like the documentation at Configuration and customisation — Tutor documentation should be updated and add a note specifying that for SRV hosts. Because with the current way the document describes the config it could be easily implied that the HOST parameter should only be the actual host…not the connection URI.

What’s the point of having to add the MONGODB_USERNAME and MONGODB_PASSWORD parameters if the MONGODB_HOST parameter ignores them?

Hi @Retr0 ! As an open-source project we rely on community contributions. Would you please consider submitting a pull request to update the documentation?

1 Like