Open matrixbot opened 6 months ago
Same issue here, just joining a bigger room is enough. And synapse dies.
That a very critical issue, literally my whole synapse server dies.
Before v1.100 I think everything was ok
2024-03-08 23:29:38,668 - synapse.handlers.federation - 1989 - ERROR - sync_partial_state_room-1 - Failed to get state for !mefQhZzgTaxNCNzAeK:kde.org at <FrozenEventV3 event_id=$-m9oVE3FrfmcYhf7-30ZP2b-xMTINeXJDcZ2BdpELi8, type=m.room.member, state_key=@sandwich:archworks.co, outlier=False> from alteredcube.com because ERROR 403: We can't get valid state history., giving up!
2024-03-08 23:29:38,672 - synapse.metrics.background_process_metrics - 253 - ERROR - sync_partial_state_room-1 - Background process 'sync_partial_state_room' threw an exception
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/synapse/handlers/federation_event.py", line 1165, in _compute_event_context_with_maybe_missing_prevs
await self._get_state_ids_after_missing_prev_event(
File "/usr/lib/python3.11/site-packages/synapse/handlers/federation_event.py", line 1228, in _get_state_ids_after_missing_prev_event
) = await self._federation_client.get_room_state_ids(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/synapse/federation/federation_client.py", line 560, in get_room_state_ids
result = await self.transport_layer.get_room_state_ids(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/synapse/federation/transport/client.py", line 87, in get_room_state_ids
return await self.client.get_json(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/synapse/http/matrixfederationclient.py", line 1215, in get_json
json_dict, _ = await self.get_json_with_headers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/synapse/http/matrixfederationclient.py", line 1317, in get_json_with_headers
response = await self._send_request_with_optional_trailing_slash(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/synapse/http/matrixfederationclient.py", line 498, in _send_request_with_optional_trailing_slash
response = await self._send_request(request, **send_request_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/synapse/http/matrixfederationclient.py", line 794, in _send_request
raise exc
synapse.api.errors.HttpResponseException: 403: Forbidden
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/synapse/metrics/background_process_metrics.py", line 251, in run
return await func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/synapse/handlers/federation.py", line 1840, in _sync_partial_state_room_wrapper
await self._sync_partial_state_room(
File "/usr/lib/python3.11/site-packages/synapse/handlers/federation.py", line 1966, in _sync_partial_state_room
await self._federation_event_handler.update_state_for_partial_state_event(
File "/usr/lib/python3.11/site-packages/synapse/handlers/federation_event.py", line 635, in update_state_for_partial_state_event
context = await self._compute_event_context_with_maybe_missing_prevs(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/synapse/handlers/federation_event.py", line 1185, in _compute_event_context_with_maybe_missing_prevs
raise FederationError(
synapse.api.errors.FederationError: ERROR 403: We can't get valid state history.
With v1.99 synapse does not crash, but throws the same error as v1.103
This issue has been migrated from #15204.
Description
I use a script to test federation between matrix.org and my homeserver. It uses two bots. The test goes like this:
Bot 1 is on my HS. Bot 2 is on matrix.org.
This process is then repeated for bot 2.
I logged into the bots today to grab new access tokens and saw that there were a bunch of rooms that they had not left so I manually removed them. I was able to leave all the rooms of the
matrix.org
bot but was not able to do so for the bot on my HS. I tried nuking the rooms using/_synapse/admin/v2/rooms/
( withforce
+purge
) but that gave me this error:I restarted the server and checked the logs and saw that it was failing to re-sync the broken rooms with errors such as:
Doing
/_synapse/admin/v1/purge_history/
on the room yields this:I've thought about nuking everything (https://github.com/matrix-org/synapse/issues/14300#issuecomment-1294969068) but thought I'd file a bug report first.
Steps to reproduce
???
Homeserver
evulid.cc + matrix.org
Synapse Version
1.77.0
Installation Method
pip (from PyPI)
Database
PostgreSQL, no
Workers
Multiple workers
Platform
Ubuntu 22.04 LXC
Configuration
Shorter msg retention
Relevant log output
Anything else that would be useful to know?
No response