Surpise timeout using the Python library

I am using the pymongo library and recently started getting this error:

pymongo.errors.ServerSelectionTimeoutError: cluster0-shard-00-00.8e7bs.mongodb.net:27017: connection closed,cluster0-shard-00-02.8e7bs.mongodb.net:27017: connection closed,cluster0-shard-00-01.8e7bs.mongodb.net:27017: connection closed, Timeout: 30s, Topology Description: <TopologyDescription id: 62cdbe348945cca01dcb1910, topology_type: ReplicaSetNoPrimary, servers: [<ServerDescription ('cluster0-shard-00-00.8e7bs.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('cluster0-shard-00-00.8e7bs.mongodb.net:27017: connection closed')>, <ServerDescription ('cluster0-shard-00-01.8e7bs.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('cluster0-shard-00-01.8e7bs.mongodb.net:27017: connection closed')>, <ServerDescription ('cluster0-shard-00-02.8e7bs.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('cluster0-shard-00-02.8e7bs.mongodb.net:27017: connection closed')>]>

This is happening on the insert_many on just 742 short documents. I am new to mongo and unsure how to debug this one. ANy ideas?

Solved! The ip address changed from the one allowed.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.