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

automatic client side encryption - Unknown type name alias

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.9
    • Component/s: Encryption
    • None

      Hi,

      I am getting the following error when I am trying to test the automatic client-side encryption.  I don't find any documentation or reference to resolve this issue.

      Note: I am using local key encryption.

       

      2019-08-24T18:39:29.820-0700 I CONTROL [initandlisten] MongoCryptD starting : pid=27930 port=27020 socketFile=/tmp/mongocryptd.sock 64-bit host=mani-Lenovo-Z50-70
      2019-08-24T18:39:29.820-0700 I CONTROL [initandlisten] db version v4.2.0
      2019-08-24T18:39:29.820-0700 I CONTROL [initandlisten] git version: a4b751dcf51dd249c5865812b390cfd1c0129c30
      2019-08-24T18:39:29.820-0700 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
      2019-08-24T18:39:29.820-0700 I CONTROL [initandlisten] allocator: tcmalloc
      2019-08-24T18:39:29.820-0700 I CONTROL [initandlisten] modules: enterprise
      2019-08-24T18:39:29.820-0700 I CONTROL [initandlisten] build environment:
      2019-08-24T18:39:29.820-0700 I CONTROL [initandlisten] distmod: ubuntu1804
      2019-08-24T18:39:29.820-0700 I CONTROL [initandlisten] distarch: x86_64
      2019-08-24T18:39:29.820-0700 I CONTROL [initandlisten] target_arch: x86_64
      2019-08-24T18:39:29.820-0700 I CONTROL [initandlisten] options: { processManagement: { idleShutdownTimeoutSecs: 60 } }
      2019-08-24T18:39:29.820-0700 I CONTROL [initandlisten] Using lock file: /home/mani/MongoCSE/mongocryptd.pid
      2019-08-24T18:39:29.919-0700 I NETWORK [initandlisten] Listening on /tmp/mongocryptd.sock
      2019-08-24T18:39:29.919-0700 I NETWORK [initandlisten] Listening on 127.0.0.1
      2019-08-24T18:39:29.920-0700 I NETWORK [initandlisten] waiting for connections on port 27020
      2019-08-24T18:39:30.286-0700 I NETWORK [listener] connection accepted from 127.0.0.1:51932 #1 (1 connection now open)
      2019-08-24T18:39:30.288-0700 I NETWORK [listener] connection accepted from 127.0.0.1:51934 #2 (2 connections now open)
      Traceback (most recent call last):
      File "/usr/local/lib/python3.7/dist-packages/pymongo/encryption.py", line 77, in _wrap_encryption_errors
      yield
      File "/usr/local/lib/python3.7/dist-packages/pymongo/encryption.py", line 280, in encrypt
      encrypted_cmd = self._auto_encrypter.encrypt(database, encoded_cmd)
      File "/usr/local/lib/python3.7/dist-packages/pymongocrypt/auto_encrypter.py", line 44, in encrypt
      return run_state_machine(ctx, self.callback)
      File "/usr/local/lib/python3.7/dist-packages/pymongocrypt/state_machine.py", line 139, in run_state_machine
      result = callback.mark_command(ctx.database, mongocryptd_cmd)
      File "/usr/local/lib/python3.7/dist-packages/pymongo/encryption.py", line 173, in mark_command
      codec_options=DEFAULT_RAW_BSON_OPTIONS)
      File "/usr/local/lib/python3.7/dist-packages/pymongo/database.py", line 733, in command
      codec_options, session=session, **kwargs)
      File "/usr/local/lib/python3.7/dist-packages/pymongo/database.py", line 630, in _command
      client=self.__client)
      File "/usr/local/lib/python3.7/dist-packages/pymongo/pool.py", line 613, in command
      user_fields=user_fields)
      File "/usr/local/lib/python3.7/dist-packages/pymongo/network.py", line 167, in command
      parse_write_concern_error=parse_write_concern_error)
      File "/usr/local/lib/python3.7/dist-packages/pymongo/helpers.py", line 159, in _check_command_response
      raise OperationFailure(msg % errmsg, code, response)
      pymongo.errors.OperationFailure: Unknown type name alias: String

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
      File "ClientSideEncryption.py", line 52, in <module>
      post_id = collection.insert_one(user)
      File "/usr/local/lib/python3.7/dist-packages/pymongo/collection.py", line 698, in insert_one
      session=session),
      File "/usr/local/lib/python3.7/dist-packages/pymongo/collection.py", line 612, in _insert
      bypass_doc_val, session)
      File "/usr/local/lib/python3.7/dist-packages/pymongo/collection.py", line 600, in _insert_one
      acknowledged, _insert_command, session)
      File "/usr/local/lib/python3.7/dist-packages/pymongo/mongo_client.py", line 1492, in _retryable_write
      return self._retry_with_session(retryable, func, s, None)
      File "/usr/local/lib/python3.7/dist-packages/pymongo/mongo_client.py", line 1385, in _retry_with_session
      return func(session, sock_info, retryable)
      File "/usr/local/lib/python3.7/dist-packages/pymongo/collection.py", line 595, in _insert_command
      retryable_write=retryable_write)
      File "/usr/local/lib/python3.7/dist-packages/pymongo/pool.py", line 618, in command
      self._raise_connection_failure(error)
      File "/usr/local/lib/python3.7/dist-packages/pymongo/pool.py", line 613, in command
      user_fields=user_fields)
      File "/usr/local/lib/python3.7/dist-packages/pymongo/network.py", line 121, in command
      dbname, spec, check_keys, codec_options)
      File "/usr/local/lib/python3.7/dist-packages/pymongo/encryption.py", line 286, in encrypt
      return encrypt_cmd
      File "/usr/lib/python3.7/contextlib.py", line 130, in _exit_
      self.gen.throw(type, value, traceback)
      File "/usr/local/lib/python3.7/dist-packages/pymongo/encryption.py", line 83, in _wrap_encryption_errors
      raise EncryptionError(exc)
      pymongo.errors.EncryptionError: Unknown type name alias: String
      2019-08-24T18:39:30.815-0700 I NETWORK [conn2] end connection 127.0.0.1:51934 (1 connection now open)
      2019-08-24T18:39:30.815-0700 I NETWORK [conn1] end connection 127.0.0.1:51932 (0 connections now open)

       

        1. ClientSideEncryption.py
          1 kB
          Manivannan Ponnusamy
        2. schema.json
          0.5 kB
          Manivannan Ponnusamy

            Assignee:
            asya.kamsky@mongodb.com Asya Kamsky
            Reporter:
            pmanivannan89@gmail.com Manivannan Ponnusamy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: