Duplicate User Error When Performing a Bulk Import with Upsert False
When performing a bulk import, duplicate user errors are seen, but the expected number of new users are added.
The error seen is:
{
"code": "DUPLICATED_USER",
"message": "The user already exist and upsert parameter is false"
}
- Bulk User Import
- Management API
This can be caused by a race condition if more than one job is triggered within a short period of time with the same user payload (or subset thereof).
Ensure when scripting bulk import job creation that only one call is made to the POST /api/v2/jobs/users-imports endpoint for a given payload - two jobs running in quick succession with the same payload can lead to a race condition as to which job creates the user first.
If multiple jobs are being scheduled, check that the user payloads do not contain duplicated user entries as well. If updating existing users is desired, the upsert parameter needs to be set to true.