RocketChat / RocketChat/Rocket.Chat

Report conflicting email address while doing LDAP sync

Open
#22,601 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area: authentication
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

When trying to import users from LDAP we from time to time see errors like that:

Jul 07 09:33:15 rocketchatserver rocketchat[704]: server.js:204 LDAPSync ➔ error Error creating user errorClass [Error]: Email already exists. [403]
Jul 07 09:33:15 rocketchatserver rocketchat[704]:     at handleError (packages/accounts-password/password_server.js:110:17)
Jul 07 09:33:15 rocketchatserver rocketchat[704]:     at checkForCaseInsensitiveDuplicates (packages/accounts-password/password_server.js:257:7)
Jul 07 09:33:15 rocketchatserver rocketchat[704]:     at createUser (packages/accounts-password/password_server.js:1130:3)
Jul 07 09:33:15 rocketchatserver rocketchat[704]:     at AccountsServer.Accounts.createUser (packages/accounts-password/password_server.js:1218:10)
Jul 07 09:33:15 rocketchatserver rocketchat[704]:     at addLdapUser (app/ldap/server/sync.js:477:29)
Jul 07 09:33:15 rocketchatserver rocketchat[704]:     at app/ldap/server/sync.js:543:5
Jul 07 09:33:15 rocketchatserver rocketchat[704]:     at Array.forEach (<anonymous>)
Jul 07 09:33:15 rocketchatserver rocketchat[704]:     at app/ldap/server/sync.js:510:13
Jul 07 09:33:15 rocketchatserver rocketchat[704]:     at runWithEnvironment (packages/meteor.js:1286:24) {
Jul 07 09:33:15 rocketchatserver rocketchat[704]:   isClientSafe: true,
Jul 07 09:33:15 rocketchatserver rocketchat[704]:   error: 403,
Jul 07 09:33:15 rocketchatserver rocketchat[704]:   reason: 'Email already exists.',
Jul 07 09:33:15 rocketchatserver rocketchat[704]:   details: undefined,
Jul 07 09:33:15 rocketchatserver rocketchat[704]:   errorType: 'Meteor.Error'
Jul 07 09:33:15 rocketchatserver rocketchat[704]: }
Steps to reproduce:
  1. Have an email used more than one in LDAP
  2. Performa a LDAP-sync
Expected behavior:

At least printing out in error log which user is conflicting (or which email)

Actual behavior:

Sync silently not finishing

Server Setup Information:
  • Version of Rocket.Chat Server: 3.14.4
Client Setup Information
  • Desktop App or Browser Version:
  • Operating System:
Additional context
Relevant logs:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in app/ldap/server/sync.js around addLdapUser at line 477, then follow the LDAP sync flow around lines 510 and 543. Reproduce the duplicate-email LDAP sync and verify that the error log identifies the conflicting user or email and that the sync reports the failure instead of ending silently.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
authentication, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.