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

FLE spec test failed due to kms server connection timeout

    • Type: Icon: Task Task
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Tests
    • None

      Opening this ticket as an example traceback for what happens when a field level encryption operation fails due to a kms server connection timeout.

      ERROR [10.100s]: test_spec_delete_deleteMany_with_deterministic_encryption (test_encryption.TestSpec)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/pymongo/pool.py", line 1002, in _configured_socket
          sock = ssl_context.wrap_socket(sock, server_hostname=host)
        File "/opt/python/3.7/lib/python3.7/ssl.py", line 423, in wrap_socket
          session=session
        File "/opt/python/3.7/lib/python3.7/ssl.py", line 870, in _create
          self.do_handshake()
        File "/opt/python/3.7/lib/python3.7/ssl.py", line 1139, in do_handshake
          self._sslobj.do_handshake()
      socket.timeout: _ssl.c:1074: The handshake operation timed out
      During handling of the above exception, another exception occurred:
      Traceback (most recent call last):
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/pymongo/encryption.py", line 73, in _wrap_encryption_errors
          yield
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/pymongo/encryption.py", line 273, in encrypt
          encrypted_cmd = self._auto_encrypter.encrypt(database, encoded_cmd)
        File "/opt/python/3.7/lib/python3.7/site-packages/pymongocrypt/auto_encrypter.py", line 44, in encrypt
          return run_state_machine(ctx, self.callback)
        File "/opt/python/3.7/lib/python3.7/site-packages/pymongocrypt/state_machine.py", line 150, in run_state_machine
          callback.kms_request(kms_ctx)
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/pymongo/encryption.py", line 114, in kms_request
          conn = _configured_socket((host, port), opts)
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/pymongo/pool.py", line 1015, in _configured_socket
          _raise_connection_failure(address, exc, "SSL handshake failed: ")
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/pymongo/pool.py", line 277, in _raise_connection_failure
          raise NetworkTimeout(msg)
      pymongo.errors.NetworkTimeout: SSL handshake failed: kms.us-east-1.amazonaws.com:443: _ssl.c:1074: The handshake operation timed out
      During handling of the above exception, another exception occurred:
      Traceback (most recent call last):
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/test/__init__.py", line 444, in wrap
          return f(*args, **kwargs)
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/test/__init__.py", line 444, in wrap
          return f(*args, **kwargs)
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/test/test_encryption.py", line 538, in run_scenario
          self.run_scenario(scenario_def, test)
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/test/utils_spec_runner.py", line 641, in run_scenario
          self.run_test_ops(sessions, collection, test)
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/test/utils_spec_runner.py", line 547, in run_test_ops
          self.run_operations(sessions, collection, test['operations'])
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/test/utils_spec_runner.py", line 458, in run_operations
          self._run_op(sessions, collection, op, in_with_transaction)
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/test/utils_spec_runner.py", line 448, in _run_op
          result = self.run_operation(sessions, collection, op.copy())
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/test/utils_spec_runner.py", line 393, in run_operation
          result = cmd(**dict(arguments))
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/pymongo/collection.py", line 1286, in delete_many
          collation=collation, hint=hint, session=session),
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/pymongo/collection.py", line 1199, in _delete_retryable
          _delete, session)
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/pymongo/mongo_client.py", line 1498, in _retryable_write
          return self._retry_with_session(retryable, func, s, None)
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/pymongo/mongo_client.py", line 1384, in _retry_with_session
          return self._retry_internal(retryable, func, session, bulk)
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/pymongo/mongo_client.py", line 1416, in _retry_internal
          return func(session, sock_info, retryable)
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/pymongo/collection.py", line 1195, in _delete
          retryable_write=retryable_write)
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/pymongo/collection.py", line 1181, in _delete
          retryable_write=retryable_write)
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/pymongo/pool.py", line 699, in command
          self._raise_connection_failure(error)
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/pymongo/pool.py", line 694, in command
          exhaust_allowed=exhaust_allowed)
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/pymongo/network.py", line 113, in command
          dbname, spec, check_keys, codec_options)
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/pymongo/encryption.py", line 279, in encrypt
          return encrypt_cmd
        File "/opt/python/3.7/lib/python3.7/contextlib.py", line 130, in __exit__
          self.gen.throw(type, value, traceback)
        File "/data/mci/5a78804e2e1edf69be01cb4bf23e9870/src/pymongo/encryption.py", line 79, in _wrap_encryption_errors
          raise EncryptionError(exc)
      pymongo.errors.EncryptionError: SSL handshake failed: kms.us-east-1.amazonaws.com:443: _ssl.c:1074: The handshake operation timed out
      

      Failed in a patch build here: https://evergreen.mongodb.com/task/mongo_python_driver_tests_python_version_requires_openssl_102_plus_test_encryption__platform~ubuntu_16.04_auth_ssl~noauth_nossl_python_version~3.7_encryption~encryption_test_latest_standalone_patch_337a08c43d832c6838f07a46d6fac8ebbdacb2b6_5f7f42402a60ed15728b90d1_20_10_08_16_45_53

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

              Created:
              Updated:
              Resolved: