Forums

Mongodb Cloud Server Connection failed

[formatted by admin]

Mongodb Cloud Server Connection failed
  self.__session = self.__collection.database.client._ensure_session()
File "/usr/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1807, in _ensure_session
  return self.__start_session(True, causal_consistency=False)
File "/usr/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1760, in __start_session
  server_session = self._get_server_session()
File "/usr/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1793, in _get_server_session
  return self._topology.get_server_session()
File "/usr/lib/python3.8/site-packages/pymongo/topology.py", line 479, in get_server_session
  self._select_servers_loop(
File "/usr/lib/python3.8/site-packages/pymongo/topology.py", line 204, in _select_servers_loop
  raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: cluster0-shard-00-01.x6cgk.mongodb.net:27017: [Errno 111] Connection refused,cluster0-shard-00-02.x6cgk.mongodb.net:27017 : [Errno 111] Connection refused,cluster0-shard-00-00.x6cgk.mongodb.net:27017: [Errno 111] Connection refused

please suggest me what should I do.

Free accounts have restricted internet access, so you won't be able to connect with external db.

Nice. That's what I was thinking too..... but I'm not very experienced.