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

Encryption tests failing with BSON field 'root.sp' is an unknown field

    • Type: Icon: Build Failure Build Failure
    • Resolution: Duplicate
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers
    • 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?

      Starting after PYTHON-4541 the encryption tests having been failing with "BSON field 'root.sp' is an unknown field":

       [2024/08/01 10:48:27.476] _ TestSpec.test_legacy_fle2v2_Rangev2_Date_Aggregate_FLE2_Range_Date__Aggregate_ _
       [2024/08/01 10:48:27.476] self = <test.test_encryption.TestSpec testMethod=test_legacy_fle2v2_Rangev2_Date_Aggregate_FLE2_Range_Date__Aggregate_>
       [2024/08/01 10:48:27.476]     @client_context.require_test_commands
       [2024/08/01 10:48:27.476]     def run_scenario(self):
       [2024/08/01 10:48:27.476] >       self.run_scenario(scenario_def, test)
       [2024/08/01 10:48:27.476] test/test_encryption.py:713:
       [2024/08/01 10:48:27.476] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
       [2024/08/01 10:48:27.476] test/utils_spec_runner.py:561: in run_scenario
       [2024/08/01 10:48:27.476]     self.run_test_ops(sessions, collection, test)
       [2024/08/01 10:48:27.476] test/utils_spec_runner.py:462: in run_test_ops
       [2024/08/01 10:48:27.476]     self.run_operations(sessions, collection, test["operations"])
       [2024/08/01 10:48:27.476] test/utils_spec_runner.py:376: in run_operations
       [2024/08/01 10:48:27.476]     self._run_op(sessions, collection, op, in_with_transaction)
       [2024/08/01 10:48:27.476] test/utils_spec_runner.py:367: in _run_op
       [2024/08/01 10:48:27.476]     result = self.run_operation(sessions, collection, op.copy())
       [2024/08/01 10:48:27.476] test/utils_spec_runner.py:314: in run_operation
       [2024/08/01 10:48:27.476]     result = cmd(**dict(arguments))
       [2024/08/01 10:48:27.476] pymongo/synchronous/collection.py:864: in insert_one
       [2024/08/01 10:48:27.476]     self._insert_one(
       [2024/08/01 10:48:27.476] pymongo/synchronous/collection.py:804: in _insert_one
       [2024/08/01 10:48:27.476]     self._database.client._retryable_write(
       [2024/08/01 10:48:27.476] pymongo/synchronous/mongo_client.py:1848: in _retryable_write
       [2024/08/01 10:48:27.476]     return self._retry_with_session(retryable, func, s, bulk, operation, operation_id)
       [2024/08/01 10:48:27.476] pymongo/synchronous/mongo_client.py:1734: in _retry_with_session
       [2024/08/01 10:48:27.476]     return self._retry_internal(
       [2024/08/01 10:48:27.476] pymongo/_csot.py:120: in csot_wrapper
       [2024/08/01 10:48:27.476]     return func(self, *args, **kwargs)
       [2024/08/01 10:48:27.476] pymongo/synchronous/mongo_client.py:1769: in _retry_internal
       [2024/08/01 10:48:27.476]     return _ClientConnectionRetryable(
       [2024/08/01 10:48:27.476] pymongo/synchronous/mongo_client.py:2367: in run
       [2024/08/01 10:48:27.476]     return self._read() if self._is_read else self._write()
       [2024/08/01 10:48:27.476] pymongo/synchronous/mongo_client.py:2484: in _write
       [2024/08/01 10:48:27.476]     return self._func(self._session, conn, self._retryable)  # type: ignore
       [2024/08/01 10:48:27.476] pymongo/synchronous/collection.py:792: in _insert_command
       [2024/08/01 10:48:27.476]     result = conn.command(
       [2024/08/01 10:48:27.476] pymongo/synchronous/helpers.py:45: in inner
       [2024/08/01 10:48:27.476]     return func(*args, **kwargs)
       [2024/08/01 10:48:27.476] pymongo/synchronous/pool.py:538: in command
       [2024/08/01 10:48:27.476]     return command(
       [2024/08/01 10:48:27.476] pymongo/synchronous/network.py:218: in command
       [2024/08/01 10:48:27.476]     helpers_shared._check_command_response(
       [2024/08/01 10:48:27.476] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
       [2024/08/01 10:48:27.476] response = {'$clusterTime': {'clusterTime': Timestamp(1722534503, 46), 'signature': {'hash': b'\x00\x00\x00\x00\x00\x00\x00\x00\x...'keyId': 0}}, 'code': 40415, 'codeName': 'IDLUnknownField', 'errmsg': "BSON field 'root.sp' is an unknown field.", ...}
       [2024/08/01 10:48:27.476] max_wire_version = 25, allowable_errors = None
       [2024/08/01 10:48:27.476] parse_write_concern_error = False
       [2024/08/01 10:48:27.476]     def _check_command_response(
       [2024/08/01 10:48:27.476]         response: _DocumentOut,
       [2024/08/01 10:48:27.476]         max_wire_version: Optional[int],
       [2024/08/01 10:48:27.476]         allowable_errors: Optional[Container[Union[int, str]]] = None,
       [2024/08/01 10:48:27.476]         parse_write_concern_error: bool = False,
       [2024/08/01 10:48:27.476]     ) -> None:
       [2024/08/01 10:48:27.476]         """Check the response to a command for errors."""
       [2024/08/01 10:48:27.476]         if "ok" not in response:
       [2024/08/01 10:48:27.476]             # Server didn't recognize our message as a command.
       [2024/08/01 10:48:27.476]             raise OperationFailure(
       [2024/08/01 10:48:27.476]                 response.get("$err"),  # type: ignore[arg-type]
       [2024/08/01 10:48:27.476]                 response.get("code"),
       [2024/08/01 10:48:27.476]                 response,
       [2024/08/01 10:48:27.476]                 max_wire_version,
       [2024/08/01 10:48:27.476]             )
       [2024/08/01 10:48:27.476]         if parse_write_concern_error and "writeConcernError" in response:
       [2024/08/01 10:48:27.476]             _error = response["writeConcernError"]
       [2024/08/01 10:48:27.476]             _labels = response.get("errorLabels")
       [2024/08/01 10:48:27.476]             if _labels:
       [2024/08/01 10:48:27.476]                 _error.update({"errorLabels": _labels})
       [2024/08/01 10:48:27.476]             _raise_write_concern_error(_error)
       [2024/08/01 10:48:27.476]         if response["ok"]:
       [2024/08/01 10:48:27.476]             return
       [2024/08/01 10:48:27.476]         details = response
       [2024/08/01 10:48:27.476]         # Mongos returns the error details in a 'raw' object
       [2024/08/01 10:48:27.476]         # for some errors.
       [2024/08/01 10:48:27.476]         if "raw" in response:
       [2024/08/01 10:48:27.476]             for shard in response["raw"].values():
       [2024/08/01 10:48:27.476]                 # Grab the first non-empty raw error from a shard.
       [2024/08/01 10:48:27.476]                 if shard.get("errmsg") and not shard.get("ok"):
       [2024/08/01 10:48:27.476]                     details = shard
       [2024/08/01 10:48:27.476]                     break
       [2024/08/01 10:48:27.476]         errmsg = details["errmsg"]
       [2024/08/01 10:48:27.476]         code = details.get("code")
       [2024/08/01 10:48:27.476]         # For allowable errors, only check for error messages when the code is not
       [2024/08/01 10:48:27.476]         # included.
       [2024/08/01 10:48:27.476]         if allowable_errors:
       [2024/08/01 10:48:27.476]             if code is not None:
       [2024/08/01 10:48:27.476]                 if code in allowable_errors:
       [2024/08/01 10:48:27.476]                     return
       [2024/08/01 10:48:27.476]             elif errmsg in allowable_errors:
       [2024/08/01 10:48:27.476]                 return
       [2024/08/01 10:48:27.476]         # Server is "not primary" or "recovering"
       [2024/08/01 10:48:27.476]         if code is not None:
       [2024/08/01 10:48:27.476]             if code in _NOT_PRIMARY_CODES:
       [2024/08/01 10:48:27.476]                 raise NotPrimaryError(errmsg, response)
       [2024/08/01 10:48:27.476]         elif HelloCompat.LEGACY_ERROR in errmsg or "node is recovering" in errmsg:
       [2024/08/01 10:48:27.476]             raise NotPrimaryError(errmsg, response)
       [2024/08/01 10:48:27.476]         # Other errors
       [2024/08/01 10:48:27.476]         # findAndModify with upsert can raise duplicate key error
       [2024/08/01 10:48:27.476]         if code in (11000, 11001, 12582):
       [2024/08/01 10:48:27.476]             raise DuplicateKeyError(errmsg, code, response, max_wire_version)
       [2024/08/01 10:48:27.476]         elif code == 50:
       [2024/08/01 10:48:27.476]             raise ExecutionTimeout(errmsg, code, response, max_wire_version)
       [2024/08/01 10:48:27.476]         elif code == 43:
       [2024/08/01 10:48:27.476]             raise CursorNotFound(errmsg, code, response, max_wire_version)
       [2024/08/01 10:48:27.476] >       raise OperationFailure(errmsg, code, response, max_wire_version)
       [2024/08/01 10:48:27.476] E       pymongo.errors.OperationFailure: BSON field 'root.sp' is an unknown field., full error: {'ok': 0.0, 'errmsg': "BSON field 'root.sp' is an unknown field.", 'code': 40415, 'codeName': 'IDLUnknownField', '$clusterTime': {'clusterTime': Timestamp(1722534503, 46), 'signature': {'hash': b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'keyId': 0}}, 'operationTime': Timestamp(1722534503, 46)}
      

      https://evergreen.mongodb.com/task/mongo_python_driver_tests_python_version_rhel8_test_encryption__platform~rhel8_auth_ssl~noauth_nossl_python_version~pypy3.10_encryption~encryption_crypt_shared_test_8.0_replica_set_afd0b6f84c821f7bbafb698c4c9c784a3f400470_24_07_25_16_55_26

            Assignee:
            Unassigned Unassigned
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: