summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-07-25 11:01:36 +0100
committerRichard van der Hoff <richard@matrix.org>2018-07-25 11:05:58 +0100
commit1be94440d38ad6af64486ce31c650d0540d4049c (patch)
tree4373a0337bcadda2673f0b72d0c39cf29683989a
parentMerge pull request #3597 from matrix-org/erikj/did_forget (diff)
downloadsynapse-1be94440d38ad6af64486ce31c650d0540d4049c.tar.xz
Fix occasional 'tuple index out of range' error
This fixes a bug in _delete_existing_rows_txn which was introduced in #3435
(though it's been on matrix-org-hotfixes for *years*). This code is only called
when there is some sort of conflict the first time we try to persist an event,
so it only happens rarely. Still, the exceptions are annoying.
-rw-r--r--changelog.d/3607.bugfix1
-rw-r--r--synapse/storage/events.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/changelog.d/3607.bugfix b/changelog.d/3607.bugfix
new file mode 100644
index 0000000000..7ad64593b8
--- /dev/null
+++ b/changelog.d/3607.bugfix
@@ -0,0 +1 @@
+Fix 'tuple index out of range' error
\ No newline at end of file
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index 906a405031..f7c4226ea2 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -1137,7 +1137,7 @@ class EventsStore(EventsWorkerStore):
         ):
             txn.executemany(
                 "DELETE FROM %s WHERE room_id = ? AND event_id = ?" % (table,),
-                [(ev.event_id,) for ev, _ in events_and_contexts]
+                [(ev.room_id, ev.event_id) for ev, _ in events_and_contexts]
             )
 
     def _store_event_txn(self, txn, events_and_contexts):