diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2019-12-19 14:53:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-19 14:53:15 +0000 |
commit | bca30cefee3849813565dd71e571172818629d85 (patch) | |
tree | d958b04ebf70806c7f57e0a0c49acaf055811b61 /synapse/storage/prepare_database.py | |
parent | Fix sdnotify with acme enabled (#6571) (diff) | |
download | synapse-bca30cefee3849813565dd71e571172818629d85.tar.xz |
Improve diagnostics on database upgrade failure (#6570)
`Failed to upgrade database` is not helpful, and it's unlikely that UPGRADE.rst has anything useful.
Diffstat (limited to 'synapse/storage/prepare_database.py')
-rw-r--r-- | synapse/storage/prepare_database.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/storage/prepare_database.py b/synapse/storage/prepare_database.py index b4194b44ee..0195edf4ac 100644 --- a/synapse/storage/prepare_database.py +++ b/synapse/storage/prepare_database.py @@ -69,7 +69,10 @@ def prepare_database(db_conn, database_engine, config, data_stores=["main"]): if user_version != SCHEMA_VERSION: # If we don't pass in a config file then we are expecting to # have already upgraded the DB. - raise UpgradeDatabaseException("Database needs to be upgraded") + raise UpgradeDatabaseException( + "Expected database schema version %i but got %i" + % (SCHEMA_VERSION, user_version) + ) else: _upgrade_existing_database( cur, |