Exception while invoking method login MongoError

Description

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.

Solution

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

db.users.find({'services.liiibre.id':"xxx"},{_id:1})
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!

2 Likes

While trying to login using the Meteor packages accounts-facebook and accounts-google , I’m getting an OAuth handler exception. Packages accounts-twitter appears to work fine and logs in perfectly. I haven’t written any code, this is right out of the box using the accounts-ui package

This has nothing to do with the original question.

Please open a new thread with full information as per this: