Parse Server Upgrade to v4.2: Unable to ensure uniqueness for user email addresses

I have recently upgraded parse-server to v4.2. I have also updated Mongo to v4.2 (It’s a Replica Set configuration). Now when parse-server is raised, the following error appears “Unable to ensure uniqueness for user email addresses: Tried to ensure field uniqueness for a class that already has duplicates.”

The detailed error is this:

{
"message": "Unable to ensure uniqueness for user email addresses: Tried to ensure field uniqueness for a class that already has duplicates.",
"code": 137,
"level": "warn",
"stack": "Error: Tried to ensure field uniqueness for a class that already has duplicates.\n    at _adaptiveCollection.then.catch.error (/parse/node_modules/parse-server/lib/Adapters/Storage/Mongo/MongoStorageAdapter.js:569:15)\n    at <anonymous>\n    at process._tickDomainCallback (internal/process/next_tick.js:229:7)"
}

The error is caused by the _User class that has the username and email fields with the same data. Any ideas on how to fix the problem or make the parse-server not do this check.

Hi, this post was flagged as being typed ‘suspiciously fast’, I’ve approved it but if you’ve posted this else where it would be helpful if you could let us know.

Please avoid cross-posting, as mostly the same people are active on either site. I have answered on your SO post where you posted it first.

Thanks @Manuel! I’m going to unlist this topic.

1 Like