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

/messages returns 500 errors after purging room history #1623

Closed
richvdh opened this issue Nov 10, 2016 · 2 comments
Closed

/messages returns 500 errors after purging room history #1623

richvdh opened this issue Nov 10, 2016 · 2 comments
Assignees
Labels
A-Messages-Endpoint /messages client API endpoint (`RoomMessageListRestServlet`) (which also triggers /backfill) z-bug (Deprecated Label)

Comments

@richvdh
Copy link
Member

richvdh commented Nov 10, 2016

If you attempt to back-paginate past the point that you purged up to (on an unfederated room), synapse returns 500 errors from /messages.

@richvdh
Copy link
Member Author

richvdh commented Nov 10, 2016

016-11-10 19:50:29,436 - synapse.http.server - 139 - ERROR - GET-42- Failed handle request synapse.http.server._async_render on <synapse.rest.ClientRestResource object at 0x7f3e1f0927d0>: <SynapseRequest at 0x7f3e1e6db830 method=GET uri=/_matrix/client/r0/rooms/!RoiHwUcCARaykMwyRo%3Afred.sw1v.org/messages?from=t462-986_36147_0_444_14_20_1009&limit=20&dir=b&access_token=<redacted> clientproto=HTTP/1.1 site=8008>
Traceback (most recent call last):
  File "synapse/http/server.py", line 116, in wrapped_request_handler
    yield request_handler(self, request, request_metrics)
  File "/home/rav/work/synapse/env/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1126, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/home/rav/work/synapse/env/local/lib/python2.7/site-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "synapse/http/server.py", line 255, in _async_render
    callback_return = yield callback(request, **kwargs)
  File "/home/rav/work/synapse/env/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1126, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/home/rav/work/synapse/env/local/lib/python2.7/site-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "synapse/rest/client/v1/room.py", line 426, in on_GET
    event_filter=event_filter,
  File "/home/rav/work/synapse/env/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1126, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/home/rav/work/synapse/env/local/lib/python2.7/site-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "synapse/handlers/message.py", line 126, in get_messages
    room_id, max_topo
  File "/home/rav/work/synapse/env/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1128, in _inlineCallbacks
    result = g.send(result)
  File "synapse/handlers/federation.py", line 611, in maybe_backfill
    states = dict(zip(event_ids, [s[1] for s in states]))
TypeError: '_StateCacheEntry' object does not support indexing

@babolivier
Copy link
Contributor

Broke because of #1060, fixed as part of #1818. Separately, I've opened #6392 to add a test that makes sure we don't break /messages again with room history purges.

@MadLittleMods MadLittleMods added the A-Messages-Endpoint /messages client API endpoint (`RoomMessageListRestServlet`) (which also triggers /backfill) label Jul 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Messages-Endpoint /messages client API endpoint (`RoomMessageListRestServlet`) (which also triggers /backfill) z-bug (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

4 participants