settings.py
requirements.py
docker-compose.yml
error message.
raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError:
ac-yyvwtll-shard-00-00.gcdfin1.mongodb.net:27017: connection closed,
ac-yyvwtll-shard-00-01.gcdfin1.mongodb.net:27017: connection closed,
ac-yyvwtll-shard-00-02.gcdfin1.mongodb.net:27017: connection closed,
Timeout: 30s, Topology Description: <TopologyDescription id: 62f603001b491814aad289bb,
topology_type: ReplicaSetNoPrimary,
servers: [<ServerDescription ('ac-yyvwtll-shard-00-00.gcdfin1.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('ac-yyvwtll-shard-00-00.gcdfin1.mongodb.net:27017: connection closed')>,
<ServerDescription ('ac-yyvwtll-shard-00-01.gcdfin1.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('ac-yyvwtll-shard-00-01.gcdfin1.mongodb.net:27017: connection closed')>,
<ServerDescription ('ac-yyvwtll-shard-00-02.gcdfin1.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('ac-yyvwtll-shard-00-02.gcdfin1.mongodb.net:27017: connection closed')>]>
I have fixed this error by downgrading pymongo version to 3.12.3 and adding the IP address (allow access from anywhere) in network access on the MongoDB cluster.