Flyway migration error

639 views
Skip to first unread message

Bill T

unread,
Oct 20, 2016, 3:32:25 PM10/20/16
to DSpace Technical Support
HI all!

I'm attempting to upgrade my 5.5 instance to 6.0rc4.  My postgres version is 9.5.1

A fresh install works fine, but installing over my current v5.5 database throws this error when I run database migrate:

Migrating database to latest version... (Check dspace logs for details)
Migration exception:
java.sql.SQLException: Flyway migration error occurred
        at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:666)
        at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:574)
        at org.dspace.storage.rdbms.DatabaseUtils.main(DatabaseUtils.java:222)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229)
        at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81)
Caused by: org.flywaydb.core.api.FlywayException: Validate failed: Detected applied migration not resolved locally: 5.0.2014.11.04
        at org.flywaydb.core.Flyway.doValidate(Flyway.java:1008)
        at org.flywaydb.core.Flyway.access$100(Flyway.java:72)
        at org.flywaydb.core.Flyway$1.execute(Flyway.java:921)
        at org.flywaydb.core.Flyway$1.execute(Flyway.java:917)
        at org.flywaydb.core.Flyway.execute(Flyway.java:1373)
        at org.flywaydb.core.Flyway.migrate(Flyway.java:917)
        at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:655)
        ... 8 more

This would seem to refer to:

...

| 5.0.2014.11.04 | Enable XMLWorkflow Migration                     | 2016-04-07 07:45:35 | Missing |
...
from database info

for what it's worth, running database info in v5.5 yields
...
| 5.0.2014.11.04 | Enable XMLWorkflow Migrati | 2016-04-07 07:45:35 | Success |
...

for the same patch.

Any ideas anybody?
Thanks,
Bill
Message has been deleted

Marion Weber

unread,
Oct 21, 2016, 11:05:33 AM10/21/16
to dspac...@googlegroups.com
Hi Bill,

Some days ago, I upgraded our 5.5 instance to 5.6 and I got a similar error message when I updated our index with index-discovery :
Flyway migration error occurred ..... Found differences between applied migrations and available migrations: Migration Checksum mismatch for migration"

After some Google searches, I read the advice to repair the database: dspace/bin/dspace database repair

I did so and after "index-discovery" and a tomcat restart, everything worked fine again.

I hope this is helpful for you?

Kind regards,
Marion


-----------------------------------
Marion Weber
Bibliotheks-IT
Universitäts- und Landesbibliothek Bonn
Postfach 2460, D-53014 Bonn
Tel. 0228 / 73 75 50 Fax: 0228 / 73 75 46
eMail: marion...@ulb.uni-bonn.de
Internet: http://www.ulb.uni-bonn.de
Twitter: http://twitter.com/ulbbonn
Facebook: http://facebook.com/ulbbonn
Am 20.10.2016 um 21:48 schrieb Bill T:
One more item worth noting:  I have not enabled configurable workflow, hence cwf_workflowitem does not exist in the database!
--
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To post to this group, send email to dspac...@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Bill T

unread,
Oct 21, 2016, 11:28:16 AM10/21/16
to DSpace Technical Support, marion...@ulb.uni-bonn.de
Marion,
 I did try that but id did not help!

Thanks anyway...
Bill

Bill T

unread,
Oct 25, 2016, 3:02:05 PM10/25/16
to DSpace Technical Support
For what it's worth, the problem continues for the release version of 6.0  

database info reports
| 5.0.2014.11.04 | Enable XMLWorkflow Migration| 2016-04-07 07:45:35 | Missing |

even though my production (v5.5) database info reports
| 5.0.2014.11.04 | Enable XMLWorkflow Migrati | 2016-04-07 07:45:35 | Success |

which result in a migration exception:

Migration exception:
java.sql.SQLException: Flyway migration error occurred
        at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:666)
        at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:574)
        at org.dspace.storage.rdbms.DatabaseUtils.main(DatabaseUtils.java:222)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229)
        at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81)
Caused by: org.flywaydb.core.api.FlywayException: Validate failed: Detected applied migration not resolved locally: 5.0.2014.11.04
        at org.flywaydb.core.Flyway.doValidate(Flyway.java:1008)
        at org.flywaydb.core.Flyway.access$100(Flyway.java:72)
        at org.flywaydb.core.Flyway$1.execute(Flyway.java:921)
        at org.flywaydb.core.Flyway$1.execute(Flyway.java:917)
        at org.flywaydb.core.Flyway.execute(Flyway.java:1373)
        at org.flywaydb.core.Flyway.migrate(Flyway.java:917)
        at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:655)
        ... 8 more

So I'm not even able to start version 6.0.

Again, any ideas?
Thanks,
Bill

On Thursday, October 20, 2016 at 2:32:25 PM UTC-5, Bill T wrote:

Tim Donohue

unread,
Oct 25, 2016, 3:28:32 PM10/25/16
to Bill T, DSpace Technical Support

Hi Bill,

Unfortunately, I don't have time today to dig in deeply on this.  But it *sounds* to me like you previously ran/enabled XMLWorkflow (in 5.5, as it reports SUCCESS).  However, after upgrading to 6.0, it sounds like you now have XMLWorkflow *disabled*, which is why it's reporting the Flyway Migration error, and saying that XMLWorkflow migration script is now missing ("not resolved locally").

My guess would be that everything would now succeed if you re-enable XMLWorkflow in 6.0. See the instructions at https://wiki.duraspace.org/display/DSDOC6x/Configurable+Workflow

So, long story short..if you've previously enabled XMLWorkflow, some extra migration scripts will automatically run (to change the structure of your database to support XMLWorkflow).  After that point, you should keep XMLWorkflow enabled (as noted in the documentation, via a warning, these database structure changes are not reversible).  If you disable it, Flyway may complain in this manner, as previously executed migrations now appear to be "missing" (at least to Flyway).

- Tim
--
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To post to this group, send email to dspac...@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

-- 
Tim Donohue
Technical Lead for DSpace & DSpaceDirect
DuraSpace.org | DSpace.org | DSpaceDirect.org

Bill T

unread,
Oct 26, 2016, 12:19:47 PM10/26/16
to DSpace Technical Support, wil...@gmail.com
Yes, I did and do have XMLWorkflow enabled in version 5x but...

NEWS FLASH!  There are a few more steps to enable it in 6.0!!  If I had bothered to read the documentation, I wouldn't have had to bother you!

All is well, and my db migration completed.

Thanks for pointing me in the right direction!
Bill
Reply all
Reply to author
Forward
0 new messages