Description
I receive this error when take a trial on LDAP sync function
Error: server.js:204 LDAPSync ➔ error Error creating user BulkWriteError: E11000 duplicate key error collection: meteor.rocketchat_subscription index: id dup key: { _id: “aNLpM9qHndnqANgNx” }
Step to preproduce:
- Turn on LDAP with setting
#General
Enable = true
Login Fallback = true
Find user after login = true
Host = example.local
Port = 8075
Base DN = dc=example,dc=org
#Authentication
User DN = cn=admin,dc=example,dc=org
Password = 12345
#Sync/Import
Username Field = uid
User Data Field Map = {“giveName”: “name”, “mail”: “email”}
Sync User Avatar = true
#User Search
Search Field = uid
- Save changes
- Execute Synchronization Now
Error discover
I find out errors happen at this file: addUserToDefaultChannels.js
- Function: createWithRoomAndUser (line this.insert(subscription))
- Function: createUserJoinWithRoomIdAndUser
I have log the subscriptions and message data to the console and see that the _id is not input.
However, the _id is duplicated in the insert method by mongodb.
I sync 4 users with username, password, email, name, …
Server Setup Information
- Version of Rocket.Chat Server: 3.7.0-develop
- Operating System: Linux mint
- Deployment Method: Mannual install
- Number of Running Instances: 1
- DB Replicaset Oplog: default
- NodeJS Version: 12.18.3
- MongoDB Version: 4.2.8
- Proxy: no
- Firewalls involved:no
I also found in bug in the version of Rocket Chat Server: 3.4.2
with the Server Setup information is default by Rocket.Chat
Any additional Information
Error log: