Facing the below issue while installating mongodb 5.x

"/usr/local/lib/python3.10/dist-packages/pymongo/topology.py", line 222, in select_server\r\n return random.choice(self.select_servers(selector,\r\n File "/usr/local/lib/python3.10/dist-packages/pymongo/topology.py", line 182, in select_servers\r\n server_descriptions = self._select_servers_loop(\r\n File "/usr/local/lib/python3.10/dist-packages/pymongo/topology.py", line 198, in _select_servers_loop\r\n raise ServerSelectionTimeoutError(\r\npymongo.errors.ServerSelectionTimeoutError: PY_SSIZE_T_CLEAN macro must be defined for ‘#’ formats\r\n", “msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”, “rc”: 1}

This issue was fixed in PyMongo 3.10 (see https://jira.mongodb.org/browse/PYTHON-2001). Please upgrade to pymongo>=3.10.

1 Like

I am facing similar issue
File “/opt/saltstack/salt/extras-3.10/pymongo/collection.py”, line 1273, in find_one
delete_doc[“collation”] = collation
File “/opt/saltstack/salt/extras-3.10/pymongo/cursor.py”, line 1156, in next
File “/opt/saltstack/salt/extras-3.10/pymongo/cursor.py”, line 1050, in _refresh
sending getMore messages to the server.
File “/opt/saltstack/salt/extras-3.10/pymongo/mongo_client.py”, line 1807, in _ensure_session
def _return_server_session(
File “/opt/saltstack/salt/extras-3.10/pymongo/mongo_client.py”, line 1760, in __start_session
File “/opt/saltstack/salt/extras-3.10/pymongo/mongo_client.py”, line 1793, in _get_server_session
File “/opt/saltstack/salt/extras-3.10/pymongo/topology.py”, line 474, in get_server_session
def get_arbiters(self) → set[_Address]:
File “/opt/saltstack/salt/extras-3.10/pymongo/topology.py”, line 204, in _select_servers_loop
# CSOT: use remaining timeout when set.

2024-04-04 12:11:58,399 [salt.pillar :1281][CRITICAL][3791308] Pillar render error: Failed to load ext_pillar encrypted_mongo: PY_SSIZE_T_CLEAN macro must be defined for ‘#’ formats

version installed:
pymongo 4.6.3

This is a bug in ext_pillar which I am not familiar with. You’ll want to file an issue with the Salt project. It looks like their support for MongoDB needs a lot of work: [BUG] The whole mongodb code is a mess · Issue #66122 · saltstack/salt · GitHub

1 Like