Skip to content

matrixsynapse: LDAP auth no longer works

FreedomBox testing 0.48.0
Matrix Synapse 0.34.1.1-4

I installed Matrix Synapse on an AWS EC2 cloud instance with a valid domain name and LE cert. I tried logging in on Riot as the FreedomBox user admin. It shows the error "Error: Problem communicating with the given homeserver. (M_UNKNOWN)" in the Riot web UI.

image

The following is the error log seen using journalctl -u matrix-synapse

Feb 05 07:36:00 ip-172-31-35-79 synapse[6010]: synapse.handlers.auth: [] Attempted to login as @admin:joseph.freedombox.rocks but they do not exist
Feb 05 07:36:00 ip-172-31-35-79 synapse[6010]: synapse.http.server: [] Failed handle request via <function JsonResource._async_render at 0x7fa26f7e61e0>: <SynapseRequest at 0x7fa26dc821d0 method='POST' uri='/_matrix/client/r0/login' clientproto='HTTP/1.1' site=8008>: Traceback (most recent call last):
                                                 File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 654, in _runCallbacks
                                                   current.result = callback(current.result, *args, **kw)
                                                 File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1475, in gotResult
                                                   _inlineCallbacks(r, g, status)
                                                 File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
                                                   result = result.throwExceptionIntoGenerator(g)
                                                 File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
                                                   return g.throw(self.type, self.value, self.tb)
                                               --- <exception caught here> ---
                                                 File "/usr/lib/python3/dist-packages/synapse/http/server.py", line 81, in wrapped_request_handler
                                                   yield h(self, request)
                                                 File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
                                                   result = result.throwExceptionIntoGenerator(g)
                                                 File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
                                                   return g.throw(self.type, self.value, self.tb)
                                                 File "/usr/lib/python3/dist-packages/synapse/http/server.py", line 316, in _async_render
                                                   callback_return = yield callback(request, **kwargs)
                                                 File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
                                                   result = result.throwExceptionIntoGenerator(g)
                                                 File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
                                                   return g.throw(self.type, self.value, self.tb)
                                                 File "/usr/lib/python3/dist-packages/synapse/rest/client/v1/login.py", line 140, in on_POST
                                                   result = yield self._do_other_login(login_submission)
                                                 File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
                                                   result = result.throwExceptionIntoGenerator(g)
                                                 File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
                                                   return g.throw(self.type, self.value, self.tb)
                                                 File "/usr/lib/python3/dist-packages/synapse/rest/client/v1/login.py", line 220, in _do_other_login
                                                   login_submission,
                                                 File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
                                                   result = result.throwExceptionIntoGenerator(g)
                                                 File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
                                                   return g.throw(self.type, self.value, self.tb)
                                                 File "/usr/lib/python3/dist-packages/synapse/handlers/auth.py", line 664, in validate_login
                                                   qualified_user_id, password,
                                                 File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
                                                   result = result.throwExceptionIntoGenerator(g)
                                                 File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
                                                   return g.throw(self.type, self.value, self.tb)
                                                 File "/usr/lib/python3/dist-packages/ldap_auth_provider.py", line 172, in check_password
                                                   self.ldap_attributes['mail']
                                                 File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 250, in inContext
                                                   result = inContext.theWork()
                                                 File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 266, in <lambda>
                                                   inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
                                                 File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 122, in callWithContext
                                                   return self.currentContext().callWithContext(ctx, func, *args, **kw)
                                                 File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 85, in callWithContext
                                                   return func(*args,**kw)
                                                 File "/usr/lib/python3/dist-packages/ldap3/core/connection.py", line 772, in search
                                                   check_names=self.check_names)
                                                 File "/usr/lib/python3/dist-packages/ldap3/operation/search.py", line 375, in search_operation
                                                   request['attributes'] = build_attribute_selection(attributes, schema)
                                                 File "/usr/lib/python3/dist-packages/ldap3/operation/search.py", line 311, in build_attribute_selection
                                                   attribute_selection[index] = Selector(attribute)
                                                 File "/usr/lib/python3/dist-packages/pyasn1/type/univ.py", line 819, in __init__
                                                   base.AbstractSimpleAsn1Item.__init__(self, value, **kwargs)
                                                 File "/usr/lib/python3/dist-packages/pyasn1/type/base.py", line 240, in __init__
                                                   value = self.prettyIn(value)
                                                 File "/usr/lib/python3/dist-packages/pyasn1/type/univ.py", line 878, in prettyIn
                                                   return bytes(value)
                                               builtins.TypeError: cannot convert 'NoneType' object to bytes
Edited by Joseph Nuthalapati