-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Error joining a state compressed room #4372
Comments
So this looks to be due to the query: https://github.com/matrix-org/synapse/blob/master/synapse/storage/events.py#L903-L909, which is weird because the error suggests the table has Either way, this looks to be a problem with |
(I've transferred the issue to the synapse repo) |
|
How bizarre. Is there any chance you've fiddled with the database? Did you port from an sqlite database? The unique index has been defined on that table since a very very early version of synapse. |
The database had some error on WAL some time ago. At that time I ran a pg_dump, drop the database, and imported the dump. Maybe I screwed up the database since then. So how can I recover from this? |
That should've worked as far as I know. You can add the unique constraint back in by: ALTER TABLE current_state_events
ADD CONSTRAINT current_state_events_room_id_type_state_key_key
UNIQUE (room_id, type, state_key); |
So now I try to add a unique constraint, and get:
|
Annoying. If you query for that row are the event_ids the same? If so you can just delete the duplicates (ensuring there is one row left). Let me dig out a query that will fix conflicts where the event IDs are different |
In fact, I'd be interested to see the output of: SELECT room_id, type, state_key, array_to_string(array_agg(DISTINCT event_id), E'\n')
FROM current_state_events
GROUP BY room_id, type, state_key
HAVING count(*) > 1; which will output all duplicate rows. Feel free to DM me if you don't want to post it on public GH :) |
I got 113 duplicate rows: https://matrixim.cc/dup.txt |
They all look like large public rooms (mostly IRC bridged rooms). I'd be very tempted to have your server leave those rooms (by having all your uses leave the rooms), doing a However, I've looked up what the correct rows for the current state should be and are: |
What if just removing a room from current_state_events without having all the users on the server leaving the room? |
Err, bad things would probably end up happening, but I'm not 100% sure what they would be off the top of my head |
Now I removed the duplications and can join the room now, thanks. |
I don't know whether it has something to do with the state_groups_state compression. I now have problem joining a room, whose state is compressed a few days ago.
I'm using synapse 0.34.0-3 from Debian buster.
The text was updated successfully, but these errors were encountered: