Database schema does not match ixmp schema
Closed this issue · 5 comments
One of the users has reported that they receive the following error message when loading the modelling platform from ixmp "schema of the database does not match the schema of this version of ixmp". Does it mean that after updating to a newer version of message_ix (and ixmp) the databases created by previous versions are obsolete? Is there any approach to resolve this?
@khaeru I added you here, I hope it's fine. I suggest if it's not possible to update the schema of local DB when upgrading to a newer version of ixmp
, there should be a more instructive error message, e.g., suggesting the user to downgrade to the previous version or any solution to retrieve scenarios stored in the local DB with the older schema.
Does it mean that after updating to a newer version of message_ix (and ixmp) the databases created by previous versions are obsolete?
It could also be the opposite. As far as I understand, the Java code under the JDBCBackend has a way of migrating from one version of the database schema to a newer version, but not the reverse. So if a user uses an old version of ixmp to connect to a database that has already been migrated, it cannot ‘rewind’ the schema of that database. This could occur:
- If the user uses a newer version of ixmp locally, and then downgrades their version.
- If they are connecting to a centralized database, like our IIASA Oracle database server.
Some other wrinkles:
- As far as I know, that Java code is not being maintained by anyone, so there are not any likely schema changes that are going to happen. @peterkolp are there any manually-applied changes (i.e. not reflected in the ixmp_source migration code) to the Oracle database that might trigger the error message above? My guess is no, but asking just in case.
- In case (1) above, we do not have any capacity to do follow-up maintenance releases for ixmp. For instance, if we wanted ixmp version 3.3.0 to give an error message when used with a database that is in a new schema corresponding to ixmp 3.6.0, we would need to release ixmp 3.3.1—but we have no “maintenance” branch or testing or release procedure to create 3.3.1 now that development has moved on.
I suggest if it's not possible to update the schema of local DB when upgrading to a newer version of ixmp, there should be a more instructive error message, e.g., suggesting the user to downgrade to the previous version or any solution to retrieve scenarios stored in the local DB with the older schema.
This would be difficult to create tests for; however I could add some code that tries to catch particular Java exceptions and re-raise them. However, I can only do this if I have a complete error traceback with the precise message and the code that raises it. Could you get this from the user in question?
@behnam-zakeri - the problen happens with a local database?
the problen happens with a local database?
Thanks @khaeru and @peterkolp. This experience was from a local database, and after updating to a higher version of ixmp
and message_ix
.
Closing this issue since it hasn't been updated with the relevant information (how can this be reproduced?) in (over) a year.
Please leave a comment or reopen if the issue crops up again.