"ONE_OF_MISSING" Error while Performing Bulk Import

Problem statement

Receiving the below error while trying to perform bulk import with custom_password_hash:

"errors": [ {
     "code": "ONE_OF_MISSING",
     "message": "",
     "path": "custom_password_hash"
} ]

Solution

This error usually occurs if there’s a mismatch between the provided hash value and the specified encoding.

As documented here, when the algorithm is set to md4 , md5 , sha1 , sha256 , or sha512 :

hash.encoding must be either hex or base64

Specifying the correct encoding, along with its respective value, should resolve the issue.

Example:

[
  {
    "email": "testUser@test.com",
    "custom_password_hash": {
      "algorithm": "sha1",
      "hash": {
        "value": "{sha1_base64_encoded_password_hash_value}",
        "encoding": "base64"
      },
      "salt": {
        "value": "{base64_encoded_salt_value}",
        "encoding": "base64"
      }
    }
  }
]