In https://github.com/rueckstiess/mtools/issues/691#issuecomment-590933618 I am getting a ServerSelectionTimeoutError from the Python driver, as used by mlaunch. The error produced is:
[2020/02/24 18:21:34.359] pymongo.errors.ServerSelectionTimeoutError: No replica set members match selector "Primary()"
This error provides just about no assistance in determining and resolving the problem.
The Ruby driver produces the following message when server selection fails:
Mongo::Error::NoServerAvailable (No primary server is available in cluster: #<Cluster topology=ReplicaSetNoPrimary[ip-10-1-1-165:27017,ip-10-1-1-11.ap-northeast-1.compute.internal:27017,ip-10-1-1-135.ap-northeast-1.compute.internal:27017,name=mongoTest,v=29,e=7fffffff0000000000000013] servers=#<Server address=ip-10-1-1-165:27017 SECONDARY replica_set=mongoTest>,#<Server address=ip-10-1-1-11.ap-northeast-1.compute.internal:27017 UNKNOWN>,#<Server address=ip-10-1-1-135.ap-northeast-1.compute.internal:27017 SECONDARY replica_set=mongoTest>> with timeout=30, LT=0.015. The following servers have dead monitor threads: #<Server address=ip-10-1-1-165:27017 SECONDARY replica_set=mongoTest>, #<Server address=ip-10-1-1-11.ap-northeast-1.compute.internal:27017 UNKNOWN>, #<Server address=ip-10-1-1-135.ap-northeast-1.compute.internal:27017 SECONDARY replica_set=mongoTest>)
This message provides the following information:
1. Addresses of all the servers in the cluster.
2. The state of each server.
3. Server selection timeout used.
As a result, it is much easier for the user to identify the reason for the failure and subsequently address it.
Please consider adding similar diagnostics to the Python driver.
- duplicates
-
PYTHON-3667 Drivers should include topology description in server selection timeout errors
- Closed
- is related to
-
PYTHON-1638 Error message when raising a SeverSelectionTimeoutError should hint at a faulty server_selector when it is configured
- Backlog
- related to
-
PYTHON-2116 Add __repr__ to monitoring event classes
- Closed
- split from
-
DRIVERS-2421 Drivers should include topology description in server selection timeout errors
- Closed