ServerSelectionTimeoutError - pymongo4.5

Hi Mongodb community.

I am facing the following error on my app which uses pymongo 4.5.

No replica set members found yet, Timeout: 30s, Topology Description: <TopologyDescription id: 64ef55b92030ab4b7a836e07, topology_type: ReplicaSetNoPrimary, servers: [<ServerDescription ('', 27017) server_type: Unknown, rtt: None>, <ServerDescription ('', 27017) server_type: Unknown, rtt: None>, <ServerDescription ('', 27017) server_type: Unknown, rtt: None>]>

The strange thing is this happens only sometimes, not always. Like about 1% among total tries.

This is my connection string.


Thanks in advance!

Hey @Alphanomics_LLC,

Welcome to the MongoDB Community!

Could you share how frequently you are encountering the ServerSelectionTimeoutError issue? Is it occurring a few times within a day or perhaps once a week?

Also, please review the Troubleshoot Connection Issues documentation and verify some configurations, such as adding the client’s IP (or IP ranges) to the Network Access List. You may also find the following blog post regarding tips for atlas connectivity useful.

Please note, the use of the +srv connection string modifier generally automatically sets the tls (or the equivalent ssl ) option to true for the connection. You can override this behavior by explicitly setting the tls (or the equivalent ssl ) option to false with tls=false (or ssl=false ) in the query string. For more info, please refer here.