RocketChat / RocketChat/Rocket.Chat

LDAP - User not found - since 4.5.0 (aka better logging needed)

Open
#24,694 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description:

Since Upgrade to 4.5.0, I see those messages in logs while I was checking because some users said they can't login anymore (LDAP)

Steps to reproduce:

I don't really know. It just happened since upgrade to 4.5.0 that some users can't login anymore and I suspect the error message is related to the problem - but not necessarily. It's a guess.

Expected behavior:

mention the username in the log

Actual behavior:

Login page flashes a red warning at top right, that the user can not be found or the password may be wrong.

Server Setup Information:
rocketchat_app.1.1jvo3f3rpvge@rocketchat    | +-----------------------------------------------------+
rocketchat_app.1.1jvo3f3rpvge@rocketchat    | |                    SERVER RUNNING                   |
rocketchat_app.1.1jvo3f3rpvge@rocketchat    | +-----------------------------------------------------+
rocketchat_app.1.1jvo3f3rpvge@rocketchat    | |                                                     |
rocketchat_app.1.1jvo3f3rpvge@rocketchat    | |  Rocket.Chat Version: 4.5.0                         |
rocketchat_app.1.1jvo3f3rpvge@rocketchat    | |       NodeJS Version: 14.18.3 - x64                 |
rocketchat_app.1.1jvo3f3rpvge@rocketchat    | |      MongoDB Version: 5.0.6                         |
rocketchat_app.1.1jvo3f3rpvge@rocketchat    | |       MongoDB Engine: wiredTiger                    |
rocketchat_app.1.1jvo3f3rpvge@rocketchat    | |             Platform: linux                         |
rocketchat_app.1.1jvo3f3rpvge@rocketchat    | |         Process Port: 3000                          |
rocketchat_app.1.1jvo3f3rpvge@rocketchat    | |             Site URL: https://chat.xxxx.xxx  |
rocketchat_app.1.1jvo3f3rpvge@rocketchat    | |     ReplicaSet OpLog: Enabled                       |
rocketchat_app.1.1jvo3f3rpvge@rocketchat    | |          Commit Hash: 3901054684                    |
rocketchat_app.1.1jvo3f3rpvge@rocketchat    | |        Commit Branch: HEAD                          |
rocketchat_app.1.1jvo3f3rpvge@rocketchat    | |                                                     |
rocketchat_app.1.1jvo3f3rpvge@rocketchat    | +-----------------------------------------------------+
Client Setup Information
  • Desktop App or Browser Version: both
  • Operating System: any
Additional context

LDAP Server is Active Directory. In the Administration/LDAP page, using the buttons at the top - "test connection" and "Test LDAP search" are succesful, user can be found (green flash message)

Relevant logs:
rocketchat_app.1.1jvo3f3rpvge@rocketchat    | {"level":50,"time":"2022-03-03T15:29:13.266Z","pid":1,"hostname":"f9c9770d540f","name":"","name":"LDAP","err":{"type":"Error","message":"User not found","stack":"Error: User not found\n    at server/lib/ldap/Manager.ts:167:11\n    at /app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40"},"msg":"User not found"}

I started a LDAP background sync some hours ago which should be very much finished by now, but didn't solve.

After upgrading to 4.5.0 I had this index problem which prevented the server from starting, so I executed the statements from https://github.com/RocketChat/Rocket.Chat/issues/24347#issuecomment-1032161111 in the mongo primary.
Perhaps this has got something to do with it? I tried restarting rocketchat server hoping it will re-run migrations or create index, but at least it didn't tell

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 at server/lib/ldap/Manager.ts:167 and trace the LDAP login path that emits “User not found”; compare it with the successful Test LDAP search flow in Administration/LDAP. Confirm whether the log corresponds to the login failure, and consider the work complete when the affected account can be identified from the resulting log context.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.