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

test_encryption.TestAutomaticDecryptionKeys.test_03_invalid_keyid incorrect regex error

    • Type: Icon: Build Failure Build Failure
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.12, 4.11.3
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers
    • Not Needed

      Name of Failure:

      asynchronous.test_encryption.TestAutomaticDecryptionKeys.test_03_invalid_keyid incorrect regex error
      test_encryption.TestAutomaticDecryptionKeys.test_03_invalid_keyid incorrect regex error

      Link to task:

      https://spruce.mongodb.com/task/mongo_python_driver_encryption_rhel8_python3.10_test_latest_sharded_cluster_auth_ssl_sync_async_patch_7ef18af49b35335d8cf92746c8bcfde65e0d989f_67d07ef5de25770007ed2b08_25_03_11_18_20_48?execution=0&sortBy=STATUS&sortDir=ASC

      Context of when and why the failure occurred:

      Stack trace:

       [2025/03/11 11:57:22.754] pymongo/helpers_shared.py:250: OperationFailure
       [2025/03/11 11:57:22.754] The above exception was the direct cause of the following exception:
       [2025/03/11 11:57:22.754] Traceback (most recent call last):
       [2025/03/11 11:57:22.754]   File "/data/mci/bdc95a1868ac5c7719481b8341d6ebdb/src/pymongo/asynchronous/encryption.py", line 764, in create_encrypted_collection
       [2025/03/11 11:57:22.754]     await database.create_collection(name=name, **kwargs),
       [2025/03/11 11:57:22.754]   File "/data/mci/bdc95a1868ac5c7719481b8341d6ebdb/src/pymongo/_csot.py", line 109, in csot_wrapper
       [2025/03/11 11:57:22.754]     return await func(self, *args, **kwargs)
       [2025/03/11 11:57:22.754]   File "/data/mci/bdc95a1868ac5c7719481b8341d6ebdb/src/pymongo/asynchronous/database.py", line 631, in create_collection
       [2025/03/11 11:57:22.754]     await coll._create(kwargs, s)
       [2025/03/11 11:57:22.754]   File "/data/mci/bdc95a1868ac5c7719481b8341d6ebdb/src/pymongo/asynchronous/collection.py", line 692, in _create
       [2025/03/11 11:57:22.754]     await self._create_helper(
       [2025/03/11 11:57:22.754]   File "/data/mci/bdc95a1868ac5c7719481b8341d6ebdb/src/pymongo/asynchronous/collection.py", line 663, in _create_helper
       [2025/03/11 11:57:22.754]     await self._command(
       [2025/03/11 11:57:22.754]   File "/data/mci/bdc95a1868ac5c7719481b8341d6ebdb/src/pymongo/asynchronous/collection.py", line 620, in _command
       [2025/03/11 11:57:22.754]     return await conn.command(
       [2025/03/11 11:57:22.754]   File "/data/mci/bdc95a1868ac5c7719481b8341d6ebdb/src/pymongo/asynchronous/helpers.py", line 47, in inner
       [2025/03/11 11:57:22.754]     return await func(*args, **kwargs)
       [2025/03/11 11:57:22.754]   File "/data/mci/bdc95a1868ac5c7719481b8341d6ebdb/src/pymongo/asynchronous/pool.py", line 534, in command
       [2025/03/11 11:57:22.754]     return await command(
       [2025/03/11 11:57:22.754]   File "/data/mci/bdc95a1868ac5c7719481b8341d6ebdb/src/pymongo/asynchronous/network.py", line 217, in command
       [2025/03/11 11:57:22.754]     helpers_shared._check_command_response(
       [2025/03/11 11:57:22.754]   File "/data/mci/bdc95a1868ac5c7719481b8341d6ebdb/src/pymongo/helpers_shared.py", line 250, in _check_command_response
       [2025/03/11 11:57:22.754]     raise OperationFailure(errmsg, code, response, max_wire_version)
       [2025/03/11 11:57:22.754] pymongo.errors.OperationFailure: BSON field 'checkAuthForCreateCollection.encryptedFields.fields.keyId' is the wrong type 'bool', expected type 'binData', full error: {'ok': 0.0, 'errmsg': "BSON field 'checkAuthForCreateCollection.encryptedFields.fields.keyId' is the wrong type 'bool', expected type 'binData'", 'code': 14, 'codeName': 'TypeMismatch', '$clusterTime': {'clusterTime': Timestamp(1741719251, 141), 'signature': {'hash': b'\x81\x9aC\xf196{2\xb3\xfbRc\x98IY(D\x07\xd6m', 'keyId': 7480626208246333466}}, 'operationTime': Timestamp(1741719251, 141)}
       [2025/03/11 11:57:22.754] The above exception was the direct cause of the following exception:
       [2025/03/11 11:57:22.754] pymongo.errors.EncryptedCollectionError: BSON field 'checkAuthForCreateCollection.encryptedFields.fields.keyId' is the wrong type 'bool', expected type 'binData', full error: {'ok': 0.0, 'errmsg': "BSON field 'checkAuthForCreateCollection.encryptedFields.fields.keyId' is the wrong type 'bool', expected type 'binData'", 'code': 14, 'codeName': 'TypeMismatch', '$clusterTime': {'clusterTime': Timestamp(1741719251, 141), 'signature': {'hash': b'\x81\x9aC\xf196{2\xb3\xfbRc\x98IY(D\x07\xd6m', 'keyId': 7480626208246333466}}, 'operationTime': Timestamp(1741719251, 141)}
       [2025/03/11 11:57:22.754] During handling of the above exception, another exception occurred:
       [2025/03/11 11:57:22.754] self = <test.asynchronous.test_encryption.TestAutomaticDecryptionKeys testMethod=test_03_invalid_keyid>
       [2025/03/11 11:57:22.754]     async def test_03_invalid_keyid(self):
       [2025/03/11 11:57:22.754] >       with self.assertRaisesRegex(
       [2025/03/11 11:57:22.754]             EncryptedCollectionError,
       [2025/03/11 11:57:22.754]             "create.encryptedFields.fields.keyId' is the wrong type 'bool', expected type 'binData",
       [2025/03/11 11:57:22.754]         ):
       [2025/03/11 11:57:22.754] E       AssertionError: "create.encryptedFields.fields.keyId' is the wrong type 'bool', expected type 'binData" does not match "BSON field 'checkAuthForCreateCollection.encryptedFields.fields.keyId' is the wrong type 'bool', expected type 'binData', full error: {'ok': 0.0, 'errmsg': "BSON field 'checkAuthForCreateCollection.encryptedFields.fields.keyId' is the wrong type 'bool', expected type 'binData'", 'code': 14, 'codeName': 'TypeMismatch', '$clusterTime': {'clusterTime': Timestamp(1741719251, 141), 'signature': {'hash': b'\x81\x9aC\xf196{2\xb3\xfbRc\x98IY(D\x07\xd6m', 'keyId': 7480626208246333466}}, 'operationTime': Timestamp(1741719251, 141)}"
       [2025/03/11 11:57:22.754] test/asynchronous/test_encryption.py:2985: AssertionError
      

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

              Created:
              Updated:
              Resolved: