[Build Failure] TestOCSP.test_tls

XMLWordPrintableJSON

    • Type: Build Failure
    • Resolution: Fixed
    • Priority: Unknown
    • 4.18.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Python Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Name of Failure:

      test.ocsp.test_ocsp.TestOCSP.test_tls

      Link to task:

      https://spruce.corp.mongodb.com/task/mongo_python_driver_ocsp_rhel8_test_ocsp_ecdsa_soft_fail_v8.0_python3.10_min_deps_00cfe6f16d262d9baca04677423287b479104e99_26_05_27_17_12_50/tests?execution=0&sorts=STATUS%3AASC

      Context of when and why the failure occurred:

      Started failing on May 21, 2026 when the pyopenssl version was bumped in this PR

      Stack trace:

      [2026/05/27 15:15:31.065] FAILURE: pymongo.errors.ServerSelectionTimeoutError: 'X509' object has no attribute 'get_extension', Timeout: 10.0s, Topology Description: <TopologyDescription id: 6a1750d346c0852e45860da3, topology_type: Unknown, servers: [<ServerDescription ('localhost', 27017) server_type: Unknown, rtt: None, error=AttributeError("'X509' object has no attribute 'get_extension'")>]> ()
      [2026/05/27 15:15:31.065] self = <test_ocsp.TestOCSP testMethod=test_tls>
      [2026/05/27 15:15:31.065]     def test_tls(self):
      [2026/05/27 15:15:31.065]         options = "tls=true"
      [2026/05/27 15:15:31.065]         if not OCSP_TLS_SHOULD_SUCCEED:
      [2026/05/27 15:15:31.065]             self.assertRaisesRegex(
      [2026/05/27 15:15:31.065]                 ServerSelectionTimeoutError, "invalid status response", _connect, options
      [2026/05/27 15:15:31.065]             )
      [2026/05/27 15:15:31.065]         else:
      [2026/05/27 15:15:31.065] >           _connect(options)
      [2026/05/27 15:15:31.065] test/ocsp/test_ocsp.py:72: 
      [2026/05/27 15:15:31.065] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
      [2026/05/27 15:15:31.065] test/ocsp/test_ocsp.py:49: in _connect
      [2026/05/27 15:15:31.065]     client.admin.command("ping")
      [2026/05/27 15:15:31.065] pymongo/_csot.py:125: in csot_wrapper
      [2026/05/27 15:15:31.065]     return func(self, *args, **kwargs)
      [2026/05/27 15:15:31.065] pymongo/synchronous/database.py:953: in command
      [2026/05/27 15:15:31.065]     return self._client._retryable_read(
      [2026/05/27 15:15:31.065] pymongo/synchronous/mongo_client.py:2076: in _retryable_read
      [2026/05/27 15:15:31.065]     return self._retry_internal(
      [2026/05/27 15:15:31.065] pymongo/_csot.py:125: in csot_wrapper
      [2026/05/27 15:15:31.065]     return func(self, *args, **kwargs)
      [2026/05/27 15:15:31.065] pymongo/synchronous/mongo_client.py:2038: in _retry_internal
      [2026/05/27 15:15:31.065]     ).run()
      [2026/05/27 15:15:31.065] pymongo/synchronous/mongo_client.py:2811: in run
      [2026/05/27 15:15:31.065]     res = self._read() if self._is_read else self._write()
      [2026/05/27 15:15:31.065] pymongo/synchronous/mongo_client.py:3027: in _read
      [2026/05/27 15:15:31.065]     self._server = self._get_server()
      [2026/05/27 15:15:31.065] pymongo/synchronous/mongo_client.py:2975: in _get_server
      [2026/05/27 15:15:31.065]     return self._client._select_server(
      [2026/05/27 15:15:31.065] pymongo/synchronous/mongo_client.py:1851: in _select_server
      [2026/05/27 15:15:31.065]     server = topology.select_server(
      [2026/05/27 15:15:31.065] pymongo/synchronous/topology.py:428: in select_server
      [2026/05/27 15:15:31.065]     server = self._select_server(
      [2026/05/27 15:15:31.065] pymongo/synchronous/topology.py:402: in _select_server
      [2026/05/27 15:15:31.065]     servers = self.select_servers(
      [2026/05/27 15:15:31.065] pymongo/synchronous/topology.py:298: in select_servers
      [2026/05/27 15:15:31.065]     server_descriptions = self._select_servers_loop(
      [2026/05/27 15:15:31.065] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
      [2026/05/27 15:15:31.065] self = <Topology CLOSED <TopologyDescription id: 6a1750d346c0852e45860da3, topology_type: Unknown, servers: [<ServerDescription ('localhost', 27017) server_type: Unknown, rtt: None>]>>
      [2026/05/27 15:15:31.065] selector = Primary(), timeout = 10.0, operation = 'ping', operation_id = None
      [2026/05/27 15:15:31.065] address = None, deprioritized_servers = []
      [2026/05/27 15:15:31.065]     def _select_servers_loop(
      [2026/05/27 15:15:31.065]         self,
      [2026/05/27 15:15:31.065]         selector: Callable[[Selection], Selection],
      [2026/05/27 15:15:31.065]         timeout: float,
      [2026/05/27 15:15:31.065]         operation: str,
      [2026/05/27 15:15:31.065]         operation_id: Optional[int],
      [2026/05/27 15:15:31.065]         address: Optional[_Address],
      [2026/05/27 15:15:31.065]         deprioritized_servers: Optional[list[Server]] = None,
      [2026/05/27 15:15:31.065]     ) -> list[ServerDescription]:
      [2026/05/27 15:15:31.065]         """select_servers() guts. Hold the lock when calling this."""
      [2026/05/27 15:15:31.065]         now = time.monotonic()
      [2026/05/27 15:15:31.065]         end_time = now + timeout
      [2026/05/27 15:15:31.065]         logged_waiting = False
      [2026/05/27 15:15:31.065]     
      [2026/05/27 15:15:31.065]         if _SERVER_SELECTION_LOGGER.isEnabledFor(logging.DEBUG):
      [2026/05/27 15:15:31.065]             _debug_log(
      [2026/05/27 15:15:31.065]                 _SERVER_SELECTION_LOGGER,
      [2026/05/27 15:15:31.065]                 message=_ServerSelectionStatusMessage.STARTED,
      [2026/05/27 15:15:31.065]                 selector=selector,
      [2026/05/27 15:15:31.065]                 operation=operation,
      [2026/05/27 15:15:31.065]                 operationId=operation_id,
      [2026/05/27 15:15:31.065]                 topologyDescription=self.description,
      [2026/05/27 15:15:31.065]                 clientId=self.description._topology_settings._topology_id,
      [2026/05/27 15:15:31.065]             )
      [2026/05/27 15:15:31.065]     
      [2026/05/27 15:15:31.065]         server_descriptions = self._description.apply_selector(
      [2026/05/27 15:15:31.065]             selector,
      [2026/05/27 15:15:31.065]             address,
      [2026/05/27 15:15:31.065]             custom_selector=self._settings.server_selector,
      [2026/05/27 15:15:31.065]             deprioritized_servers=[server.description for server in deprioritized_servers]
      [2026/05/27 15:15:31.065]             if deprioritized_servers
      [2026/05/27 15:15:31.065]             else None,
      [2026/05/27 15:15:31.065]         )
      [2026/05/27 15:15:31.065]     
      [2026/05/27 15:15:31.065]         while not server_descriptions:
      [2026/05/27 15:15:31.065]             # No suitable servers.
      [2026/05/27 15:15:31.065]             if timeout == 0 or now > end_time:
      [2026/05/27 15:15:31.065]                 if _SERVER_SELECTION_LOGGER.isEnabledFor(logging.DEBUG):
      [2026/05/27 15:15:31.065]                     _debug_log(
      [2026/05/27 15:15:31.065]                         _SERVER_SELECTION_LOGGER,
      [2026/05/27 15:15:31.065]                         message=_ServerSelectionStatusMessage.FAILED,
      [2026/05/27 15:15:31.065]                         selector=selector,
      [2026/05/27 15:15:31.065]                         operation=operation,
      [2026/05/27 15:15:31.065]                         operationId=operation_id,
      [2026/05/27 15:15:31.065]                         topologyDescription=self.description,
      [2026/05/27 15:15:31.065]                         clientId=self.description._topology_settings._topology_id,
      [2026/05/27 15:15:31.065]                         failure=self._error_message(selector),
      [2026/05/27 15:15:31.065]                     )
      [2026/05/27 15:15:31.065] >               raise ServerSelectionTimeoutError(
      [2026/05/27 15:15:31.065]                     f"{self._error_message(selector)}, Timeout: {timeout}s, Topology Description: {self.description!r}"
      [2026/05/27 15:15:31.065]                 )
      [2026/05/27 15:15:31.065] E               pymongo.errors.ServerSelectionTimeoutError: 'X509' object has no attribute 'get_extension', Timeout: 10.0s, Topology Description: <TopologyDescription id: 6a1750d346c0852e45860da3, topology_type: Unknown, servers: [<ServerDescription ('localhost', 27017) server_type: Unknown, rtt: None, error=AttributeError("'X509' object has no attribute 'get_extension'")>]>
      [2026/05/27 15:15:31.065] pymongo/synchronous/topology.py:359: ServerSelectionTimeoutError
      

            Assignee:
            Steve Silvester
            Reporter:
            Steve Silvester
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: