Hi!

Just registered a Redash account and tried to add a mongodb datasource that is hosted on mongodb atlas. I have tried a lot of different settings for the connection string, but no luck in connecting.

Has anyone successfully connected to mongodb atlas (free tier)?

Any help appreciate. Thanks!

Well, to answer my own question, I was actually able to connect with the following format of the connection string:

mongodb+srv://[user]:[password]@[host]/[dbname]?retryWrites=true

2 Likes

Thank you for following up with a solution!

Happy Querying :nerd_face:

1 Like

Hi, thank you for sharing your fix!

I get is error when testing the connection:

Invalid URI scheme: mongodb+srv

My Redash version: 7.0.0+b17535

Any idea?

I’m using the same version of Redash and that same format is working just fine for me.

mongodb+srv://[user]:[pass]@[host]/[dbname]?retryWrites=true

Are you connecting to MongoDB Atlas or another host?

Hi, thanks for helping. Yes I am connecting to MongoDB Atlas.

Have you whitelisted Redash’s IP with Atlas? I go the same error message until I specifically allowed 52.71.84.157.

Yes, we whitelisted the EC2 instance’s IP address which hosts our Redash instance.

This error shows up immediately after clicking on “Test”, not after a timeout (which often suggests a firewall issue).

As a debug step, create a demo cluster with Atlas and white list * (all IP addresses). Then try to connect Redash. Does this work?

Yes, we did try this. No luck.

Gotcha. That rules out firewall issues with Atlas. Are you able to connect your Redash instance to any data source? Perhaps your EC2 firewall is in the way.

Oh yes, we can connect fine to other sources.

I would like to let you know the following:
Currently, connecting to this data source is no longer a must for us. Our MongoDB instance will be shut down next month. It’s a decision that came after I started posting on this thread.
I appreciate a lot your help and am willing to continue investigating this to help the community. But I’d understand if you’d prefer not to spend time on this.

Cheers,

Boris