While upgrading DSpaceDirect customers from DSpace 5.6 to 5.7, we discovered that, during the database migration, database validation would fail with an error similar to:
Caused by: org.flywaydb.core.api.FlywayException: Validate failed. Found differences between applied migrations and available migrations: Migration Checksum mismatch for migration V5.0_2014.08.08__-
-_Helpdesk_Request_a_Copy.sql: DB=1316176070, Classpath=-872444192 DS-1945
After some debugging, we discovered that the line endings of the Flyway SQL migrations changed between the 5.6 and 5.7 releases in the dspace-api.jar file. This line-ending change caused the Flyway checksum validation to calculate a mismatch, per this bug in Flyway v3: https://github.com/flyway/flyway/issues/253
You can see this change in line endings by unzipping the 'dspace-api-5.6.jar' and 'dspace-api-5.7.jar' respectively and running a checksum on one (or more) SQL migrations. For example:
The md5sum results for this command are:
- DSpace 5.5 : a50877528391f8913a1f5036f2773686
- DSpace 5.6 : a50877528391f8913a1f5036f2773686 (same as 5.5)
- DSpace 5.7: 2af7f9c96814f7f6bee1e8cf708502bc
- DSpace 5.8: 2af7f9c96814f7f6bee1e8cf708502bc (same as 5.7)
The file line endings seem to have accidentally changed because 5.6 and 5.7 were released on different OSes (with 5.5 and 5.6 seemingly released on a Mac/Linux machine and 5.7 and 5.8 seemingly released on a Windows machine).
At this time, there are two known solutions / workarounds:
- Run dspace database repair to tell your database to simply accept the new checksum of the SQL file(s) that have new line endings. This is not harmful to your database in this scenario, since the SQL files are unaltered (except for the new line endings). However, please be aware that you will need to run "dspace database repair" again if the checksums change back in a future 5.x release.
- Or, upgrade all the way to DSpace 6.x. DSpace 6 uses Flyway v4, which has fixed this checksum calculation bug in Flyway.
As of DSpace 6, this issue no longer occur, as we have upgraded to Flyway 4 which fixes this line-ending checksum mismatch issue (see