RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.57k stars 10.58k forks source link

Error with LDAP sincronization #25051

Open Agarcia555 opened 2 years ago

Agarcia555 commented 2 years ago

Description:

Good afternoon last week I updated rocketchat from version 3.13.3 to 4.5.4 and although at first everything went well, but soon I discovered the bugs associated with these versions, to solve one of them today I updated again to 4.6.0 but I find that the synchronization with the LDAP does not work.

Steps to reproduce:

  1. go to settings -> LDAP -> click on: Test connection = Message in green all ok
  2. Test LDAP search = error in color red invalid attribute name
  3. Synchronize now = ask for admin pass and nothing happens

Expected behavior:

Get the new user from the LDAP

Actual behavior:

Nothing ### Server Setup Information: - Version of Rocket.Chat Server: 4.6.0 - Operating System: Centos - Deployment Method: Amazon Workspaces - Number of Running Instances: 1 - DB Replicaset Oplog: 1.31.0 - NodeJS Version: 14.0.0 - MongoDB Version: 4.0.20 ### Client Setup Information - Desktop App or Browser Version: Chorme Versión 99.0.4844.82 (Build oficial) (64 bits) - Operating System: Win 10 ### Additional context Before the update, the chat was updating correctly. the rest of the users who were already using it do not have any problem.

Relevant logs:

I20220404-15:22:42.572(2) Loaded the Apps Framework and loaded a total of 0 Apps! I20220404-15:22:43.238(2) +-------------------------------------------------------------+ I20220404-15:22:43.238(2) | SERVER RUNNING | I20220404-15:22:43.238(2) +-------------------------------------------------------------+ I20220404-15:22:43.238(2) | | I20220404-15:22:43.239(2) | Rocket.Chat Version: 4.6.0 | I20220404-15:22:43.239(2) | NodeJS Version: 14.0.0 - x64 | I20220404-15:22:43.239(2) | MongoDB Version: 4.0.20 | I20220404-15:22:43.239(2) | MongoDB Engine: mmapv1 | I20220404-15:22:43.239(2) | Platform: linux | I20220404-15:22:43.239(2) | Process Port: 3000 | I20220404-15:22:43.239(2) | Site URL: http:/(URL):3000/ | I20220404-15:22:43.239(2) | ReplicaSet OpLog: Enabled | I20220404-15:22:43.239(2) | Commit Hash: 843d7adf7d | I20220404-15:22:43.240(2) | Commit Branch: HEAD | I20220404-15:22:43.240(2) | | I20220404-15:22:43.240(2) +-------------------------------------------------------------+ I20220404-15:22:43.240(2) +----------------------------------------------------------------------+ I20220404-15:22:43.240(2) | DEPRECATION | I20220404-15:22:43.240(2) +----------------------------------------------------------------------+ I20220404-15:22:43.241(2) | | I20220404-15:22:43.241(2) | YOUR CURRENT MONGODB VERSION (4.0.20) IS DEPRECATED. | I20220404-15:22:43.241(2) | IT WILL NOT BE SUPPORTED ON ROCKET.CHAT VERSION 5.0.0 AND GREATER, | I20220404-15:22:43.241(2) | PLEASE UPGRADE MONGODB TO VERSION 4.2 OR GREATER | I20220404-15:22:43.241(2) | | I20220404-15:22:43.241(2) +----------------------------------------------------------------------+ {"level":50,"time":"2022-04-04T13:22:44.431Z","pid":3508,"hostname":"ip-(IP).eu-west-2.compute.internal","name":"LDAP","err":{"type":"Error","message":"invalid attribute name","stack":"Error: invalid attribute name
at parseExpr (/opt/Rocket.Chat/programs/server/npm/node_modules/ldap-filter/lib/index.js:147:11)
at parseFilter (/opt/Rocket.Chat/programs/server/npm/node_modules/ldap-filter/lib/index.js:228:14)
at parseFilter (/opt/Rocket.Chat/programs/server/npm/node_modules/ldap-filter/lib/index.js:204:13)
at Object.parse (/opt/Rocket.Chat/programs/server/npm/node_modules/ldap-filter/lib/index.js:252:18)
at Object.parseString (/opt/Rocket.Chat/programs/server/npm/node_modules/ldapjs/lib/filters/index.js:179:27)
at Client.search (/opt/Rocket.Chat/programs/server/npm/node_modules/ldapjs/lib/client/client.js:571:30)
at server/lib/ldap/Connection.ts:333:16
at new Promise ()
at server/lib/ldap/Connection.ts:332:10
at /opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40
=> awaited here:
at Function.Promise.await (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:56:12)
at server/lib/ldap/Manager.ts:163:15
at /opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40"},"msg":"invalid attribute name"}

pierre-lehnen-rc commented 2 years ago

My guess is that you're missing an User Search Field value in your ldap settings.

Agarcia555 commented 2 years ago

Could it be due to not having an SSL Reverse Proxy active? Although before the update it didn't exist either and the synchronization was working correctly

yulais4 commented 2 years ago

I have the same issue after upgrade.

My setup: CPU: Common KVM Kernel: 4.15.0-166-generic OS: Ubuntu 18.04.6 LTS x86_64 Snap version: 2.57.1 Rocket-server version: 4.8.3 rev: 1523 tracking: 4.x/stable

deminart commented 1 year ago

Does anyone have a solution at the moment? Tried all options, error: InvalidDistinguishedNameError

+----------------------------------------------+ SERVER RUNNING +----------------------------------------------+
Rocket.Chat Version: 6.3.2
NodeJS Version: 14.21.2 - x64
MongoDB Version: 5.0.15
MongoDB Engine: wiredTiger
Platform: linux
Process Port: 3000
Site URL: https://chat.mycompany.com
ReplicaSet OpLog: Enabled
Commit Hash: 3fe2e8f3ba
Commit Branch: HEAD

+----------------------------------------------+