Unable to connect Metabase to my MongoDB Atlas cluster

317 views
Skip to first unread message

Andrew Rasmussen

unread,
May 13, 2019, 10:25:15 PM5/13/19
to mongodb-user
Has anyone had success connecting Metabase to their MongoDB Atlas (MongoDB v4.0) cluster? I can connect just fine via NodeJS and command line, but for some reason Metabase won't connect.


I filed an issue on the Metabase repo with more technical details here: https://github.com/metabase/metabase/issues/9867

If anyone has ideas, it'd be greatly appreciated!

Stephen Steneker

unread,
May 15, 2019, 2:43:12 AM5/15/19
to mongodb-user
Hi Andrew,

I noticed the connection error you posted on the GitHub issue has a 3000 ms timeout:

com.mongodb.MongoTimeoutException: Timed out after 3000 ms 

The normal driver default for server selection timeout is 30,000ms (30s). Where is your Metabase application deployed in relation to your Atlas cluster -- are both hosted by the same cloud provider in the same region? 

I'm not familiar with Metabase or Monger configuration, but if your connection error is correct I would look into changing the server selection timeout to the default in case 3 seconds is too short. Based on your GitHub issue it looks like you are able to use standard MongoDB connection strings so I would try appending &serverSelectionTimeoutMS=30000.

Have you checked your MongoDB Atlas logs to see if there is any relevant information logged about connection attempts? To simplify troubleshooting I would remove the readPreference from your connection string so attempts will be logged on the primary.


If adjusting the server selection timeout doesn't work, can you provide your specific versions of Metabase, Monger, and JDK in case those provide some useful hints? You mention this looks like Monger v3.5.0 based on a git commit, but it would be helpful to confirm what is actually installed in your environment.

There is also a Metabase discussion forum, which I expect would have users with more expertise on Metabase configuration. If you haven't already posted there, it would be worth starting a discussion (and adding the link here so users with a similar issue can follow the breadcrumb trail).

Regards,
Stennie

Andrew Rasmussen

unread,
May 17, 2019, 9:57:26 AM5/17/19
to mongodb-user
Hi Stephen, thanks for your reply.

I tried adding "&serverSelectionTimeoutMS=30000" to the connection string options, but it didn't seem to make a difference. It still timed out after 3000ms.

Our Metabase instance and Atlas cluster are both in AWS us-east-1, so the connection should be quite fast.

Versions:
– Metabase: 0.32.5
– Monger: 3.5.0
– OpenJDK: 1.8.0_201

I already posted a GitHub issue on Metabase's repo, and on their discussion forum, and haven't received a helpful response after several weeks, so I came here as a bit of a last resort.

Andrew

Stephen Steneker

unread,
Jul 8, 2019, 1:47:42 AM7/8/19
to mongodb-user

On Friday, 17 May 2019 23:57:26 UTC+10, Andrew Rasmussen wrote:
I tried adding "&serverSelectionTimeoutMS=30000" to the connection string options, but it didn't seem to make a difference. It still timed out after 3000ms.

Our Metabase instance and Atlas cluster are both in AWS us-east-1, so the connection should be quite fast.

Versions:
– Metabase: 0.32.5
– Monger: 3.5.0
– OpenJDK: 1.8.0_201

I already posted a GitHub issue on Metabase's repo, and on their discussion forum, and haven't received a helpful response after several weeks, so I came here as a bit of a last resort.

Hi Andrew,

The GitHub issue you created suggests a fix was included in the Metabase v0.32.9 release (mid-June), so noting here in case anyone else runs into the same issue.

Regards,
Stennie
Reply all
Reply to author
Forward
0 new messages