Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-102101

TypeMismatch error on creating encrypted field for collection contains incorrect command name

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 8.2.0-rc0
    • Component/s: None
    • None
    • Catalog and Routing
    • ALL

      The error message returned by an incorrectly-typed encrypted field passed to collection creation contains the incorrect command name.

      This Python code:

      self.client_encryption.create_encrypted_collection(
          database=self.db,
          name="testing1",
          encrypted_fields={
              "fields": [{"path": "ssn", "bsonType": "string", "keyId": False}]
          },
          kms_provider="local",
      )
      

      should produce this error:

      {'ok': 0.0, 'errmsg': "BSON field 'create.encryptedFields.fields.keyId' is the wrong type 'bool', expected type 'binData'", 'code': 14, 'codeName': 'TypeMismatch', ...}
      

      but produces this error instead:

      {'ok': 0.0, 'errmsg': "BSON field 'checkAuthForCreateCollection.encryptedFields.fields.keyId' is the wrong type 'bool', expected type 'binData'", 'code': 14, 'codeName': 'TypeMismatch', ...}
      

      The expected `create` command name is replaced by `checkAuthForCreateCollection`.

      Possibly caused by SERVER-100936?

            Assignee:
            Unassigned Unassigned
            Reporter:
            noah.stapp@mongodb.com Noah Stapp
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: