ma1uta / ma1sd

Federated Matrix Identity Server (formerly fork of kamax/mxisd)
GNU Affero General Public License v3.0
167 stars 55 forks source link

LDAP: ERR_04058 Cannot have a null initial, any and final substring #53

Open guyguy333 opened 4 years ago

guyguy333 commented 4 years ago

Hello,

I'm using ma1sd for auth/directory/identity. When I want to invite someone on a Matrix room, search works fine but I get many errors in log. I guess error happens when search is an empty string.

Thanks

[XNIO-1 task-8] INFO io.kamax.mxisd.directory.DirectoryManager - Original request URL: http://matrix.example.com/_matrix/client/r0/user_directory/search
[XNIO-1 task-8] INFO io.kamax.mxisd.directory.DirectoryManager - Querying HS at http://synapse:8008/_matrix/client/r0/user_directory/search
[XNIO-1 task-8] INFO io.kamax.mxisd.directory.DirectoryManager - Found 0 match(es) in HS for ''
[XNIO-1 task-8] INFO io.kamax.mxisd.directory.DirectoryManager - Using Directory provider LdapDirectoryProvider
[XNIO-1 task-8] INFO io.kamax.mxisd.backend.ldap.LdapDirectoryProvider - Performing LDAP directory search on display name using ''
[XNIO-1 task-8] WARN org.apache.directory.ldap.client.api.LdapNetworkConnection - org.apache.directory.api.ldap.codec.api.MessageEncoderException: ERR_04058 Cannot have a null initial, any and final substring
org.apache.mina.filter.codec.ProtocolEncoderException: org.apache.directory.api.ldap.codec.api.MessageEncoderException: ERR_04058 Cannot have a null initial, any and final substring
    at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:360)
    at org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:744)
    at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1500(DefaultIoFilterChain.java:48)
    at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.filterWrite(DefaultIoFilterChain.java:1132)
    at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.filterWrite(DefaultIoFilterChain.java:1020)
    at org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:744)
    at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireFilterWrite(DefaultIoFilterChain.java:737)
    at org.apache.mina.core.session.AbstractIoSession.write(AbstractIoSession.java:570)
    at org.apache.mina.core.session.AbstractIoSession.write(AbstractIoSession.java:515)
    at org.apache.directory.ldap.client.api.LdapNetworkConnection.writeRequest(LdapNetworkConnection.java:4277)
    at org.apache.directory.ldap.client.api.LdapNetworkConnection.searchAsync(LdapNetworkConnection.java:1840)
    at org.apache.directory.ldap.client.api.LdapNetworkConnection.search(LdapNetworkConnection.java:1867)
    at org.apache.directory.ldap.client.api.LdapNetworkConnection.search(LdapNetworkConnection.java:1752)
    at org.apache.directory.ldap.client.api.LdapNetworkConnection.search(LdapNetworkConnection.java:1763)
    at io.kamax.mxisd.backend.ldap.LdapDirectoryProvider.search(LdapDirectoryProvider.java:71)
    at io.kamax.mxisd.backend.ldap.LdapDirectoryProvider.searchByDisplayName(LdapDirectoryProvider.java:104)
    at io.kamax.mxisd.directory.DirectoryManager.search(DirectoryManager.java:116)
    at io.kamax.mxisd.http.undertow.handler.directory.v1.UserDirectorySearchHandler.handleRequest(UserDirectorySearchHandler.java:47)
    at io.kamax.mxisd.http.undertow.handler.SaneHandler.handleRequest(SaneHandler.java:71)
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:376)
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.directory.api.ldap.codec.api.MessageEncoderException: ERR_04058 Cannot have a null initial, any and final substring
    at org.apache.directory.api.ldap.codec.api.LdapEncoder.encodeMessage(LdapEncoder.java:214)
    at org.apache.directory.api.ldap.codec.protocol.mina.LdapProtocolEncoder.encode(LdapProtocolEncoder.java:82)
    at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:329)
    ... 23 more
Caused by: org.apache.directory.api.asn1.EncoderException: ERR_04058 Cannot have a null initial, any and final substring
    at org.apache.directory.api.ldap.codec.search.SubstringFilter.encode(SubstringFilter.java:314)
    at org.apache.directory.api.ldap.codec.search.ConnectorFilter.encode(ConnectorFilter.java:143)
    at org.apache.directory.api.ldap.codec.search.OrFilter.encode(OrFilter.java:125)
    at org.apache.directory.api.ldap.codec.decorators.SearchRequestDecorator.encode(SearchRequestDecorator.java:1026)
    at org.apache.directory.api.ldap.codec.api.LdapEncoder.encodeMessage(LdapEncoder.java:182)
    ... 25 more
[XNIO-1 task-8] ERROR io.kamax.mxisd.http.undertow.handler.SaneHandler - Transaction #1593774686031 - org.apache.directory.api.ldap.codec.api.MessageEncoderException: ERR_04058 Cannot have a null initial, any and final substring
[XNIO-1 task-8] INFO io.kamax.mxisd.http.undertow.handler.BasicHttpHandler - Request POST http://matrix.example.com/_matrix/client/r0/user_directory/search - Error M_UNKNOWN: An internal server error occurred. Contact your administrator with reference Transaction #1593774686031