matrix-org / sydent

Sydent: Reference Matrix Identity Server
http://matrix.org
Apache License 2.0
303 stars 84 forks source link

A bug in third party invitations #551

Closed GreenFootballs closed 1 year ago

GreenFootballs commented 1 year ago

My organization has been using matrix.org as our ID server for an Element client, and for a while we were having problems with sending third-party invitations to a chat room. Element's invitation feature would fail with "Unknown error."

In January, this bug was fixed in the ID server at matrix.org and we could invite people with third party email addresses again.

Now, however, we'd like to customize the email templates to better fit our needs, so I installed Sydent by cloning this repo and using poetry according to the "Install from source" directions.

I've confirmed that our Sydent installation works; I can make API calls, and log out and in. But...

It seems to be suffering from the exact same bug described above; third party invitations fail with the message "Unknown error." But if we switch back to matrix.org, it works again. So it seems like there must be a difference between the code in this repo and what's running at matrix.org.

I saved the matrix-synapse log from January (before it was fixed) with the error traceback, and compared it to the log from our new Sydent installation, and the sequence of calls leading to the error is identical.

Here's the log from our new install.

2023-02-27 18:44:45,507 - synapse.http.server - 124 - ERROR - POST-301082 - Failed handle request via 'RoomMembershipRestServlet': <XForwardedForRequest at 0x7fcf3ff74370 method='POST' uri='/_matrix/client/r0/rooms/!jkMpniilnbACSfnrLu%3Asidetalk.net/invite' clientproto='HTTP/1.0' site='8008'>
Traceback (most recent call last):
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/http/server.py", line 307, in _async_render_wrapper
    callback_return = await self._async_render(request)
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/http/server.py", line 513, in _async_render
    callback_return = await raw_callback_return
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/rest/client/room.py", line 964, in on_POST
    await self.room_member_handler.do_3pid_invite(
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/handlers/room_member.py", line 1511, in do_3pid_invite
    event, stream_id = await self._make_and_store_3pid_invite(
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/handlers/room_member.py", line 1595, in _make_and_store_3pid_invite
    ) = await self.identity_handler.ask_id_server_for_third_party_invite(
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/handlers/identity.py", line 756, in ask_id_server_for_third_party_invite
    data = await self.blacklisting_http_client.post_json_get_json(
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/http/client.py", line 577, in post_json_get_json
    raise HttpResponseException(
synapse.api.errors.HttpResponseException: 500: Internal Server Error
clokep commented 1 year ago

Do you have logs from sydent showing what the internal error was?

GreenFootballs commented 1 year ago

Thanks for replying; I discovered the problem was on our end, a misconfigured email server. Sorry for the false alarm, you can close this issue.

clokep commented 1 year ago

Thanks for following up!