TransWikia.com

duplicate key error index MongoDB

Database Administrators Asked by Simonell on December 16, 2020

I have rocket.chat server connected to LDAP.
When one of users try logging to their account he get logged to someone other account, it’s probably because indexes. My logs look like this:

[34mI20161126-12:07:28.992(1) rocketchat_ldap rocketchat_ldap.js:341 [31mLDAP ➔ Search.error Search by id 31353036 returned 2 records
[34mI20161126-12:07:28.999(1) rocketchat_ldap rocketchat_ldap.js:780

[31mLDAPSync ➔ error { [MongoError: E11000 duplicate key error index:
rocketchat.users.$emails.address_1 dup key: { : “[email protected]” }]
name: ‘MongoError’, message: ‘E11000 duplicate key error index:
rocketchat.users.$emails.address_1 dup key: { : “[email protected]” }’,
driver: true, index: 0, code: 11000, errmsg: ‘E11000 duplicate
key error index: rocketchat.users.$emails.address_1 dup key: { :
[email protected]” }’ }

Can I rebuild that indexes or something else to resolve this problem?

One Answer

I am not familiar with Rocket.Chat.

Will dare to suggest to check that MongoDB collection's indexes with db.collectionName.getIndexes() and see if there is an index with the email address field as unique index. If so, then, drop it with db.collectionName.dropIndex("indexName").

Answered by moalf on December 16, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP