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

error 500 if room in space destroyed, but still in space, and then viewed over federation #10032

Closed
cleverca22 opened this issue May 21, 2021 · 6 comments
Assignees
Labels
S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@cleverca22
Copy link

Description

error 500 on the server-to-server protocol, when listing rooms in a space, after one has been partially destroyed

Steps to reproduce

  • create a space with a public room on HS-1
  • join the space from a user on HS-2
  • delete the public room
  • try to list the rooms, from the HS-2 user

HS-2 will get:

synapse.http.matrixfederationclient: [POST-7202] {POST-O-3371} [matrix.org] Got response headers: 500 Internal Server Error
synapse.http.matrixfederationclient: [POST-7202] {POST-O-3371} [matrix.org] Request failed: POST matrix://matrix.org/_matrix/federation/unstable/org.matrix.msc2946/spaces/%21EDITED%3Amatrix.org: HttpResponseException('500: Internal Server Error')

HS-1 will get:

synapse.http.server: [POST-8610] Failed handle request via 'FederationSpaceSummaryServlet': <XForwardedForRequest at 0x7f1d5151e520 method='POST' uri='/_matrix/federation/unstable/org.matrix.msc2946/spaces/%21EDITED%3AEDITED' clientproto='HTTP/1.0' site='8448'>
Traceback (most recent call last):
  File "/nix/store/pq9bx9ka6jpjp00k99vhhxdwlp9dz3rw-matrix-synapse-1.34.0/lib/python3.8/site-packages/synapse/http/server.py", line 258, in _async_render_wrapper
    callback_return = await self._async_render(request)
  File "/nix/store/pq9bx9ka6jpjp00k99vhhxdwlp9dz3rw-matrix-synapse-1.34.0/lib/python3.8/site-packages/synapse/http/server.py", line 446, in _async_render
    callback_return = await raw_callback_return
  File "/nix/store/pq9bx9ka6jpjp00k99vhhxdwlp9dz3rw-matrix-synapse-1.34.0/lib/python3.8/site-packages/synapse/federation/transport/server.py", line 347, in new_func
    response = await func(
  File "/nix/store/pq9bx9ka6jpjp00k99vhhxdwlp9dz3rw-matrix-synapse-1.34.0/lib/python3.8/site-packages/synapse/federation/transport/server.py", line 1430, in on_POST
    return 200, await self.handler.federation_space_summary(
  File "/nix/store/pq9bx9ka6jpjp00k99vhhxdwlp9dz3rw-matrix-synapse-1.34.0/lib/python3.8/site-packages/synapse/handlers/space_summary.py", line 209, in federation_space_summary
    rooms, events = await self._summarize_local_room(
  File "/nix/store/pq9bx9ka6jpjp00k99vhhxdwlp9dz3rw-matrix-synapse-1.34.0/lib/python3.8/site-packages/synapse/handlers/space_summary.py", line 250, in _summarize_local_room
    room_entry = await self._build_room_entry(room_id)
  File "/nix/store/pq9bx9ka6jpjp00k99vhhxdwlp9dz3rw-matrix-synapse-1.34.0/lib/python3.8/site-packages/synapse/handlers/space_summary.py", line 349, in _build_room_entry
    current_state_ids[(EventTypes.Create, "")]
KeyError: ('m.room.create', '')

note, the server addresses in the errors dont match up, i flipped HS-1 and HS-2 and reproduced it twice, to get logs for each end, without running 2 HS's

Version information

issue happens when matrix.org and a local 1.34.0 HS interact together, both ends fail with error 500

  • Platform:
    nixos
@cleverca22 cleverca22 changed the title error 500 if room in space destroyed, but still in space, and then viewer over federation error 500 if room in space destroyed, but still in space, and then viewed over federation May 21, 2021
@clokep
Copy link
Member

clokep commented May 21, 2021

Can you describe how you "delete the public room"? Do you mean remove it from the space or something else?

@clokep
Copy link
Member

clokep commented May 21, 2021

I wonder if this was due to using StateHandler.get_current_state() and store.get_current_state_ids() in different places. This was changed (for other reasons) in #9922, so will be interesting to try to reproduce on develop / once 1.35.0rc1 comes out.

@cleverca22
Copy link
Author

cleverca22 commented May 22, 2021

Can you describe how you "delete the public room"? Do you mean remove it from the space or something else?

being the last person in the room, i simply leave it
then attempting to view the list of spaces, from a different homeserver, causes that error in the logs

the state on the space claims it still exists, but the homeserver for the room claims it doesnt

@clokep
Copy link
Member

clokep commented May 24, 2021

Thanks! I'll take a look at this, I think I have an idea of the issue. 😄

@clokep clokep self-assigned this May 24, 2021
@clokep clokep added S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. labels May 24, 2021
@clokep
Copy link
Member

clokep commented May 24, 2021

I attempted to reproduce this and was unable to (on the latest develop)s, so it is possible that #9922 fixed this as a side-effect or that I'm doing something wrong. :) I'll need to revert to an older version and check again.

@clokep
Copy link
Member

clokep commented Aug 19, 2021

I confirmed this was fixed by #9922 and was released in Synapse v1.35.0rc1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

2 participants