You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
synapse_port_db generates an unusable database #9979
After running synapse_port_db following the instructions, attempting to start synapse pointing to the generated database results in an error along the lines of:
2021-05-13 17:48:23,671 - synapse.storage.util.sequence - 173 - WARNING - main - Postgres sequence event_auth_chain_id is behind table event_auth_chains: 224 < 225
2021-05-13 17:48:23,671 - twisted - 258 - ERROR - main - *******************************************************************************
2021-05-13 17:48:23,671 - twisted - 258 - ERROR - main -
2021-05-13 17:48:23,671 - twisted - 258 - ERROR - main - Postgres sequence 'event_auth_chain_id' is inconsistent with associated
2021-05-13 17:48:23,672 - twisted - 258 - ERROR - main - table 'event_auth_chains'. This can happen if Synapse has been downgraded and
2021-05-13 17:48:23,672 - twisted - 258 - ERROR - main - then upgraded again, or due to a bad migration.
2021-05-13 17:48:23,672 - twisted - 258 - ERROR - main -
2021-05-13 17:48:23,672 - twisted - 258 - ERROR - main - To fix this error, shut down Synapse (including any and all workers)
2021-05-13 17:48:23,672 - twisted - 258 - ERROR - main - and run the following SQL:
2021-05-13 17:48:23,672 - twisted - 258 - ERROR - main -
2021-05-13 17:48:23,672 - twisted - 258 - ERROR - main - SELECT setval('event_auth_chain_id', (
2021-05-13 17:48:23,672 - twisted - 258 - ERROR - main - SELECT GREATEST(MAX(chain_id), 0) FROM event_auth_chains
2021-05-13 17:48:23,673 - twisted - 258 - ERROR - main - ));
2021-05-13 17:48:23,673 - twisted - 258 - ERROR - main -
2021-05-13 17:48:23,673 - twisted - 258 - ERROR - main - See docs/postgres.md for more information.
2021-05-13 17:48:23,673 - twisted - 258 - ERROR - main -
2021-05-13 17:48:23,673 - twisted - 258 - ERROR - main - *******************************************************************************
(attempting to re-run synapse_port_db produces a similar error)
It actually seems like a lot of my messages are delayed now. I didn't restart the whole migration process with the change, instead re-ran the script. I suppose I might just restart the whole process.
edit: Everything worked this time around. I guess the database was corrupted, or the SQL statement borked things.
Activity
richvdh commentedon May 13, 2021
It looks like this is still #9382. #9449 attempted to fix it, but got an off-by-one-error.
vulet commentedon May 20, 2021
I just ran into this issue.
curr_chain_id + 1in #9991 resolved it, in addition to running:Thanks.
vulet commentedon May 20, 2021
It actually seems like a lot of my messages are delayed now. I didn't restart the whole migration process with the change, instead re-ran the script. I suppose I might just restart the whole process.
edit: Everything worked this time around. I guess the database was corrupted, or the SQL statement borked things.
Fix off-by-one-error in synapse_port_db (#9991)