Problem with shared cluster MongoDB connection

Feature impacted

MongoDB connection.

Observed behavior

The connection to MongoDB server fails.

Expected behavior

Forestadmin should connect according to the doc, especially since I am totally able to connect when using Studio3T or Robo3T tools.

Failure Logs

Here is the output log after launching the command on my terminal and reaching the step “Connecting to your database” :
× Cannot connect to the database due to the following error:
× {"name":"MongoServerSelectionError","reason" : {"type":"Unknown","setName":null,"maxSetVersion":null,"maxElectionId":null,"servers":{},"stale":false,"compatible":true,"compatibilityError":null,"logicalSessionTimeoutMinutes":null,"heartbeatFrequencyMS":10000,"localThresholdMS":15,"commonWireVersion":null}}

Context

  • Project name: mppv2admin
  • Team name: monpetitparquet
  • May be important to consider : MongoDB servers are managed by Meteor Galaxy. I have no control on them.
  • MongoURL used for Studio3T connection (username, password changed of course) : mongodb://username:password@SG-galaxycluster-38726.servers.mongodirector.com:27017,SG-galaxycluster-38727.servers.mongodirector.com:27017/mpp-meteorapp-com?replicaSet=RS-galaxycluster-0&ssl=true
  • I have tried many different thing modifying directly the auto-generated bash command, but all of them failed. (removing / adding parameters like ssl=true…, removing one of the two server…)

Hello, do you have try to use the srv key word for mongodb cluster ? ('mongodb+srv://cluster0.ex...)
=> https://www.mongodb.com/docs/manual/reference/connection-string/#mongodb-atlas-cluster

1 Like

Tks for the reply. I just tried your suggestion.
But when I do "mongodb+srv://[blabalbla...], I have this error log :
× {"name":"MongoParseError"}

I think I found out. Browsing the doc thanks to your link, I realised the auth database was by dfault called “admin” and mine is specific. I simply added &authSource=mpp-meteorapp-com and it works. Well, I have another error now, but this step is good :slight_smile:

Here is my latest error log : × {"name":"MongoServerSelectionError","reason":{"type":"ReplicaSetNoPrimary","setName":null,"maxSetVersion":null,"maxElectionId":null,"servers":{},"stale":false,"compatible":true,"compatibilityError":null,"logicalSessionTimeoutMinutes":null,"heartbeatFrequencyMS":10000,"localThresholdMS":15,"commonWireVersion":null}}
I believe it is more about ipwhitlisting or soething like that

Yes you should authorize your ip from your mongo dashboard settings.
Here an example from Atlas: https://www.mongodb.com/docs/atlas/security/ip-access-list/.

Found out : it was related to SSL certificates validations. For testing purposes, I added this parameter in the URI &tlsInsecure=true and it worked fine !

Tks for your help

2 Likes