Uploaded image for project: 'Motor'
  1. Motor
  2. MOTOR-1257

Test Failure - TestExplicitSimple.test_validation

    • Type: Icon: Build Failure Build Failure
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 3.4
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers

       [2024/02/20 12:41:49.108] =================================== FAILURES ===================================
       [2024/02/20 12:41:49.108] ______________________ TestExplicitSimple.test_validation ______________________
       [2024/02/20 12:41:49.108]     @contextlib.contextmanager
       [2024/02/20 12:41:49.108]     def _wrap_encryption_errors() -> Iterator[None]:
       [2024/02/20 12:41:49.108]         """Context manager to wrap encryption related errors."""
       [2024/02/20 12:41:49.108]         try:
       [2024/02/20 12:41:49.108] >           yield
       [2024/02/20 12:41:49.108] .tox/test-pymongo-latest/lib/python3.7/site-packages/pymongo/encryption.py:100:
       [2024/02/20 12:41:49.108] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
       [2024/02/20 12:41:49.108] .tox/test-pymongo-latest/lib/python3.7/site-packages/pymongo/encryption.py:798: in _encrypt_helper
       [2024/02/20 12:41:49.108]     is_expression=is_expression,
       [2024/02/20 12:41:49.108] .tox/test-pymongo-latest/lib/python3.7/site-packages/pymongocrypt/explicit_encrypter.py:231: in encrypt
       [2024/02/20 12:41:49.108]     return run_state_machine(ctx, self.callback)
       [2024/02/20 12:41:49.108] .tox/test-pymongo-latest/lib/python3.7/site-packages/pymongocrypt/state_machine.py:146: in run_state_machine
       [2024/02/20 12:41:49.108]     ctx.complete_mongo_operation()
       [2024/02/20 12:41:49.108] .tox/test-pymongo-latest/lib/python3.7/site-packages/pymongocrypt/mongocrypt.py:434: in complete_mongo_operation
       [2024/02/20 12:41:49.108]     self._raise_from_status()
       [2024/02/20 12:41:49.108] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
       [2024/02/20 12:41:49.109] self = <pymongocrypt.mongocrypt.ExplicitEncryptionContext object at 0x7f5b098066d0>
       [2024/02/20 12:41:49.109]     def _raise_from_status(self):
       [2024/02/20 12:41:49.109]         status = lib.mongocrypt_status_new()
       [2024/02/20 12:41:49.109]         try:
       [2024/02/20 12:41:49.109]             lib.mongocrypt_ctx_status(self.__ctx, status)
       [2024/02/20 12:41:49.109]             exc = MongoCryptError.from_status(status)
       [2024/02/20 12:41:49.109]         finally:
       [2024/02/20 12:41:49.109]             lib.mongocrypt_status_destroy(status)
       [2024/02/20 12:41:49.109] >       raise exc
       [2024/02/20 12:41:49.109] E       pymongocrypt.errors.MongoCryptError: not all keys requested were satisfied. Verify that key vault DB/collection name was correctly specified.
       [2024/02/20 12:41:49.109] .tox/test-pymongo-latest/lib/python3.7/site-packages/pymongocrypt/mongocrypt.py:412: MongoCryptError
       [2024/02/20 12:41:49.109] The above exception was the direct cause of the following exception:
       [2024/02/20 12:41:49.109] self = <test.asyncio_tests.test_asyncio_encryption.TestExplicitSimple testMethod=test_validation>
       [2024/02/20 12:41:49.109]     @asyncio_test
       [2024/02/20 12:41:49.109]     async def test_validation(self):
       [2024/02/20 12:41:49.109]         client = self.asyncio_client()
       [2024/02/20 12:41:49.109]         client_encryption = AsyncIOMotorClientEncryption(
       [2024/02/20 12:41:49.109]             KMS_PROVIDERS, "keyvault.datakeys", client, OPTS
       [2024/02/20 12:41:49.109]         )
       [2024/02/20 12:41:49.109]         msg = "value to decrypt must be a bson.binary.Binary with subtype 6"
       [2024/02/20 12:41:49.109]         with self.assertRaisesRegex(TypeError, msg):
       [2024/02/20 12:41:49.109]             await client_encryption.decrypt("str")
       [2024/02/20 12:41:49.109]         with self.assertRaisesRegex(TypeError, msg):
       [2024/02/20 12:41:49.109]             await client_encryption.decrypt(Binary(b"123"))
       [2024/02/20 12:41:49.109]         msg = "key_id must be a bson.binary.Binary with subtype 4"
       [2024/02/20 12:41:49.109]         algo = Algorithm.AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic
       [2024/02/20 12:41:49.109]         with self.assertRaisesRegex(TypeError, msg):
       [2024/02/20 12:41:49.109] >           await client_encryption.encrypt("str", algo, key_id=uuid.uuid4())
       [2024/02/20 12:41:49.109] test/asyncio_tests/test_asyncio_encryption.py:102:
       [2024/02/20 12:41:49.109] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
       [2024/02/20 12:41:49.109] /opt/python/3.7/lib/python3.7/concurrent/futures/thread.py:57: in run
       [2024/02/20 12:41:49.109]     result = self.fn(*self.args, **self.kwargs)
       [2024/02/20 12:41:49.109] .tox/test-pymongo-latest/lib/python3.7/site-packages/pymongo/encryption.py:849: in encrypt
       [2024/02/20 12:41:49.109]     is_expression=False,
       [2024/02/20 12:41:49.109] .tox/test-pymongo-latest/lib/python3.7/site-packages/pymongo/encryption.py:800: in _encrypt_helper
       [2024/02/20 12:41:49.109]     return decode(encrypted_doc)["v"]
       [2024/02/20 12:41:49.109] /opt/python/3.7/lib/python3.7/contextlib.py:130: in __exit__
       [2024/02/20 12:41:49.109]     self.gen.throw(type, value, traceback)
       [2024/02/20 12:41:49.109] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
       [2024/02/20 12:41:49.109]     @contextlib.contextmanager
       [2024/02/20 12:41:49.109]     def _wrap_encryption_errors() -> Iterator[None]:
       [2024/02/20 12:41:49.109]         """Context manager to wrap encryption related errors."""
       [2024/02/20 12:41:49.109]         try:
       [2024/02/20 12:41:49.109]             yield
       [2024/02/20 12:41:49.109]         except BSONError:
       [2024/02/20 12:41:49.109]             # BSON encoding/decoding errors are unrelated to encryption so
       [2024/02/20 12:41:49.109]             # we should propagate them unchanged.
       [2024/02/20 12:41:49.109]             raise
       [2024/02/20 12:41:49.109]         except Exception as exc:
       [2024/02/20 12:41:49.109] >           raise EncryptionError(exc) from exc
       [2024/02/20 12:41:49.109] E           pymongo.errors.EncryptionError: not all keys requested were satisfied. Verify that key vault DB/collection name was correctly specified.
       [2024/02/20 12:41:49.109] .tox/test-pymongo-latest/lib/python3.7/site-packages/pymongo/encryption.py:106: EncryptionError
       [2024/02/20 12:41:49.109] ------------------------------ Captured log call -------------------------------
       [2024/02/20 12:41:49.109] INFO     pymongo.serverSelection:logger.py:94 {"message": "Waiting for suitable server to become available", "selector": "<function writable_server_selector at 0x7f5b0ced6290>", "operation": "drop", "topologyDescription": "<TopologyDescription id: 65d50e77f6c0fa65476d74c3, topology_type: Unknown, servers: [<ServerDescription ('localhost', 27017) server_type: Unknown, rtt: None>]>", "clientId": {"$oid": "65d50e77f6c0fa65476d74c3"}, "remainingTimeMS": 29}
       [2024/02/20 12:41:49.109] INFO     pymongo.serverSelection:logger.py:94 {"message": "Waiting for suitable server to become available", "selector": "Primary()", "operation": "find", "topologyDescription": "<TopologyDescription id: 65d50e77f6c0fa65476d74c4, topology_type: Unknown, servers: [<ServerDescription ('localhost', 27017) server_type: Unknown, rtt: None>]>", "clientId": {"$oid": "65d50e77f6c0fa65476d74c4"}, "remainingTimeMS": 29}
      

      https://spruce.mongodb.com/task/motor_main__ssl~nossl_tox_env~test_pymongo_latest_os~rhel84_test_latest_standalone_patch_928213a715463065aef97ae283a3dce1967360f9_65d50b42850e6194dd8faa6c_24_02_20_20_27_54/logs?execution=0&sortBy=STATUS&sortDir=ASC

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

              Created:
              Updated:
              Resolved: