Exception while invoking method login MongoError


When a user tries to login, they get:

Exception while invoking method login MongoError: E11000 duplicate key error collection: rocketchat.users index: services.liiibre.id_1 dup key: { services.liiibre.id: "xxx" }

The impact for the user was a infinite loop and couldn’t login.


The solution was to drop the services key of the 2 users that somehow got the same key:

db.users.update({_id:"yyy"}, {$unset: { services: 1} })
db.users.update({_id:"zzz"}, {$unset: { services: 1} })

It worked but be careful if you do this :upside_down_face: !

1 Like

Oooohhh - nice tip thanks Pierre!

But yes, if you are going to attempt ANY tinkering with your DB please make sure you take several backups first, AND make sure you can restore them too!