Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database schema does not match ixmp schema #455

Open
behnam-zakeri opened this issue Aug 29, 2022 · 4 comments
Open

Database schema does not match ixmp schema #455

behnam-zakeri opened this issue Aug 29, 2022 · 4 comments
Assignees
Labels
awaiting info Needs more information from the issuer to continue backend.jdbc Interaction with ixmp_source via JDBCBackend & JPype discuss

Comments

@behnam-zakeri
Copy link
Contributor

behnam-zakeri commented Aug 29, 2022

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?

@behnam-zakeri
Copy link
Contributor Author

@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.

@khaeru khaeru added awaiting info Needs more information from the issuer to continue backend.jdbc Interaction with ixmp_source via JDBCBackend & JPype labels Oct 19, 2022
@khaeru
Copy link
Member

khaeru commented Oct 19, 2022

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:

  1. If the user uses a newer version of ixmp locally, and then downgrades their version.
  2. 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?

@peterkolp
Copy link
Contributor

@behnam-zakeri - the problen happens with a local database?

@behnam-zakeri
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting info Needs more information from the issuer to continue backend.jdbc Interaction with ixmp_source via JDBCBackend & JPype discuss
Projects
None yet
Development

No branches or pull requests

3 participants