-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
"Error leaving room No create event in auth events" after migrating from sqlite to postgresql #12487
Comments
To confirm: this problem did not exist with SQLite, but started immediately after porting over to Postgres? To confirm: how many times did you run the 'port database' tool? Was Synapse stopped on (before) the final run of the tool and not started again until it was switched over to Postgres? This issues reminds me a bit of #12147, but also seems different enough. The error you're showing in the logs sounds like your 'No create event in auth events' is a different error; does that appear anywhere in the logs? (Look at the section of log before you see your request to leave the room.) Please could you run both of these on both Postgres ( SELECT 1 FROM events WHERE event_id = '$bThEJSE4NlAU4XnLaHsHSn92zla7A5-5Q0BCn5DCJgc'; SELECT 1 FROM event_json WHERE event_id = '$bThEJSE4NlAU4XnLaHsHSn92zla7A5-5Q0BCn5DCJgc'; |
Correct. It was working just fine. Only after starting it up after porting it over did I notice this.
You know what, that was probably it then. The final run of the port db script is on the actual database and not a snapshot. So, I had synapse running. Because it is in a docker container, there is no way to shut down the server, but keep the container running to run the script. ... Is there? Docker Containers live and die on the service they run, right?
It looks like it appears just after the here is a section of the log. The as you can see the timestamps show this error occurs a couple of seconds after the unique violation error
From my sqlite database (not the snapshots but the actual most resent of the sqlite ones):
From the current postgres database as it exists now:
So this is the smoking gun that actually shows a desync? Well thanks for pointing this part out too. But I guess the whole "running the db port script with synapse on" thing was what did me in. I should have taken it more seriously and run the script outside of the synapse container. |
I am closing this as it appears to be the result of running the script with the server on, rather than a bug in Synapse/the |
@calvinjgs Although this seems to be what's done you in, it'd be good to understand why you wanted to keep the container running to run the script? If I was, for some reason, insistent on staying within Docker Containers, I think I would have used something like |
@reivilibre,
Is there actually a way to run the script without the server up? |
Description
I can't leave some federated rooms after migration from sqlite to postgresql14
I get a "Error leaving room No create event in auth events" error in Element Desktop.
(also other actions don't work, like sending, and probably receiving, messages)
Steps to reproduce
I expect to be able to leave the rooms without the error. I also expect that the database was ported/migrated over correctly.
Additional Information
I think each attempt to leave produces a
psycopg2.errors.UniqueViolation
error in the logs. Here is one of them with a couple log entries before and after in case they provide more context.If you want I could provide the entire 300MB log snapshot if more info is needed.
I also have the
homeserver.db
that I migrated from. And myhomeserver.yaml
from before and after as well.my take
So is it trying to add an event that already exists?
Looking at the state events in Synapse admin, one public room had an
m.room.create
entry, but the others did not. (all local rooms had one). However, I ranSELECT * FROM state_events WHERE Type = 'm.room.create';
in postresql which returned one create event for every room.But I don't know what all the tables in the database do or how they interact so I don't know if a solution involves me inserting a create room event somewhere or not.
I read through issue #7642 and the other issues it references. But I don't know if they are really the same or not.
Version information
If not matrix.org:
Version: visiting
https://[my_domain]/_synapse/admin/v1/server_version
in a web browser returns{"server_version":"1.56.0","python_version":"3.9.12"}
Install method: I installed using this docker image.
The text was updated successfully, but these errors were encountered: