-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Postgres port script fails to set correct initial values for some sequences #9344
Comments
I suspect that we did not update the port DB script when we recently added a few sequences. See the code around synapse/scripts/synapse_port_db Lines 622 to 632 in 7036e24
|
I faced the same inconsistencies with matrix-synapse 1.26.0-1~bpo10+3 on debian buster. Synapse gave me the 3 following sql commands in the log - one at a time.
Then synapse started well.
I checked all the values of the sequences and I found that user_id_seq , instance_map_instance_id_seq and event_auth_chain_id have their default initial value (1). |
@jm-github you should see #9382. You need to run |
TL;DR: Uninitialized sequences
receipts_sequence
(receipts_linearized
)account_data_sequence
(room_account_data
)device_inbox_sequence
(device_inbox
)Steps to reproduce
I have synapse installed through the ubuntu package from the https://packages.matrix.org/debian/ repository, at version
matrix-synapse-py3/unknown,now 1.26.0+focal1 amd64 [installed]
I ran
synapse_port_db
to migrate my synapse install from sqlite to postgres.After the script was complete I updated the database section of my homeserver.yaml to point to the new postgres install, and started up synapse.
The problem was that synapse then failed to come up (and, as an aside,
journalctl --since=today -u matrix-synapse
was uninformative as to why it was failing). Looking at the homeserver log I saw an error message beginning withIt then went on to provide an SQL statement to run to fix that problem.
I checked (
select * from receipts_sequence
) before running that setval statement and the current value of the sequence was in fact 1, indicating it had never been called.After addressing that issue I got error messages about two more sequences (account_data_sequence and device_inbox_sequence) before I was able to start up my synapse.
The printed error message said "This can happen if Synapse has been downgraded and then upgraded again, or due to a bad migration.", but I'm quite sure I've never downgraded synapse or manually run a migration against the sqlite db.
The text was updated successfully, but these errors were encountered: