We encountered with some technical problems which we believe is a bug in the latest mattermost docker version 5.7.1. After configuring the LDAP parameters we are getting this error:
error retrieving ldap groups — LDAP Result Code 201 “Filter Compile Error”: ldap: filter does not start with an ‘(’
The server logs says the following:
{“level”:“error”,“ts”:1599739178.383662,“caller”:“mlog/log.go:190”,“msg”:“Failed job”,“workername”:“EnterpriseLdapSync”,“error”:“LdapSession.getAllGroups: error retrieving ldap groups, LDAP Result Code 201 “Filter Compile Error”: ldap: filter does not start with an ‘(’”,“job_id”:“yeg1sbbe77rgzpcna67cpf8fhy”}
Our LDAP server is sending all the user details, it seems the client (mattermost) not able to parse the information. Here is what is being sent from the LDAP server to the mattermost client:
Bind request
Transmission Control Protocol, Src Port: 38798 (38798), Dst Port: ldap (389), Seq: 1, Ack: 1, Len: 94
Lightweight Directory Access Protocol
LDAPMessage bindRequest(1) “uid=radiusbind,cn=users,cn=accounts,dc=as15932,dc=net” simple
messageID: 1
protocolOp: bindRequest (0)
bindRequest
version: 3
name: uid=radiusbind,cn=users,cn=accounts,dc=as15932,dc=net
authentication: simple (0)
simple: 31556a4639756e414f614f4734485651305466386732454c…
Transmission Control Protocol, Src Port: ldap (389), Dst Port: 38798 (38798), Seq: 1, Ack: 95, Len: 14
Lightweight Directory Access Protocol
LDAPMessage bindResponse(1) success
messageID: 1
protocolOp: bindResponse (1)
bindResponse
resultCode: success (0)
matchedDN:
errorMessage:
[Response To: 1764]
[Time: 0.002684212 seconds]
Search for users
Lightweight Directory Access Protocol
LDAPMessage searchRequest(2) “dc=as15932,dc=net” wholeSubtree
messageID: 2
protocolOp: searchRequest (3)
searchRequest
baseObject: dc=as15932,dc=net
scope: wholeSubtree (2)
derefAliases: derefAlways (3)
sizeLimit: 0
timeLimit: 25
typesOnly: False
Filter: (uid=*)
filter: present (7)
present: uid
attributes: 5 items
AttributeDescription: uid
AttributeDescription: givenName
AttributeDescription: sn
AttributeDescription: mail
AttributeDescription: uid
User information
Lightweight Directory Access Protocol
LDAPMessage searchResEntry(2) “uid=t777693,cn=users,cn=compat,dc=as15932,dc=net” [1 result]
messageID: 2
protocolOp: searchResEntry (4)
searchResEntry
objectName: uid=t777693,cn=users,cn=compat,dc=as15932,dc=net
attributes: 1 item
PartialAttributeList item uid
type: uid
vals: 1 item
AttributeValue: t777693
[Response To: 1768]
[Time: 0.024322130 seconds]
Lightweight Directory Access Protocol
LDAPMessage searchResEntry(2) “uid=testosix,cn=users,cn=compat,dc=as15932,dc=net” [2 results]
messageID: 2
protocolOp: searchResEntry (4)
searchResEntry
objectName: uid=testosix,cn=users,cn=compat,dc=as15932,dc=net
attributes: 1 item
PartialAttributeList item uid
type: uid
vals: 1 item
AttributeValue: testosix
[Response To: 1768]
[Time: 0.024322130 seconds]
.... ....and it lists all our users using the same format