Open hakkelt opened 4 months ago
Hi @hakkelt, do you know which endpoint Element Android is calling when you complete the mentioned action?
The code in the logs should only get triggered by a user attempting to join a room, though I'm not sure why tapping on "Explore rooms" would cause that to happen.
Regardless, this does appear to be a bug. Would you be willing to toss your suggested change in a PR and we can merge it in?
I realized I had copied the wrong log entry (the one copied earlier was some other error caused by the same line). This is the one I get after trying to view the list of rooms in a space:
2024-06-07 23:08:57,365 - synapse.http.server - 146 - ERROR - GET-375 - Failed handle request via 'RoomHierarchyRestServlet': <XForwardedForRequest at 0x7f8374236190 method='GET' uri='/_matrix/client/v1/rooms/!<space id>/hierarchy?suggested_only=false&limit=20' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
File "/opt/synapse/lib/python3.11/site-packages/twisted/internet/defer.py", line 1697, in _inlineCallbacks
result = context.run(gen.send, result)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/synapse/lib64/python3.11/site-packages/synapse/util/caches/response_cache.py", line 265, in cb
return await callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/synapse/lib64/python3.11/site-packages/synapse/handlers/room_summary.py", line 187, in _get_room_hierarchy
if not await self._is_local_room_accessible(requested_room_id, requester):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/synapse/lib64/python3.11/site-packages/synapse/handlers/room_summary.py", line 581, in _is_local_room_accessible
join_rules_event_id = state_ids.get((EventTypes.JoinRules, ""))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/synapse/lib64/python3.11/site-packages/synapse/storage/databases/main/state.py", line 784, in get
return super().get(key, default)
^^^^^^^
TypeError: super(type, obj): obj must be an instance or subtype of type
I would gladly create a PR, but I was unsure whether it was enough or if I should correct other calls to super()
in other methods of the same class.
I think just fixing the one usage for now should be enough. This problem may be related to this issue: https://github.com/python-attrs/attrs/issues/1038 Which would imply that only decorated methods exhibit this issue.
So rather than blindly trying to fix issues that may or may not exist, I think it would be best for the PR to be only for this one line: https://github.com/element-hq/synapse/blob/adeedb7b7c80842665a0b7d46c9188a2c49076fb/synapse/storage/databases/main/state.py#L781
Description
Up until my most recent server upgrade, listing rooms in a space worked fine, but since then I receive the following error messages:
It looks like your homeserver version does not support Spaces
(Element Android),Error while loading rooms
(app.element.io). The bug might have been introduced by #16785 (@erikjohnston @reivilibre), as changing line 783 at/synapse/storage/databases/main/state.py
fromto
apparently fixes the problem, and this line was introduced in the mentioned PR.
Steps to reproduce
Homeserver
private homeserver
Synapse Version
1.108.0
Installation Method
pip (from PyPI)
Database
single postgresql server
Workers
Single process
Platform
Fedora Linux 37 (Server Edition) Python 3.11.6
Configuration
probably unrelated, but mautrix-meta bridge is configured
Relevant log output
Anything else that would be useful to know?
No response