Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Internal server error on login with ldap_auth_provider #2678

Closed
jkolo opened this issue Nov 15, 2017 · 12 comments
Closed

Internal server error on login with ldap_auth_provider #2678

jkolo opened this issue Nov 15, 2017 · 12 comments

Comments

@jkolo
Copy link
Contributor

jkolo commented Nov 15, 2017

Description

Cannot login or perform action require auth, if synapse using ldap_auth_provider.

Steps to reproduce

  • configure synapse to use ldap_auth_provider
2017-11-15 21:31:15,769 - synapse.http.server - 139 - ERROR - DELETE-41647- Failed handle request synapse.http.server._async_render on <synapse.rest.ClientRestResource object at 0x7f1e1c2e8410>
: <XForwardedForRequest at 0x7f1de622cd40 method=DELETE uri=/_matrix/client/unstable/devices/PJPXHLTJDM?access_token=<redacted> clientproto=HTTP/1.0 site=8008>
Traceback (most recent call last):
  File "/srv/synapse/lib/python2.7/site-packages/synapse/http/server.py", line 116, in wrapped_request_handler
    yield request_handler(self, request, request_metrics)
  File "/srv/synapse/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/srv/synapse/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/srv/synapse/lib/python2.7/site-packages/synapse/http/server.py", line 257, in _async_render
    callback_return = yield callback(request, **kwargs)
  File "/srv/synapse/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/srv/synapse/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/srv/synapse/lib/python2.7/site-packages/synapse/rest/client/v2_alpha/devices.py", line 135, in on_DELETE
    ], body, self.hs.get_ip_from_request(request))
  File "/srv/synapse/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/srv/synapse/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/srv/synapse/lib/python2.7/site-packages/synapse/handlers/auth.py", line 163, in check_auth
    result = yield self.checkers[login_type](authdict, clientip)
  File "/srv/synapse/lib/python2.7/site-packages/twisted/internet/defer.py", line 1386, in _inlineCallbacks
    result = g.send(result)
  File "/srv/synapse/lib/python2.7/site-packages/synapse/handlers/auth.py", line 280, in _check_password_auth
    "password": password,
ValueError: too many values to unpack

Version information

  • Homeserver: matrix.kolosowscy.pl

If not matrix.org:

  • Version: 0.25.0
  • Install method: pip
  • Platform: gentoo, virtualenv
jkolo added a commit to jkolo/synapse that referenced this issue Nov 15, 2017
@agentpurple
Copy link

I can confirm the issue

@Josue-T
Copy link

Josue-T commented Nov 16, 2017

Me too

@richvdh
Copy link
Member

richvdh commented Nov 16, 2017

thanks. This was introduced in 4c8f94a.

@richvdh richvdh closed this as completed Nov 16, 2017
richvdh pushed a commit that referenced this issue Nov 16, 2017
richvdh pushed a commit that referenced this issue Nov 17, 2017
@rexometer
Copy link

rexometer commented Nov 18, 2017

Hi, thanks for the quick fix.
When will version 0.25.1 be available in the Debian repo http://matrix.org/packages/debian/ ?
Is it save to downgrade in the meantime?

Update: Is downgrading even possible? sudo apt-cache policy matrix-synapse lists only the latest package!?

Update2: eded708 seems to be an easy fix. I added the fix to /usr/lib/python2.7/dist-packages/synapse/handlers/auth.py and deleted the auth.pyc and recompiled it, but still no luck. What else has to be changed?

Update3: Ok I figured it out, this fix 6f05de0 is also necessary. Now it's up and running again.

@rexometer
Copy link

Hi, I now updated to 0.25.1 but this fix is missing: 6f05de0

Without this I still get:

Dez 28 19:00:42 rexergie python[31746]: File "/usr/lib/python2.7/dist-packages/synapse/config/_base.py", line 338, in load_or_generate_config
Dez 28 19:00:42 rexergie python[31746]: generate_keys=generate_keys,
Dez 28 19:00:42 rexergie python[31746]: File "/usr/lib/python2.7/dist-packages/synapse/config/_base.py", line 382, in read_config_files
Dez 28 19:00:42 rexergie python[31746]: self.invoke_all("read_config", config)
Dez 28 19:00:42 rexergie python[31746]: File "/usr/lib/python2.7/dist-packages/synapse/config/_base.py", line 162, in invoke_all
Dez 28 19:00:42 rexergie python[31746]: results.append(getattr(cls, name)(self, *args, **kargs))
Dez 28 19:00:42 rexergie python[31746]: File "/usr/lib/python2.7/dist-packages/synapse/config/password_auth_providers.py", line 34, in read_config
Dez 28 19:00:42 rexergie python[31746]: 'config': ldap_config,
Dez 28 19:00:42 rexergie python[31746]: TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'
rexergie@rexergie:~$ sudo apt-cache policy matrix-synapse
matrix-synapse:
  Installiert:           0.25.1-1
  Installationskandidat: 0.25.1-1

@rexometer
Copy link

This fix 6f05de0 is still missing for me in the debian package 0.26.0-1.
Is no one else using this package with LDAP? Or is it working for you guys (@jkolo @agentpurple)?

@Josue-T
Copy link

Josue-T commented Jan 25, 2018

@rexometer did you have upgraded your synapse app to the last version ? Because since 4 month ago the app moved from the debian package to pythonvirtualenvironnement.

@rexometer
Copy link

thanks @Josue-T for the fast reply. Not sure, I installed it via package-manager (added the repo http://matrix.org/packages/debian/) maybe 1,5 years ago and always updated it via apt-get. What else is needed to correctly update it?

@misse
Copy link

misse commented Feb 27, 2018

This affects me as well, I've followed the pip upgrade guide and I can't issue new logins through LDAP. My log only show me the 500 though it doesn't show me the trace from python, please instruct me on how to find more specific log entries.

matrix-synapse (0.26.0)

@richvdh
Copy link
Member

richvdh commented Feb 27, 2018

For the record: this issue (internal server error) was introduced in v0.25.0 by 4c8f94a and fixed by #2679 in v0.26.0.

I have opened (and closed) a separate issue #2912 for the problem mentioned by @rexometer.

@Josue-T wrote:

Because since 4 month ago the app moved from the debian package to pythonvirtualenvironnement.

I don't know what this is referring to, and it doesn't really make much sense. There has been no moving of anything from a debian package to anywhere else. If you have installed with debian, then please continue to upgrade via debian - attempting to use pip to upgrade an installation made by the debian package will certainly lead to brokenness.

@misse you'll get better support for synapse administration in the matrix rooms than by commenting on a resolved issue, but your homeserver.log should show the python stacktrace.

@misse
Copy link

misse commented Feb 27, 2018

Thanks @richvdh

My homeserver.log doesn't show the stack trace and I still have the issue that is supposed to be fixed. I.e. I can't log in users via LDAP, I get the m_unknown message for riot but can't find anything else. I'll try to join the synapse admin room to figure this out.

@misse
Copy link

misse commented Feb 27, 2018

Issue solved by upgrading rest_auth_provider.py to the latest version (46e68c4cbeb4c027cf4d65e4ae883fdabe8762c1), upgrading mxisd to 0.6.1 and restarting synapse

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants