Skip to content

Attempting to join rooms fails with a 500 #19233

@williamhorning

Description

@williamhorning

Description

when joining rooms on other homeservers, synapse will fail to join the room, giving a 500 error, and will show an error like this on the client:

failed to join room

the response has the following body: {"errcode":"M_UNKNOWN","error":"Internal server error"}

Steps to reproduce

  • install synapse 1.143.0, setup the config to use postgresql and make it not leak memory
  • try joining any room on another homeserver
  • expect it to start joining the room or to timeout, but instead get a 500 error and the following logs

Homeserver

ineedmore.money, which I manage, and is running synapse 1.143.0

Synapse Version

1.143.0

Installation Method

Other (please mention below)

Database

a single PostgreSQL 17 server

Workers

Single process

Platform

this is running on an Alpine Linux edge system using the provided synapse package: https://pkgs.alpinelinux.org/package/edge/community/x86_64/synapse

Configuration

nothing unusual seems to be turned on and presence is disabled

Relevant log output

2025-11-26 21:51:19,678 - synapse.http.matrixfederationclient - 370 - INFO - POST-2539 - {PUT-O-797} [matrix.org] Completed request: 200 OK in 0.67 secs, got 35335 bytes - PUT matrix-federation://matrix.org/_matrix/federation/v2/send_join/%21aPQx8hPCm0vu6PiwsZbVSsVPlugBWOyanle4y5-8p7Q/%24kd1trFCoYmAwPiFo8REBPKXnJ84UMl11bgkd8V6Mk80?omit_members=true
2025-11-26 21:51:19,679 - synapse.federation.federation_client - 1228 - INFO - POST-2539 - Processing from send_join 19 events
2025-11-26 21:51:19,903 - synapse.handlers.federation - 1914 - INFO - sync_partial_state_room-9 - Syncing state for room !aPQx8hPCm0vu6PiwsZbVSsVPlugBWOyanle4y5-8p7Q via matrix.org
2025-11-26 21:51:19,905 - synapse.http.server - 146 - ERROR - POST-2539 - Failed handle request via 'JoinRoomAliasServlet': <XForwardedForRequest at 0x7c72c2d520c0 method='POST' uri='/_matrix/client/v3/join/!aPQx8hPCm0vu6PiwsZbVSsVPlugBWOyanle4y5-8p7Q?server_name=matrix.org&via=matrix.org' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/synapse/http/server.py", line 334, in _async_render_wrapper
    callback_return = await self._async_render(request)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/synapse/http/server.py", line 575, in _async_render
    callback_return = await raw_callback_return
                      ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/synapse/rest/client/room.py", line 583, in on_POST
    return await self._do(request, requester, room_identifier, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/synapse/rest/client/room.py", line 564, in _do
    await self.room_member_handler.update_membership(
  File "/usr/lib/python3.12/site-packages/synapse/handlers/room_member.py", line 662, in update_membership
    result = await self.update_membership_locked(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/synapse/handlers/room_member.py", line 1099, in update_membership_locked
    remote_join_response = await self._remote_join(
                           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/synapse/handlers/room_member.py", line 1944, in _remote_join
    event_id, stream_id = await self.federation_handler.do_invite_join(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/synapse/handlers/federation.py", line 715, in do_invite_join
    await self._federation_event_handler.process_remote_join(
  File "/usr/lib/python3.12/site-packages/synapse/handlers/federation_event.py", line 568, in process_remote_join
    await self._auth_and_persist_outliers(
  File "/usr/lib/python3.12/site-packages/synapse/handlers/federation_event.py", line 1720, in _auth_and_persist_outliers
    ev.event_id: [e_id for e_id in ev.auth_event_ids() if e_id in event_map]
                                   ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/synapse/events/__init__.py", line 551, in auth_event_ids
    return self._dict["auth_events"] + [create_event_id]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
TypeError: can only concatenate tuple (not "list") to tuple
2025-11-26 21:51:19,907 - synapse.handlers.federation - 1922 - INFO - sync_partial_state_room-9 - Updating current state for !aPQx8hPCm0vu6PiwsZbVSsVPlugBWOyanle4y5-8p7Q
2025-11-26 21:51:19,907 - synapse.access.http.8008 - 521 - INFO - POST-2539 - 2601:985:4c00:8690::28b5 - 8008 - {@jersey:ineedmore.money} Processed request: 1.303sec/0.001sec (0.022sec, 0.004sec) (0.042sec/0.076sec/32) 55B 500 "POST /_matrix/client/v3/join/!aPQx8hPCm0vu6PiwsZbVSsVPlugBWOyanle4y5-8p7Q?server_name=matrix.org&via=matrix.org HTTP/1.1" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" [0 dbevts]
2025-11-26 21:51:19,910 - synapse.handlers.federation - 1932 - INFO - sync_partial_state_room-9 - Handling any pending device list updates
2025-11-26 21:51:19,913 - synapse.handlers.federation - 1936 - INFO - sync_partial_state_room-9 - Clearing partial-state flag for !aPQx8hPCm0vu6PiwsZbVSsVPlugBWOyanle4y5-8p7Q

Anything else that would be useful to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions