Repository navigation
Closed
Description
Description:
I've enabled LDAP_Sync_User_Data_Groups and after that failed every login try from every type of device (old sessions persists and groups from LDAP are synchronized) or app with NoSuchObjectError. It's critical issue in #14278 for us. IDK what's wrong. When I disable LDAP_Sync_User_Data_Groups everything is OK (even with synchronized groups from LDAP).
Search filter:
(&(cn=#{groupName})(uniqueMember=uid=#{username},ou=users,dc=example,dc=org))
Expected behavior:
Working LDAP_Sync_User_Data_Groups option
Actual behavior:
Not working LDAP_Sync_User_Data_Groups = true
Server Setup Information:
- Version of Rocket.Chat Server: 2.1.1 (not working even with 2.1.0)
- Operating System: Debian 9/10
- Deployment Method: tar
- Number of Running Instances: 3
- DB Replicaset Oplog: Yes
- NodeJS Version:
v8.15.1 - MongoDB Version:
3.6.13
Relevant logs:
server.js:212 LDAP ➔ Search.error { NoSuchObjectError: No Such Object
at messageCallback (/opt/Rocket.Chat/programs/server/npm/node_modules/ldapjs/lib/client/client.js:1419:45)
at Parser.onMessage (/opt/Rocket.Chat/programs/server/npm/node_modules/ldapjs/lib/client/client.js:1089:14)
at emitOne (events.js:116:13)
at Parser.emit (events.js:211:7)
at Parser.write (/opt/Rocket.Chat/programs/server/npm/node_modules/ldapjs/lib/messages/parser.js:111:8)
at Socket.onData (/opt/Rocket.Chat/programs/server/npm/node_modules/ldapjs/lib/client/client.js:1076:22)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:601:20) lde_message: 'No Such Object', lde_dn: null }
Exception while invoking method 'login' { NoSuchObjectError: No Such Object
at messageCallback (/opt/Rocket.Chat/programs/server/npm/node_modules/ldapjs/lib/client/client.js:1419:45)
at Parser.onMessage (/opt/Rocket.Chat/programs/server/npm/node_modules/ldapjs/lib/client/client.js:1089:14)
at emitOne (events.js:116:13)
at Parser.emit (events.js:211:7)
at Parser.write (/opt/Rocket.Chat/programs/server/npm/node_modules/ldapjs/lib/messages/parser.js:111:8)
at Socket.onData (/opt/Rocket.Chat/programs/server/npm/node_modules/ldapjs/lib/client/client.js:1076:22)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:601:20) lde_message: 'No Such Object', lde_dn: null }
Metadata
Metadata
Assignees
Labels
No labels
Activity
wreiske commentedon Oct 24, 2019
I think this is related to OpenLdap and not RC.
From: https://www.openldap.org/faq/data/cache/157.html
Also: https://www.openldap.org/faq/data/cache/343.html
Are you using OpenLDAP or AD?
Have you looked at #14278 (comment) or #14278 (comment)
dusatvoj commentedon Oct 24, 2019
LDAP Search not working for me:
Our "base" object looks like this:
... so I've found an error but I don't know how to fix it.
Thank you @wreiske for help.
EDIT:
That's weird. I tried RC LDAP account with same search and there's no
NoSuchObbjectError:dusatvoj commentedon Nov 3, 2019
@wreiske Any news? I'm not sure what's wrong and I'm stuck on it 😕
dusatvoj commentedon Nov 29, 2019
👎 for a needed support @wreiske
wreiske commentedon Nov 29, 2019
Sorry, I'm not a Rocket.Chat developer, nor is there any expectation of community members to provide timely support. You can try contacting support@rocket.chat or poke around on open.rocket.chat.
dusatvoj commentedon Nov 29, 2019
@wreiske Thank you. I will contact them.
dusatvoj commentedon Dec 10, 2019
@wreiske you wrote this feature. Is there a possibility to relationship with not existing
memberOf overlayin LDAP?dusatvoj commentedon Dec 24, 2019
I've tried apply memberOf overlay, but it didn't help. It's crashing here https://github.com/wreiske/Rocket.Chat/blob/23b043c4947c050ef78bff0323fa0fcfe449c6de/app/ldap/server/sync.js#L34
There's a debug log
... I want to repair it but I'm not an JS developer :/ ... Any help wanted
axkng commentedon Jan 7, 2020
Hi @wreiske ,
this is not necessarily a problem with OpenLDAP.
I have hit this issue with ActiveDirectory as well.
All users that were synced prior to enabling LDAP role or channel mappings can login without problems.
New users can not login. If I disable the mapping, the new users can login.
Merge existing users is active, the group filter looks like this:
(&(sAMAccountName=#{username})(memberOf=#{groupName}))
The LDAP-tree is a bit more structured and the solutions from your PR did not work for me.
My filter worked flawless until I had to add new users.
Any Ideas?
dusatvoj commentedon Jan 7, 2020
I think there are
try-catches missing or something like that becauseNoSuchObject Errorcould meanisUserInLDAPGroup = false. Isn't it true?matejak commentedon Jul 3, 2020
I am getting exactly the same error, and I believe that I understand what caused it for me, and I think that it is your case as well.
Based on logs from my LDAP server, it goes on like this:
LDAPHandler ➔ info Logging userin the log)I see two possible bugs here:
battosai30 commentedon Oct 2, 2020
I confirm this diagnostic as I had the same issue, and when I changed OpenLDAP ACL in order to allow user to read groups and members I successfully got a sync :)
+1 on matejak suggestions
dusatvoj commentedon Oct 12, 2020
@matejak / @battosai30 Can you send me your ACLs? I have periodic sync without issue but I still cannot login :/
battosai30 commentedon Oct 15, 2020
Of course !
I'm not bad about OpenLDAP but clearly not an expert of its ACL so maybe it's not a state of the art config, but as I tested it it seems to do the job (safe and not allowing too much ... ;) )
battosai30 commentedon Nov 19, 2020
I'm sorry I figured out that I gave you a completely wrong config ....
Here the right one to use with ldapmodify :