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

Shared library encryption tests intermittently failing

    • Type: Icon: Build Failure Build Failure
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: Evergreen, Tests
    • None

      There are multiple errors that sometimes happen in the encryption tests when using the shared library:

       [2022/12/20 20:14:45.270] ======================================================================
       [2022/12/20 20:14:45.270] ERROR: test_via_loading_shared_library (test.test_encryption.TestBypassSpawningMongocryptdProse)
       [2022/12/20 20:14:45.270] ----------------------------------------------------------------------
       [2022/12/20 20:14:45.270] Traceback (most recent call last):
       [2022/12/20 20:14:45.270]   File "/data/mci/38958f82d49fb890b18b3b97f95513be/src/pymongo/encryption.py", line 77, in _wrap_encryption_errors
       [2022/12/20 20:14:45.270]     yield
       [2022/12/20 20:14:45.270]   File "/data/mci/38958f82d49fb890b18b3b97f95513be/src/pymongo/encryption.py", line 365, in encrypt
       [2022/12/20 20:14:45.271]     encrypted_cmd = self._auto_encrypter.encrypt(database, encoded_cmd)
       [2022/12/20 20:14:45.271]   File "/data/mci/38958f82d49fb890b18b3b97f95513be/src/venv-encryption/lib/python3.8/site-packages/pymongocrypt/auto_encrypter.py", line 44, in encrypt
       [2022/12/20 20:14:45.271]     return run_state_machine(ctx, self.callback)
       [2022/12/20 20:14:45.271]   File "/data/mci/38958f82d49fb890b18b3b97f95513be/src/venv-encryption/lib/python3.8/site-packages/pymongocrypt/state_machine.py", line 146, in run_state_machine
       [2022/12/20 20:14:45.271]     ctx.complete_mongo_operation()
       [2022/12/20 20:14:45.271]   File "/data/mci/38958f82d49fb890b18b3b97f95513be/src/venv-encryption/lib/python3.8/site-packages/pymongocrypt/mongocrypt.py", line 450, in complete_mongo_operation
       [2022/12/20 20:14:45.271]     self._raise_from_status()
       [2022/12/20 20:14:45.271]   File "/data/mci/38958f82d49fb890b18b3b97f95513be/src/venv-encryption/lib/python3.8/site-packages/pymongocrypt/mongocrypt.py", line 428, in _raise_from_status
       [2022/12/20 20:14:45.271]     raise exc
       [2022/12/20 20:14:45.271] pymongocrypt.errors.MongoCryptError: not all keys requested were satisfied
       [2022/12/20 20:14:45.271] During handling of the above exception, another exception occurred:
       [2022/12/20 20:14:45.271] Traceback (most recent call last):
       [2022/12/20 20:14:45.271]   File "/data/mci/38958f82d49fb890b18b3b97f95513be/src/test/test_encryption.py", line 1936, in test_via_loading_shared_library
       [2022/12/20 20:14:45.271]     client_encrypted.db.coll.insert_one({"encrypted": "test"})
       [2022/12/20 20:14:45.271]   File "/data/mci/38958f82d49fb890b18b3b97f95513be/src/pymongo/collection.py", line 626, in insert_one
       [2022/12/20 20:14:45.271]     self._insert_one(
       [2022/12/20 20:14:45.271]   File "/data/mci/38958f82d49fb890b18b3b97f95513be/src/pymongo/collection.py", line 567, in _insert_one
       [2022/12/20 20:14:45.271]     self.__database.client._retryable_write(acknowledged, _insert_command, session)
       [2022/12/20 20:14:45.271]   File "/data/mci/38958f82d49fb890b18b3b97f95513be/src/pymongo/mongo_client.py", line 1482, in _retryable_write
       [2022/12/20 20:14:45.271]     return self._retry_with_session(retryable, func, s, None)
       [2022/12/20 20:14:45.271]   File "/data/mci/38958f82d49fb890b18b3b97f95513be/src/pymongo/mongo_client.py", line 1349, in _retry_with_session
       [2022/12/20 20:14:45.271]     return self._retry_internal(retryable, func, session, bulk)
       [2022/12/20 20:14:45.271]   File "/data/mci/38958f82d49fb890b18b3b97f95513be/src/pymongo/_csot.py", line 105, in csot_wrapper
       [2022/12/20 20:14:45.271]     return func(self, *args, **kwargs)
       [2022/12/20 20:14:45.271]   File "/data/mci/38958f82d49fb890b18b3b97f95513be/src/pymongo/mongo_client.py", line 1390, in _retry_internal
       [2022/12/20 20:14:45.271]     return func(session, sock_info, retryable)
       [2022/12/20 20:14:45.271]   File "/data/mci/38958f82d49fb890b18b3b97f95513be/src/pymongo/collection.py", line 555, in _insert_command
       [2022/12/20 20:14:45.271]     result = sock_info.command(
       [2022/12/20 20:14:45.271]   File "/data/mci/38958f82d49fb890b18b3b97f95513be/src/pymongo/pool.py", line 795, in command
       [2022/12/20 20:14:45.271]     self._raise_connection_failure(error)
       [2022/12/20 20:14:45.271]   File "/data/mci/38958f82d49fb890b18b3b97f95513be/src/pymongo/pool.py", line 767, in command
       [2022/12/20 20:14:45.271]     return command(
       [2022/12/20 20:14:45.271]   File "/data/mci/38958f82d49fb890b18b3b97f95513be/src/pymongo/network.py", line 117, in command
       [2022/12/20 20:14:45.271]     spec = orig = client._encrypter.encrypt(dbname, spec, codec_options)
       [2022/12/20 20:14:45.271]   File "/data/mci/38958f82d49fb890b18b3b97f95513be/src/pymongo/encryption.py", line 368, in encrypt
       [2022/12/20 20:14:45.271]     return encrypt_cmd
       [2022/12/20 20:14:45.271]   File "/opt/python/3.8/lib/python3.8/contextlib.py", line 131, in __exit__
       [2022/12/20 20:14:45.271]     self.gen.throw(type, value, traceback)
       [2022/12/20 20:14:45.271]   File "/data/mci/38958f82d49fb890b18b3b97f95513be/src/pymongo/encryption.py", line 83, in _wrap_encryption_errors
       [2022/12/20 20:14:45.271]     raise EncryptionError(exc)
       [2022/12/20 20:14:45.271] pymongo.errors.EncryptionError: not all keys requested were satisfied
       [2022/12/20 20:14:45.271] ----------------------------------------------------------------------
      

      https://evergreen.mongodb.com/build/mongo_python_driver_tests_python_version_ubuntu18_test_encryption__platform~ubuntu_18.04_auth_ssl~noauth_nossl_python_version~3.8_encryption~encryption_crypt_shared_f5d09e1c97ca12c94c555b40364b2ae10ec5126c_22_12_20_19_39_04

       [2022/12/20 22:35:48.583] ERROR: test_legacy_badQueries_$pullAll_succeeds_on_unencrypted,_error_on_encrypted (test.test_encryption.TestSpec)
       [2022/12/20 22:35:48.583] ----------------------------------------------------------------------
       [2022/12/20 22:35:48.583] Traceback (most recent call last):
       [2022/12/20 22:35:48.583]   File "C:\data\mci\7d56f8d50d34074aa87d3e48f70ad8bc\src\test\__init__.py", line 603, in wrap
       [2022/12/20 22:35:48.583]     return f(*args, **kwargs)
       [2022/12/20 22:35:48.583]   File "C:\data\mci\7d56f8d50d34074aa87d3e48f70ad8bc\src\test\__init__.py", line 603, in wrap
       [2022/12/20 22:35:48.583]     return f(*args, **kwargs)
       [2022/12/20 22:35:48.583]   File "C:\data\mci\7d56f8d50d34074aa87d3e48f70ad8bc\src\test\test_encryption.py", line 686, in run_scenario
       [2022/12/20 22:35:48.583]     self.run_scenario(scenario_def, test)
       [2022/12/20 22:35:48.583]   File "C:\data\mci\7d56f8d50d34074aa87d3e48f70ad8bc\src\test\utils_spec_runner.py", line 520, in run_scenario
       [2022/12/20 22:35:48.583]     client = rs_client(
       [2022/12/20 22:35:48.583]   File "C:\data\mci\7d56f8d50d34074aa87d3e48f70ad8bc\src\test\utils.py", line 595, in rs_client
       [2022/12/20 22:35:48.583]     return _mongo_client(h, p, **kwargs)
       [2022/12/20 22:35:48.583]   File "C:\data\mci\7d56f8d50d34074aa87d3e48f70ad8bc\src\test\utils.py", line 575, in _mongo_client
       [2022/12/20 22:35:48.583]     return MongoClient(uri, port, **client_options)
       [2022/12/20 22:35:48.583]   File "C:\data\mci\7d56f8d50d34074aa87d3e48f70ad8bc\src\pymongo\mongo_client.py", line 831, in __init__
       [2022/12/20 22:35:48.583]     self._encrypter = _Encrypter(self, self.__options.auto_encryption_opts)
       [2022/12/20 22:35:48.583]   File "C:\data\mci\7d56f8d50d34074aa87d3e48f70ad8bc\src\pymongo\encryption.py", line 337, in __init__
       [2022/12/20 22:35:48.583]     self._auto_encrypter = AutoEncrypter(
       [2022/12/20 22:35:48.583]   File "Z:\data\mci\7d56f8d50d34074aa87d3e48f70ad8bc\src\venv-encryption\lib\site-packages\pymongocrypt\auto_encrypter.py", line 31, in __init__
       [2022/12/20 22:35:48.583]     self.mongocrypt = MongoCrypt(mongo_crypt_opts, callback)
       [2022/12/20 22:35:48.583]   File "Z:\data\mci\7d56f8d50d34074aa87d3e48f70ad8bc\src\venv-encryption\lib\site-packages\pymongocrypt\mongocrypt.py", line 194, in __init__
       [2022/12/20 22:35:48.583]     self.__init()
       [2022/12/20 22:35:48.583]   File "Z:\data\mci\7d56f8d50d34074aa87d3e48f70ad8bc\src\venv-encryption\lib\site-packages\pymongocrypt\mongocrypt.py", line 263, in __init
       [2022/12/20 22:35:48.583]     self.__raise_from_status()
       [2022/12/20 22:35:48.583]   File "Z:\data\mci\7d56f8d50d34074aa87d3e48f70ad8bc\src\venv-encryption\lib\site-packages\pymongocrypt\mongocrypt.py", line 279, in __raise_from_status
       [2022/12/20 22:35:48.583]     raise exc
       [2022/12/20 22:35:48.583] pymongocrypt.errors.MongoCryptError: csfle lib_create() failed: Cannot initialize the Mongo Crypt Shared Support Library when it is already initialized. [Error 3, code 1]
       [2022/12/20 22:35:48.583] ----------------------------------------------------------------------
      

      https://evergreen.mongodb.com/task/mongo_python_driver_tests_windows_encryption__platform~windows_64_vsMulti_small_auth_ssl~noauth_nossl_python_version_windows~3.10_encryption~encryption_crypt_shared_test_6.0_sharded_cluster_f5d09e1c97ca12c94c555b40364b2ae10ec5126c_22_12_20_19_39_04

            Assignee:
            Unassigned Unassigned
            Reporter:
            julius.park@mongodb.com Julius Park (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: