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

RangePreview encryption test failures

    • Type: Icon: Build Failure Build Failure
    • Resolution: Done
    • Priority: Icon: Unknown Unknown
    • 4.8
    • 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?

      Name of Failure:

      test.test_encryption.TestSpec.test_legacy_fle2v2_Range_Date_Aggregate_FLE2_Range_Date_Aggregate

      Link to task:

      https://spruce.mongodb.com/task/mongo_python_driver_tests_python_version_rhel8_test_encryption__platform~rhel8_auth_ssl~noauth_nossl_python_version~3.10_encryption~encryption_test_latest_sharded_cluster_patch_9f0c0c50d715849a7a5e21e4a4f91a30fa6abdaa_662abe7fb5af3b0007cd7430_24_04_25_20_35_20?execution=0&sortBy=STATUS&sortDir=ASC

      Context of when and why the failure occurred:

      Stack trace:

      **

       [2024/04/25 13:47:37.469] FAILURE: pymongo.errors.OperationFailure: Cannot create a collection with an encrypted field with query type rangePreview, as it is deprecated, full error: {'ok': 0.0, 'errmsg': 'Cannot create a collection with an encrypted field with query type rangePreview, as it is deprecated', 'code': 8575605, 'codeName': 'Location8575605', '$clusterTime': {'clusterTime': Timestamp(1714078051, 34), '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(1714078051, 34)} ()
       [2024/04/25 13:47:37.469] self = <test.test_encryption.TestSpec testMethod=test_legacy_fle2v2_Range_Date_Aggregate_FLE2_Range_Date__Aggregate_>
       [2024/04/25 13:47:37.469]     @client_context.require_test_commands
       [2024/04/25 13:47:37.469]     def run_scenario(self):
       [2024/04/25 13:47:37.469] >       self.run_scenario(scenario_def, test)
       [2024/04/25 13:47:37.469] test/test_encryption.py:706: 
       [2024/04/25 13:47:37.469] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
       [2024/04/25 13:47:37.469] test/utils_spec_runner.py:495: in run_scenario
       [2024/04/25 13:47:37.469]     self.setup_scenario(scenario_def)
       [2024/04/25 13:47:37.469] test/test_encryption.py:687: in setup_scenario
       [2024/04/25 13:47:37.469]     db.create_collection(coll_name, **kwargs)
       [2024/04/25 13:47:37.469] pymongo/_csot.py:108: in csot_wrapper
       [2024/04/25 13:47:37.469]     return func(self, *args, **kwargs)
       [2024/04/25 13:47:37.469] pymongo/database.py:462: in create_collection
       [2024/04/25 13:47:37.469]     return Collection(
       [2024/04/25 13:47:37.469] pymongo/collection.py:250: in __init__
       [2024/04/25 13:47:37.469]     self.__create(name, kwargs, collation, session, encrypted_fields=encrypted_fields)
       [2024/04/25 13:47:37.469] pymongo/collection.py:344: in __create
       [2024/04/25 13:47:37.469]     self._command(
       [2024/04/25 13:47:37.469] pymongo/collection.py:301: in _command
       [2024/04/25 13:47:37.469]     return conn.command(
       [2024/04/25 13:47:37.469] pymongo/helpers.py:327: in inner
       [2024/04/25 13:47:37.469]     return func(*args, **kwargs)
       [2024/04/25 13:47:37.469] pymongo/pool.py:985: in command
       [2024/04/25 13:47:37.469]     return command(
       [2024/04/25 13:47:37.469] pymongo/network.py:212: in command
       [2024/04/25 13:47:37.469]     helpers._check_command_response(
       [2024/04/25 13:47:37.469] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
       [2024/04/25 13:47:37.469] response = {'$clusterTime': {'clusterTime': Timestamp(1714078051, 34), 'signature': {'hash': b'\x00\x00\x00\x00\x00\x00\x00\x00\x... 'errmsg': 'Cannot create a collection with an encrypted field with query type rangePreview, as it is deprecated', ...}
       [2024/04/25 13:47:37.469] max_wire_version = 26, allowable_errors = None, parse_write_concern_error = True
       [2024/04/25 13:47:37.469]     def _check_command_response(
       [2024/04/25 13:47:37.469]         response: _DocumentOut,
       [2024/04/25 13:47:37.469]         max_wire_version: Optional[int],
       [2024/04/25 13:47:37.469]         allowable_errors: Optional[Container[Union[int, str]]] = None,
       [2024/04/25 13:47:37.469]         parse_write_concern_error: bool = False,
       [2024/04/25 13:47:37.469]     ) -> None:
       [2024/04/25 13:47:37.469]         """Check the response to a command for errors."""
       [2024/04/25 13:47:37.469]         if "ok" not in response:
       [2024/04/25 13:47:37.469]             # Server didn't recognize our message as a command.
       [2024/04/25 13:47:37.469]             raise OperationFailure(
       [2024/04/25 13:47:37.469]                 response.get("$err"),  # type: ignore[arg-type]
       [2024/04/25 13:47:37.469]                 response.get("code"),
       [2024/04/25 13:47:37.469]                 response,
       [2024/04/25 13:47:37.469]                 max_wire_version,
       [2024/04/25 13:47:37.469]             )
       [2024/04/25 13:47:37.469]     
       [2024/04/25 13:47:37.469]         if parse_write_concern_error and "writeConcernError" in response:
       [2024/04/25 13:47:37.469]             _error = response["writeConcernError"]
       [2024/04/25 13:47:37.469]             _labels = response.get("errorLabels")
       [2024/04/25 13:47:37.469]             if _labels:
       [2024/04/25 13:47:37.469]                 _error.update({"errorLabels": _labels})
       [2024/04/25 13:47:37.469]             _raise_write_concern_error(_error)
       [2024/04/25 13:47:37.469]     
       [2024/04/25 13:47:37.469]         if response["ok"]:
       [2024/04/25 13:47:37.469]             return
       [2024/04/25 13:47:37.469]     
       [2024/04/25 13:47:37.469]         details = response
       [2024/04/25 13:47:37.469]         # Mongos returns the error details in a 'raw' object
       [2024/04/25 13:47:37.469]         # for some errors.
       [2024/04/25 13:47:37.469]         if "raw" in response:
       [2024/04/25 13:47:37.469]             for shard in response["raw"].values():
       [2024/04/25 13:47:37.469]                 # Grab the first non-empty raw error from a shard.
       [2024/04/25 13:47:37.469]                 if shard.get("errmsg") and not shard.get("ok"):
       [2024/04/25 13:47:37.469]                     details = shard
       [2024/04/25 13:47:37.469]                     break
       [2024/04/25 13:47:37.469]     
       [2024/04/25 13:47:37.469]         errmsg = details["errmsg"]
       [2024/04/25 13:47:37.469]         code = details.get("code")
       [2024/04/25 13:47:37.469]     
       [2024/04/25 13:47:37.469]         # For allowable errors, only check for error messages when the code is not
       [2024/04/25 13:47:37.469]         # included.
       [2024/04/25 13:47:37.469]         if allowable_errors:
       [2024/04/25 13:47:37.469]             if code is not None:
       [2024/04/25 13:47:37.469]                 if code in allowable_errors:
       [2024/04/25 13:47:37.469]                     return
       [2024/04/25 13:47:37.469]             elif errmsg in allowable_errors:
       [2024/04/25 13:47:37.469]                 return
       [2024/04/25 13:47:37.469]     
       [2024/04/25 13:47:37.469]         # Server is "not primary" or "recovering"
       [2024/04/25 13:47:37.469]         if code is not None:
       [2024/04/25 13:47:37.469]             if code in _NOT_PRIMARY_CODES:
       [2024/04/25 13:47:37.469]                 raise NotPrimaryError(errmsg, response)
       [2024/04/25 13:47:37.469]         elif HelloCompat.LEGACY_ERROR in errmsg or "node is recovering" in errmsg:
       [2024/04/25 13:47:37.469]             raise NotPrimaryError(errmsg, response)
       [2024/04/25 13:47:37.469]     
       [2024/04/25 13:47:37.469]         # Other errors
       [2024/04/25 13:47:37.469]         # findAndModify with upsert can raise duplicate key error
       [2024/04/25 13:47:37.469]         if code in (11000, 11001, 12582):
       [2024/04/25 13:47:37.469]             raise DuplicateKeyError(errmsg, code, response, max_wire_version)
       [2024/04/25 13:47:37.469]         elif code == 50:
       [2024/04/25 13:47:37.469]             raise ExecutionTimeout(errmsg, code, response, max_wire_version)
       [2024/04/25 13:47:37.469]         elif code == 43:
       [2024/04/25 13:47:37.469]             raise CursorNotFound(errmsg, code, response, max_wire_version)
       [2024/04/25 13:47:37.469]     
       [2024/04/25 13:47:37.469] >       raise OperationFailure(errmsg, code, response, max_wire_version)
       [2024/04/25 13:47:37.469] E       pymongo.errors.OperationFailure: Cannot create a collection with an encrypted field with query type rangePreview, as it is deprecated, full error: {'ok': 0.0, 'errmsg': 'Cannot create a collection with an encrypted field with query type rangePreview, as it is deprecated', 'code': 8575605, 'codeName': 'Location8575605', '$clusterTime': {'clusterTime': Timestamp(1714078051, 34), '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(1714078051, 34)}
       [2024/04/25 13:47:37.469] pymongo/helpers.py:233: OperationFailure
      
           

       

            Assignee:
            noah.stapp@mongodb.com Noah Stapp
            Reporter:
            noah.stapp@mongodb.com Noah Stapp
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: