LINBIT / linstor-server

High Performance Software-Defined Block Storage for container, cloud and virtualisation. Fully integrated with Docker, Kubernetes, Openstack, Proxmox etc.
https://docs.linbit.com/docs/linstor-guide/
GNU General Public License v3.0
984 stars 76 forks source link

Database update 1.20.0 to 1.20.1 fails #332

Closed dani closed 1 year ago

dani commented 1 year ago

Running Linstor 1.20.0 in a HA setup (3 nodes), using the H2 database (with DRBD reactor, as explained in the doc). I try to upgrade linstor controler, but the database migration fails

Category:                           RuntimeException
Class name:                         FlywayMigrateException
Class canonical name:               org.flywaydb.core.internal.command.DbMigrate.FlywayMigrateException
Generated at:                       Method 'doMigrateGroup', Source file 'DbMigrate.java', Line #372

Error message:                      SQL State  : 42S22
Error Code : 42122
Message    : Colonne "RESOURCE_NAME" non trouvée
Column "RESOURCE_NAME" not found [42122-197]

Once the first migration failed, next ones also fails, with a different error :

Category:                           RuntimeException
Class name:                         FlywayException
Class canonical name:               org.flywaydb.core.api.FlywayException
Generated at:                       Method 'doValidate', Source file 'Flyway.java', Line #292

Error message:                      Validate failed: 
Detected failed migration to version 2022.11.14.09.00 (Cleanup orphaned Objects)

Full error reports attached : ErrorReport-6399E460-00000-000000.log ErrorReport-6399E489-00000-000000.log

Environment is AlmaLinux 8.7, with 1.20.0 RPM built from sources. To handle the update I upgrade the RPM on all 3 nodes, then shutdown the linstor-controller service on the currently active node, so drbd-reactor starts it on another (and this is where the DB migration fails). Could reproduce this 2 times

ghernadi commented 1 year ago

Thank you for the report, we already fixed this issue, 1.20.2 should be available by the end of the day. You will have to use the 1.20.0 database to upgrade to 1.20.2 in order to avoid this issue.

dani commented 1 year ago

I can confirm this problem is solved in 1.20.2. Thanks !