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

/_matrix/federation/v1/state returns a 500 error if called for an outlier #12074

Closed
richvdh opened this issue Feb 24, 2022 · 2 comments · Fixed by #12087
Closed

/_matrix/federation/v1/state returns a 500 error if called for an outlier #12074

richvdh opened this issue Feb 24, 2022 · 2 comments · Fixed by #12087
Labels
S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@richvdh
Copy link
Member

richvdh commented Feb 24, 2022

2022-02-24 09:59:19,270 - synapse.http.server - 100 - ERROR - GET-281 - Failed handle request via 'FederationStateV1Servlet': <SynapseRequest at 0x7f683468c0a0 method='GET' uri='/_matrix/federation/v1/state/%21ItGBZyOeGywOWwJbSK%3Alocalhost%3A8840?event_id=%242DMzm1OALGG81SL30L-ArnxcWKfwrlvkv-bqehxWNdk' clientproto='HTTP/1.1' site='8849'>
Traceback (most recent call last):
  File "/venv/lib/python3.9/site-packages/twisted/internet/defer.py", line 1660, in _inlineCallbacks
    result = current_context.run(gen.send, result)
StopIteration: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/venv/lib/python3.9/site-packages/twisted/internet/defer.py", line 1660, in _inlineCallbacks
    result = current_context.run(gen.send, result)
StopIteration: {'ed25519:a_VhKa': FetchKeyResult(verify_key=<nacl.signing.VerifyKey object at 0x7f6834b83550>, valid_until_ts=1645782543370)}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/venv/lib/python3.9/site-packages/synapse/http/server.py", line 269, in _async_render_wrapper
    callback_return = await self._async_render(request)
  File "/venv/lib/python3.9/site-packages/synapse/http/server.py", line 471, in _async_render
    callback_return = await raw_callback_return
  File "/venv/lib/python3.9/site-packages/synapse/federation/transport/server/_base.py", line 323, in new_func
    response = await func(
  File "/venv/lib/python3.9/site-packages/synapse/federation/transport/server/federation.py", line 160, in on_GET
    return await self.handler.on_room_state_request(
  File "/venv/lib/python3.9/site-packages/synapse/federation/federation_server.py", line 535, in on_room_state_request
    await self._state_resp_cache.wrap(
  File "/venv/lib/python3.9/site-packages/synapse/util/caches/response_cache.py", line 250, in wrap
    return await make_deferred_yieldable(entry.result.observe())
  File "/venv/lib/python3.9/site-packages/twisted/internet/defer.py", line 1660, in _inlineCallbacks
    result = current_context.run(gen.send, result)
  File "/venv/lib/python3.9/site-packages/synapse/util/caches/response_cache.py", line 246, in cb
    return await callback(*args, **kwargs)
  File "/venv/lib/python3.9/site-packages/synapse/federation/federation_server.py", line 581, in _on_context_state_request_compute
    pdus: Iterable[EventBase] = await self.handler.get_state_for_pdu(
  File "/venv/lib/python3.9/site-packages/synapse/handlers/federation.py", line 1015, in get_state_for_pdu
    del results[(event.type, event.state_key)]
KeyError: ('m.room.member', '@anon-20220224_094858-726:localhost:8881')
@richvdh richvdh changed the title /_matrix/federation/v1/state returns a 500 error if called for an unknown event /_matrix/federation/v1/state returns a 500 error if called for an outlier Feb 24, 2022
@richvdh
Copy link
Member Author

richvdh commented Feb 24, 2022

seems like a 404 would make more sense here (which is what you get if you call it on a completely unknown event).

@richvdh
Copy link
Member Author

richvdh commented Feb 24, 2022

related: /_matrix/federation/v1/state_ids returns an empty response:

{"pdu_ids":[],"auth_chain_ids":[]}

@erikjohnston erikjohnston added S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. S-Tolerable Minor significance, cosmetic issues, low or no impact to users. and removed S-Minor Blocks non-critical functionality, workarounds exist. labels Feb 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants