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

Internal server error when calling /relations with a token from /sync #14830

@clokep

Description

@clokep
2023-01-12 16:41:20,025 - synapse.http.server - 124 - ERROR - GET-832933- Failed handle request via 'RelationPaginationServlet': <XForwardedForRequest at 0x7f5a7a2c98c0 method='GET' uri='/_matrix/client/v1/rooms/!test%3Amatrix.org/relations/%24foo/m.thread?dir=b&limit=20&from=sXXXX_1_YYY_ZZZ_AAA_BBB_CCC_DDD_0' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/synapse/util/caches/descriptors.py", line 243, in _wrapped
    ret = cache.get(cache_key, callback=invalidate_callback)
  File "/usr/local/lib/python3.9/site-packages/synapse/util/caches/deferred_cache.py", line 180, in get
    raise KeyError()
KeyError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/synapse/http/server.py", line 307, in _async_render_wrapper
    callback_return = await self._async_render(request)
  File "/usr/local/lib/python3.9/site-packages/synapse/http/server.py", line 513, in _async_render
    callback_return = await raw_callback_return
  File "/usr/local/lib/python3.9/site-packages/synapse/rest/client/relations.py", line 71, in on_GET
    result = await self._relations_handler.get_relations(
  File "/usr/local/lib/python3.9/site-packages/synapse/handlers/relations.py", line 125, in get_relations
    related_events, next_token = await self._main_store.get_relations_for_event(
  File "/usr/local/lib/python3.9/site-packages/twisted/internet/defer.py", line 1697, in _inlineCallbacks
    result = context.run(gen.send, result)
  File "/usr/local/lib/python3.9/site-packages/synapse/storage/databases/main/relations.py", line 213, in get_relations_for_event
    from_token=from_token.room_key.as_historical_tuple()
  File "/usr/local/lib/python3.9/site-packages/synapse/types.py", line 569, in as_historical_tuple
    raise Exception(
Exception: Cannot call `RoomStreamToken.as_historical_tuple` on live token

https://sentry.tools.element.io/organizations/element/issues/58936/

Metadata

Metadata

Assignees

Labels

A-ThreadsThreaded messagesO-UncommonMost users are unlikely to come across this or unexpected workflowS-MinorBlocks non-critical functionality, workarounds exist.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions