matrix-org / dendrite

Dendrite is a second-generation Matrix homeserver written in Go!
https://matrix-org.github.io/dendrite/
Apache License 2.0
5.75k stars 674 forks source link

syncapi: failed to map all event IDs to events #1564

Closed S7evinK closed 2 years ago

S7evinK commented 4 years ago

Background information

Description

After joining #archlinux:archlinux.org (quite large, with 4.5k users and 450+ servers) i received the following error in the syncapi:

time="2020-10-24T18:21:53.710378246Z" level=error msg="rp.currentSyncForUser failed" func="github.com/matrix-org/dendrite/syncapi/sync.(*RequestPool).OnIncomingSyncRequest" file="github.com/matrix-org/dendrite/syncapi/sync/requestpool.go:82" device_id=qji0jlMp error="rp.db.IncrementalSync: d.addPDUDeltaToResponse: failed to map all event IDs to events: (got 6013, wanted 6014)" limit=20 req.id=X44ObqralQmc req.method=GET req.path=/_matrix/client/r0/sync since=s3040_4070.dl-0-0 timeout=0s user_id="@s7evink:dendrite.s3cr3t.me"

After closing my Element Web tab for about an hour, this seems to have resolved itself.

Before that, the roomserver added 6018 states.

time="2020-10-24T18:18:58.626414872Z" level=info msg="Producing to topic 'DendriteOutputRoomEvent'" func="github.com/matrix-org/dendrite/roomserver/internal/input.(*Inputer).WriteOutputEvents" file="github.com/matrix-org/dendrite/roomserver/internal/input/input.go:98" adds_state=6018 event_id="$-U5gTmET1qRcusr99n3pgSCERQEjo-LE4py6nEn8QfA" event_type=m.room.member removes_state=0 room_id="!SEgsRQLScqPxYtucHl:archlinux.org" send_as_server="" sender="@s7evink:dendrite.s3cr3t.me" type=new_room_event

Steps to reproduce

syncapi.log roomserver.log

ArnoPoitt commented 3 years ago

Background information

Description

I have a very similar issue, although it is not the same line of the requestpool file sending an error. It happened quit suddently, I was invited to join a room and also added new users who I invited at the same time.

level=error msg="rp.currentSyncForUser failed" func="OnIncomingSyncRequest\n\t" file=" [github.com/matrix-org/dendrite/syncapi/sync/requestpool.go:132]" device_id=x1UKnMmk error="rp.db.IncrementalSync: d.addPDUDeltaToResponse: failed to map all event IDs to events: (got 37, wanted 38)" limit=20 req.id=iUWuiatAmyfH req.method=GET req.path=/_matrix/client/r0/sync since=s29131_37363.dl-0-0 timeout=0s user_id="@name:server.tld"

Steps to reproduce

I don't really know honestly I miss configured the container so I am not able to find the logs which journalctl

neilalexander commented 3 years ago

There's a temporary mitigation in commit bad81c028f090af0e1005076829db67d1a749a14 for this, but I'm going to leave the issue open for now because it's not permanently resolved.

kegsay commented 3 years ago

Feels like a similar issue to https://github.com/matrix-org/dendrite/issues/1544 - we need to be able to more gracefully handle missing events e.g by fetching them

S7evinK commented 2 years ago

Didn't see this for a long time, so closing this.