matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.79k stars 2.13k forks source link

Cannot invite external user using 3pid #4919

Closed Peter2121 closed 5 years ago

Peter2121 commented 5 years ago

Description

When I try to invite an external user to a room on my server - I get an error.

Steps to reproduce

Version information

Synapse 0.34.1.1 Installed on FreeBSD from package (official repository).

Riot 1.0.1 Mxisd 1.3.1

Domain bimp.fr Server chat.bimp.fr

I get the following stacktrace on synapse:

-- <exception caught here> ---
  File "/usr/local/lib/python2.7/site-packages/synapse/http/server.py", line 81, in wrapped_request_handler
    yield h(self, request)
  File "/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/local/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/local/lib/python2.7/site-packages/synapse/http/server.py", line 316, in _async_render
    callback_return = yield callback(request, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/local/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/local/lib/python2.7/site-packages/synapse/rest/client/v1/room.py", line 669, in on_POST
    txn_id
  File "/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/local/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/local/lib/python2.7/site-packages/synapse/handlers/room_member.py", line 643, in do_3pid_invite
    txn_id=txn_id
  File "/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/local/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/local/lib/python2.7/site-packages/synapse/handlers/room_member.py", line 754, in _make_and_store_3pid_invite
    inviter_avatar_url=inviter_avatar_url
  File "/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/local/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/local/lib/python2.7/site-packages/synapse/handlers/room_member.py", line 854, in _ask_id_server_for_third_party_invite
    invite_config
  File "/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1386, in _inlineCallbacks
    result = g.send(result)
  File "/usr/local/lib/python2.7/site-packages/synapse/http/client.py", line 340, in post_urlencoded_get_json
    raise HttpResponseException(response.code, response.phrase, body)
exceptions.UnboundLocalError: local variable 'body' referenced before assignment
richvdh commented 5 years ago

fixed by #4460. Please check the latest release before reporting bugs.