Hello @Julio_Montes_de_Oca ,
I saw that you haven’t got a response to this topic yet, were you able to find a solution?
If not, then could you please confirm and share few things for me to understand your use-case better?
- Were you able to connect to this cluster before or is this the first time you are trying to connect and getting this error?
- Could you please try connecting to your Atlas cluster via Mongo Shell or Compass or any other drivers? If you have already tried, was the connection successful??
- Can you share your connection string? (Kindly Redact any username/password from this)
- Any active firewall that might be blocking access?
- Can you please confirm if your IP address or a CIDR-notated range of addresses is whitelisted in the Atlas? Kindly refer Configure IP Access List Entries
- Please confirm if port 27017 is not blocked at your cloud provider’s end.
- Check that the database exists and you are connecting to the correct one in the yourDatabaseName slot.
- Kindly check Atlas Cluster connection graph of the cluster you are trying to connect with as different Atlas tiers have different connection limits; clusters of size
M0/M2/M5, for example, are limited to 500 connections, and clusters of sizeM10are limited to 1500 connections. - Lastly, please share the version of the MongoDB driver you are using? It’s possible that the driver version is not compatible with the MongoDB version you are using.
The most common reason for someone to get this error if a DAO(Data Access Object) tries to connect using an invalid mongo URI. Why it’s invalid can be many different reasons, but some common ones are:
- Check for typos in the connection string (missing srv, copy/paste errors, missing mongodb://)
- Check that the domain for the private endpoint is formatted correctly. In the middle of the connection string, there should be
<cluster name>-pl-<number>-lb. For exampleia-prod-regional-cluste-pl-0-lb.fu9ds.mongo.com - Check that the private endpoint is in the same region of the cluster that it’s for (something is probably wrong with the fad service file if this is the case)
- Check that the security groups in the VPC for the endpoint allow inbound communication from the kube deployment that is trying to connect to it
- Invalid credentials should cause a different error message, but check that the credentials have been encrypted correctly
Attaching a few documents and threads you can refer to troubleshoot/fix connection error.
Regards,
Tarun