RocketChat / Rocket.Chat

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

LDAP importer crash when group map is too big #19424

Closed bellegarde-c closed 3 years ago

bellegarde-c commented 3 years ago

Description:

When running a sync with a real big group map (more than 500 lines), the LDAP sync fails.

With a smaller map, all is working as expected.

Steps to reproduce:

Not sure if it's an error with Samba4 closing the connection because of the flood. The strange part is the encryption error message (see logs below).

BTW, the group mapping code looks not optimal. It should get groups content on start and then compare this for every available user.

Actually, looks like it is doing an LDAP request per user and per group.

But I may be wrong as I guess this based on the logs (and based on LDAP groups filter).

Server Setup Information:

LDAP:

Relevant logs:

Oct 31 17:11:15 srv-rocket rocketchat[106]: server.js:204 LDAPSync ➔ error LDAPError [StrongAuthRequiredError]: BindSimple: Transport encryption required.
Oct 31 17:11:15 srv-rocket rocketchat[106]:     at messageCallback (/opt/Rocket.Chat/programs/server/npm/node_modules/ldapjs/lib/client/client.js:1419:45)
Oct 31 17:11:15 srv-rocket rocketchat[106]:     at Parser.onMessage (/opt/Rocket.Chat/programs/server/npm/node_modules/ldapjs/lib/client/client.js:1089:14)
Oct 31 17:11:15 srv-rocket rocketchat[106]:     at Parser.emit (events.js:210:5)
Oct 31 17:11:15 srv-rocket rocketchat[106]:     at Parser.EventEmitter.emit (domain.js:475:20)
Oct 31 17:11:15 srv-rocket rocketchat[106]:     at Parser.write (/opt/Rocket.Chat/programs/server/npm/node_modules/ldapjs/lib/messages/parser.js:111:8)
Oct 31 17:11:15 srv-rocket rocketchat[106]:     at Socket.onData (/opt/Rocket.Chat/programs/server/npm/node_modules/ldapjs/lib/client/client.js:1076:22)
Oct 31 17:11:15 srv-rocket rocketchat[106]:     at Socket.emit (events.js:210:5)
Oct 31 17:11:15 srv-rocket rocketchat[106]:     at Socket.EventEmitter.emit (domain.js:475:20)
Oct 31 17:11:15 srv-rocket rocketchat[106]:     at addChunk (_stream_readable.js:309:12)
Oct 31 17:11:15 srv-rocket rocketchat[106]:     at readableAddChunk (_stream_readable.js:290:11)
Oct 31 17:11:15 srv-rocket rocketchat[106]:     at Socket.Readable.push (_stream_readable.js:224:10)
Oct 31 17:11:15 srv-rocket rocketchat[106]:     at TCP.onStreamRead (internal/stream_base_commons.js:182:23) {
Oct 31 17:11:15 srv-rocket rocketchat[106]:   lde_message: 'BindSimple: Transport encryption required.',
Oct 31 17:11:15 srv-rocket rocketchat[106]:   lde_dn: null
Oct 31 17:11:15 srv-rocket rocketchat[106]: }
close-issue-app[bot] commented 3 years ago

This issue was closed because it does not use our bug report issue template.

Please make sure to use it and fill it as much as you can so we can provide better and faster support.

The following sections must not be removed, or else the BOT will close it immediately again: