Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-3165

Pymongo 4.0 failing with error AutoReconnect("connection pool paused"))

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.0.1
    • Component/s: API, Tests

      Hi, 

      My service is using pymongo module for DB operations. With upgrade to pymongo 4.0.1 we are facing error for API insert_one, traceback captured belo. This error happens when the service runs in docker using 'python:3.10.1-bullseye' as base image. There is no issue observed if the pymongo version is 3.12.3. There is a similar issue reported for this error: https://jira.mongodb.org/browse/PYTHON-3029 

      Kindly let us know the resolution for this issue. Thanks!

       

      File "/opt/venv/lib/python3.10/site-packages/pymongo/collection.py", 
      line 542, in insert_one
       self._insert_one(
       File "/opt/venv/lib/python3.10/site-packages/pymongo/collection.py", line 494, in _insert_one
       self.__database.client._retryable_write(acknowledged, _insert_command, session)
       File "/opt/venv/lib/python3.10/site-packages/pymongo/mongo_client.py", line 1386, in _retryable_write
       return self._retry_with_session(retryable, func, s, None)
       File "/opt/venv/lib/python3.10/site-packages/pymongo/mongo_client.py", line 1274, in _retry_with_session
       return self._retry_internal(retryable, func, session, bulk)
       File "/opt/venv/lib/python3.10/site-packages/pymongo/mongo_client.py", line 1299, in _retry_internal
       with self._get_socket(server, session) as sock_info:
       File "/usr/local/lib/python3.10/contextlib.py", line 135, in __enter__
       return next(self.gen)
       File "/opt/venv/lib/python3.10/site-packages/pymongo/mongo_client.py", line 1136, in _get_socket
       with server.get_socket(self.__all_credentials, handler=err_handler) as sock_info:
       File "/usr/local/lib/python3.10/contextlib.py", line 135, in __enter__
       return next(self.gen)
       File "/opt/venv/lib/python3.10/site-packages/pymongo/pool.py", line 1407, in get_socket
       sock_info = self._get_socket(all_credentials)
       File "/opt/venv/lib/python3.10/site-packages/pymongo/pool.py", line 1472, in _get_socket
       self._raise_if_not_ready(emit_event=True)
       File "/opt/venv/lib/python3.10/site-packages/pymongo/pool.py", line 1443, in _raise_if_not_ready
       _raise_connection_failure(self.address, AutoReconnect("connection pool paused"))
       File "/opt/venv/lib/python3.10/site-packages/pymongo/pool.py", line 270, in _raise_connection_failure
       raise AutoReconnect(msg) from erro

       

            Assignee:
            julius.park@mongodb.com Julius Park (Inactive)
            Reporter:
            vakale@ptc.com Vaibhav Kale
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: