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

Test Failure - TestUnifiedNamedKMSRewrapManyDataKey.test_rewrap_from_aws:name1_to_aws:name2

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

      TestUnifiedNamedKMSRewrapManyDataKey.test_rewrap_from_aws:name1_to_aws:name2 is failing with "failed to create KMS message: Access key ID not set":

       [2024/02/29 03:25:18.537] =================================== FAILURES ===================================
       [2024/02/29 03:25:18.537] _ TestUnifiedNamedKMSRewrapManyDataKey.test_rewrap_from_aws:name1_to_aws:name2 _
       [2024/02/29 03:25:18.537]     @contextlib.contextmanager
       [2024/02/29 03:25:18.537]     def _wrap_encryption_errors() -> Iterator[None]:
       [2024/02/29 03:25:18.537]         """Context manager to wrap encryption related errors."""
       [2024/02/29 03:25:18.537]         try:
       [2024/02/29 03:25:18.537] >           yield
       [2024/02/29 03:25:18.537] pymongo/encryption.py:100:
       [2024/02/29 03:25:18.537] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
       [2024/02/29 03:25:18.537] pymongo/encryption.py:1068: in rewrap_many_data_key
       [2024/02/29 03:25:18.537]     raw_result = self._encryption.rewrap_many_data_key(filter, provider, master_key)
       [2024/02/29 03:25:18.538] ../../lib/python3.12/site-packages/pymongocrypt/explicit_encrypter.py:190: in rewrap_many_data_key
       [2024/02/29 03:25:18.538]     return run_state_machine(ctx, self.callback)
       [2024/02/29 03:25:18.538] ../../lib/python3.12/site-packages/pymongocrypt/state_machine.py:151: in run_state_machine
       [2024/02/29 03:25:18.538]     ctx.complete_kms()
       [2024/02/29 03:25:18.538] ../../lib/python3.12/site-packages/pymongocrypt/mongocrypt.py:458: in complete_kms
       [2024/02/29 03:25:18.538]     self._raise_from_status()
       [2024/02/29 03:25:18.538] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
       [2024/02/29 03:25:18.538] self = <pymongocrypt.mongocrypt.RewrapManyDataKeyContext object at 0x7f0b66d9f4c0>
       [2024/02/29 03:25:18.538]     def _raise_from_status(self):
       [2024/02/29 03:25:18.538]         status = lib.mongocrypt_status_new()
       [2024/02/29 03:25:18.538]         try:
       [2024/02/29 03:25:18.538]             lib.mongocrypt_ctx_status(self.__ctx, status)
       [2024/02/29 03:25:18.538]             exc = MongoCryptError.from_status(status)
       [2024/02/29 03:25:18.538]         finally:
       [2024/02/29 03:25:18.538]             lib.mongocrypt_status_destroy(status)
       [2024/02/29 03:25:18.538] >       raise exc
       [2024/02/29 03:25:18.538] E       pymongocrypt.errors.MongoCryptError: failed to create KMS message: Access key ID not set
       [2024/02/29 03:25:18.538] ../../lib/python3.12/site-packages/pymongocrypt/mongocrypt.py:414: MongoCryptError
       [2024/02/29 03:25:18.538] The above exception was the direct cause of the following exception:
       [2024/02/29 03:25:18.538] self = <test.test_encryption.TestUnifiedNamedKMSRewrapManyDataKey testMethod=test_rewrap_from_aws:name1_to_aws:name2>
       [2024/02/29 03:25:18.538]     def test_case(self):
       [2024/02/29 03:25:18.538] >       self.run_scenario(spec)
       [2024/02/29 03:25:18.538] test/unified_format.py:1854:
       [2024/02/29 03:25:18.538] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
       [2024/02/29 03:25:18.538] test/unified_format.py:1801: in run_scenario
       [2024/02/29 03:25:18.538]     self._run_scenario(spec, uri)
       [2024/02/29 03:25:18.538] test/unified_format.py:1831: in _run_scenario
       [2024/02/29 03:25:18.538]     self.run_operations(spec["operations"])
       [2024/02/29 03:25:18.538] test/unified_format.py:1693: in run_operations
       [2024/02/29 03:25:18.538]     self.run_entity_operation(op)
       [2024/02/29 03:25:18.538] test/unified_format.py:1435: in run_entity_operation
       [2024/02/29 03:25:18.538]     result = cmd(**dict(arguments))
       [2024/02/29 03:25:18.538] test/unified_format.py:1329: in _clientEncryptionOperation_rewrapManyDataKey
       [2024/02/29 03:25:18.538]     data = target.rewrap_many_data_key(*args, **kwargs)
       [2024/02/29 03:25:18.538] ../../../../synchro/__init__.py:143: in _wrap_synchro
       [2024/02/29 03:25:18.538]     motor_obj = fn(*args, **kwargs)
       [2024/02/29 03:25:18.538] ../../../../synchro/__init__.py:201: in _unwrap_synchro
       [2024/02/29 03:25:18.538]     return fn(*args, **kwargs)
       [2024/02/29 03:25:18.538] ../../../../synchro/__init__.py:346: in synchronized_method
       [2024/02/29 03:25:18.538]     return loop.run_sync(partial)
       [2024/02/29 03:25:18.538] ../../lib/python3.12/site-packages/tornado/ioloop.py:539: in run_sync
       [2024/02/29 03:25:18.538]     return future_cell[0].result()
       [2024/02/29 03:25:18.538] /opt/python/3.12/lib/python3.12/concurrent/futures/thread.py:58: in run
       [2024/02/29 03:25:18.538]     result = self.fn(*self.args, **self.kwargs)
       [2024/02/29 03:25:18.538] pymongo/encryption.py:1067: in rewrap_many_data_key
       [2024/02/29 03:25:18.538]     with _wrap_encryption_errors():
       [2024/02/29 03:25:18.538] /opt/python/3.12/lib/python3.12/contextlib.py:155: in __exit__
       [2024/02/29 03:25:18.538]     self.gen.throw(value)
       [2024/02/29 03:25:18.538] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
       [2024/02/29 03:25:18.538]     @contextlib.contextmanager
       [2024/02/29 03:25:18.538]     def _wrap_encryption_errors() -> Iterator[None]:
       [2024/02/29 03:25:18.538]         """Context manager to wrap encryption related errors."""
       [2024/02/29 03:25:18.538]         try:
       [2024/02/29 03:25:18.538]             yield
       [2024/02/29 03:25:18.538]         except BSONError:
       [2024/02/29 03:25:18.538]             # BSON encoding/decoding errors are unrelated to encryption so
       [2024/02/29 03:25:18.538]             # we should propagate them unchanged.
       [2024/02/29 03:25:18.538]             raise
       [2024/02/29 03:25:18.538]         except Exception as exc:
       [2024/02/29 03:25:18.538] >           raise EncryptionError(exc) from exc
       [2024/02/29 03:25:18.538] E           pymongo.errors.EncryptionError: failed to create KMS message: Access key ID not set
       [2024/02/29 03:25:18.538] pymongo/encryption.py:106: EncryptionError
      

      https://spruce.mongodb.com/task/motor_main__ssl~nossl_tox_env~synchro_py312_os~rhel84_test_4.4_replica_set_d9024241096840427565acc0635764c1bae19845_24_02_29_10_57_16/logs?execution=0&sortBy=STATUS&sortDir=ASC

      Could be caused by PYTHON-4112 or the recent credential rotations.

            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: