java.sql.SQLException: Flyway migration error occurred

Sakai JIRA | Gerrit Hübbers | 7 months ago
  1. 0

    I am writing unit tests for a customized DSpace distribution. I have noticed that many unit tests fail once I activate the XMLWorkflow in file {{workflow.cfg}} with property {{workflow.framework=xmlworkflow}}: {code} 2016-05-18 15:05:12,710 INFO org.dspace.storage.rdbms.DatabaseManager @ DBMS is 'H2' 2016-05-18 15:05:12,710 INFO org.dspace.storage.rdbms.DatabaseManager @ DBMS driver version is '1.4.180 (2014-07-13)' 2016-05-18 15:05:12,740 INFO org.dspace.storage.rdbms.DatabaseUtils @ Loading Flyway DB migrations from: classpath:org.dspace.storage.rdbms.sqlmigration.h2, classpath:org.dspace.storage.rdbms.migration, classpath:org.dspace.storage.rdbms.xmlworkflow 2016-05-18 15:05:12,791 INFO org.flywaydb.core.internal.dbsupport.DbSupportFactory @ Database: jdbc:h2:mem:test (H2 1.4) 2016-05-18 15:05:12,891 INFO org.flywaydb.core.internal.metadatatable.MetaDataTableImpl @ Creating Metadata table: "PUBLIC"."schema_version" 2016-05-18 15:05:12,980 INFO org.flywaydb.core.internal.command.DbInit @ Schema initialized with version: 1 2016-05-18 15:05:13,157 INFO org.dspace.storage.rdbms.DatabaseUtils @ Pending DSpace database schema migrations: 2016-05-18 15:05:13,157 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.2 Initial DSpace 1.2 Oracle database schema SQL PENDING 2016-05-18 15:05:13,157 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.3 Upgrade to DSpace 1.3 schema SQL PENDING 2016-05-18 15:05:13,158 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.3.9 Drop constraint for DSpace 1 4 schema JDBC PENDING 2016-05-18 15:05:13,158 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.4 Upgrade to DSpace 1.4 schema SQL PENDING 2016-05-18 15:05:13,158 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.4.2 Upgrade to DSpace 1.4.2 schema SQL PENDING 2016-05-18 15:05:13,158 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.5 Upgrade to DSpace 1.5 schema SQL PENDING 2016-05-18 15:05:13,158 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.5.9 Drop constraint for DSpace 1 6 schema JDBC PENDING 2016-05-18 15:05:13,159 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.6 Upgrade to DSpace 1.6 schema SQL PENDING 2016-05-18 15:05:13,159 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.7 Upgrade to DSpace 1.7 schema SQL PENDING 2016-05-18 15:05:13,160 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.8 Upgrade to DSpace 1.8 schema SQL PENDING 2016-05-18 15:05:13,161 INFO org.dspace.storage.rdbms.DatabaseUtils @ 3.0 Upgrade to DSpace 3.x schema SQL PENDING 2016-05-18 15:05:13,162 INFO org.dspace.storage.rdbms.DatabaseUtils @ 4.0 Upgrade to DSpace 4.x schema SQL PENDING 2016-05-18 15:05:13,163 INFO org.dspace.storage.rdbms.DatabaseUtils @ 5.0.2014.08.08 DS-1945 Helpdesk Request a Copy SQL PENDING 2016-05-18 15:05:13,163 INFO org.dspace.storage.rdbms.DatabaseUtils @ 5.0.2014.09.25 DS 1582 Metadata For All Objects drop constraint JDBC PENDING 2016-05-18 15:05:13,163 INFO org.dspace.storage.rdbms.DatabaseUtils @ 5.0.2014.09.26 DS-1582 Metadata For All Objects SQL PENDING 2016-05-18 15:05:13,163 INFO org.dspace.storage.rdbms.DatabaseUtils @ 5.0.2014.11.04 Enable XMLWorkflow Migration JDBC PENDING 2016-05-18 15:05:13,234 INFO org.flywaydb.core.internal.command.DbValidate @ Validated 17 migrations (execution time 00:00.061s) 2016-05-18 15:05:13,310 INFO org.flywaydb.core.internal.command.DbMigrate @ Current version of schema "PUBLIC": 1 2016-05-18 15:05:13,310 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.2 2016-05-18 15:05:13,723 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.3 2016-05-18 15:05:14,054 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.3.9 2016-05-18 15:05:14,119 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.4 2016-05-18 15:05:14,273 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.4.2 2016-05-18 15:05:14,390 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.5 2016-05-18 15:05:14,578 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.5.9 2016-05-18 15:05:14,636 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.6 2016-05-18 15:05:14,887 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.7 2016-05-18 15:05:14,920 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.8 2016-05-18 15:05:14,958 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 3.0 2016-05-18 15:05:15,050 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 4.0 2016-05-18 15:05:15,086 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 5.0.2014.08.08 2016-05-18 15:05:15,105 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 5.0.2014.09.25 2016-05-18 15:05:15,127 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 5.0.2014.09.26 2016-05-18 15:05:15,509 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 5.0.2014.11.04 2016-05-18 15:05:15,514 ERROR org.flywaydb.core.internal.command.DbMigrate @ Migration of schema "PUBLIC" to version 5.0.2014.11.04 failed! Please restore backups and roll back database and code! 2016-05-18 15:05:15,518 ERROR org.dspace.storage.rdbms.DatabaseManager @ SQL getDataSource Error - java.sql.SQLException: Flyway migration error occurred at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:430) at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:338) at org.dspace.storage.rdbms.DatabaseManager.initialize(DatabaseManager.java:1373) at org.dspace.storage.rdbms.DatabaseManager.getDataSource(DatabaseManager.java:650) at org.dspace.storage.rdbms.DatabaseManager.getConnection(DatabaseManager.java:629) at org.dspace.core.Context.init(Context.java:121) at org.dspace.core.Context.<init>(Context.java:95) at org.dspace.AbstractUnitTest.init(AbstractUnitTest.java:139) 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:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103) Caused by: org.flywaydb.core.api.FlywayException: Migration failed ! at org.flywaydb.core.internal.resolver.jdbc.JdbcMigrationExecutor.execute(JdbcMigrationExecutor.java:47) at org.flywaydb.core.internal.command.DbMigrate$5.doInTransaction(DbMigrate.java:287) at org.flywaydb.core.internal.command.DbMigrate$5.doInTransaction(DbMigrate.java:285) at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72) at org.flywaydb.core.internal.command.DbMigrate.applyMigration(DbMigrate.java:285) at org.flywaydb.core.internal.command.DbMigrate.access$800(DbMigrate.java:46) at org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:207) at org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:156) at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72) at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:156) at org.flywaydb.core.Flyway$1.execute(Flyway.java:864) at org.flywaydb.core.Flyway$1.execute(Flyway.java:811) at org.flywaydb.core.Flyway.execute(Flyway.java:1171) at org.flywaydb.core.Flyway.migrate(Flyway.java:811) at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:419) ... 33 more Caused by: org.flywaydb.core.api.FlywayException: Unable to obtain inputstream for resource: org/dspace/storage/rdbms/xmlworkflow/h2/xml_workflow_migration.sql at org.flywaydb.core.internal.util.scanner.classpath.ClassPathResource.loadAsString(ClassPathResource.java:83) at org.dspace.storage.rdbms.xmlworkflow.V5_0_2014_11_04__Enable_XMLWorkflow_Migration.migrate(V5_0_2014_11_04__Enable_XMLWorkflow_Migration.java:70) at org.flywaydb.core.internal.resolver.jdbc.JdbcMigrationExecutor.execute(JdbcMigrationExecutor.java:45) ... 47 more {code} So the reason is there does not exist a file {{h2/xml_workflow_migration.sql}}, taking care of setting up H2 database tables for any XMLWorkflow-specific database migrations. Probably, a file {{h2/data_workflow_migration.sql}} also will be required. There do exist files {{postgres/xml_workflow_migration.sql}} and {{oracle/xml_workflow_migration.sql}}. Is there a way to automatically generate {{xml_workflow_migration.sql}} for H2 and add it to DSpace's source code repository?

    Sakai JIRA | 7 months ago | Gerrit Hübbers
    java.sql.SQLException: Flyway migration error occurred
  2. 0

    I am writing unit tests for a customized DSpace distribution. I have noticed that many unit tests fail once I activate the XMLWorkflow in file {{workflow.cfg}} with property {{workflow.framework=xmlworkflow}}: {code} 2016-05-18 15:05:12,710 INFO org.dspace.storage.rdbms.DatabaseManager @ DBMS is 'H2' 2016-05-18 15:05:12,710 INFO org.dspace.storage.rdbms.DatabaseManager @ DBMS driver version is '1.4.180 (2014-07-13)' 2016-05-18 15:05:12,740 INFO org.dspace.storage.rdbms.DatabaseUtils @ Loading Flyway DB migrations from: classpath:org.dspace.storage.rdbms.sqlmigration.h2, classpath:org.dspace.storage.rdbms.migration, classpath:org.dspace.storage.rdbms.xmlworkflow 2016-05-18 15:05:12,791 INFO org.flywaydb.core.internal.dbsupport.DbSupportFactory @ Database: jdbc:h2:mem:test (H2 1.4) 2016-05-18 15:05:12,891 INFO org.flywaydb.core.internal.metadatatable.MetaDataTableImpl @ Creating Metadata table: "PUBLIC"."schema_version" 2016-05-18 15:05:12,980 INFO org.flywaydb.core.internal.command.DbInit @ Schema initialized with version: 1 2016-05-18 15:05:13,157 INFO org.dspace.storage.rdbms.DatabaseUtils @ Pending DSpace database schema migrations: 2016-05-18 15:05:13,157 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.2 Initial DSpace 1.2 Oracle database schema SQL PENDING 2016-05-18 15:05:13,157 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.3 Upgrade to DSpace 1.3 schema SQL PENDING 2016-05-18 15:05:13,158 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.3.9 Drop constraint for DSpace 1 4 schema JDBC PENDING 2016-05-18 15:05:13,158 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.4 Upgrade to DSpace 1.4 schema SQL PENDING 2016-05-18 15:05:13,158 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.4.2 Upgrade to DSpace 1.4.2 schema SQL PENDING 2016-05-18 15:05:13,158 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.5 Upgrade to DSpace 1.5 schema SQL PENDING 2016-05-18 15:05:13,158 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.5.9 Drop constraint for DSpace 1 6 schema JDBC PENDING 2016-05-18 15:05:13,159 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.6 Upgrade to DSpace 1.6 schema SQL PENDING 2016-05-18 15:05:13,159 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.7 Upgrade to DSpace 1.7 schema SQL PENDING 2016-05-18 15:05:13,160 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.8 Upgrade to DSpace 1.8 schema SQL PENDING 2016-05-18 15:05:13,161 INFO org.dspace.storage.rdbms.DatabaseUtils @ 3.0 Upgrade to DSpace 3.x schema SQL PENDING 2016-05-18 15:05:13,162 INFO org.dspace.storage.rdbms.DatabaseUtils @ 4.0 Upgrade to DSpace 4.x schema SQL PENDING 2016-05-18 15:05:13,163 INFO org.dspace.storage.rdbms.DatabaseUtils @ 5.0.2014.08.08 DS-1945 Helpdesk Request a Copy SQL PENDING 2016-05-18 15:05:13,163 INFO org.dspace.storage.rdbms.DatabaseUtils @ 5.0.2014.09.25 DS 1582 Metadata For All Objects drop constraint JDBC PENDING 2016-05-18 15:05:13,163 INFO org.dspace.storage.rdbms.DatabaseUtils @ 5.0.2014.09.26 DS-1582 Metadata For All Objects SQL PENDING 2016-05-18 15:05:13,163 INFO org.dspace.storage.rdbms.DatabaseUtils @ 5.0.2014.11.04 Enable XMLWorkflow Migration JDBC PENDING 2016-05-18 15:05:13,234 INFO org.flywaydb.core.internal.command.DbValidate @ Validated 17 migrations (execution time 00:00.061s) 2016-05-18 15:05:13,310 INFO org.flywaydb.core.internal.command.DbMigrate @ Current version of schema "PUBLIC": 1 2016-05-18 15:05:13,310 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.2 2016-05-18 15:05:13,723 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.3 2016-05-18 15:05:14,054 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.3.9 2016-05-18 15:05:14,119 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.4 2016-05-18 15:05:14,273 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.4.2 2016-05-18 15:05:14,390 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.5 2016-05-18 15:05:14,578 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.5.9 2016-05-18 15:05:14,636 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.6 2016-05-18 15:05:14,887 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.7 2016-05-18 15:05:14,920 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.8 2016-05-18 15:05:14,958 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 3.0 2016-05-18 15:05:15,050 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 4.0 2016-05-18 15:05:15,086 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 5.0.2014.08.08 2016-05-18 15:05:15,105 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 5.0.2014.09.25 2016-05-18 15:05:15,127 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 5.0.2014.09.26 2016-05-18 15:05:15,509 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 5.0.2014.11.04 2016-05-18 15:05:15,514 ERROR org.flywaydb.core.internal.command.DbMigrate @ Migration of schema "PUBLIC" to version 5.0.2014.11.04 failed! Please restore backups and roll back database and code! 2016-05-18 15:05:15,518 ERROR org.dspace.storage.rdbms.DatabaseManager @ SQL getDataSource Error - java.sql.SQLException: Flyway migration error occurred at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:430) at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:338) at org.dspace.storage.rdbms.DatabaseManager.initialize(DatabaseManager.java:1373) at org.dspace.storage.rdbms.DatabaseManager.getDataSource(DatabaseManager.java:650) at org.dspace.storage.rdbms.DatabaseManager.getConnection(DatabaseManager.java:629) at org.dspace.core.Context.init(Context.java:121) at org.dspace.core.Context.<init>(Context.java:95) at org.dspace.AbstractUnitTest.init(AbstractUnitTest.java:139) 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:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103) Caused by: org.flywaydb.core.api.FlywayException: Migration failed ! at org.flywaydb.core.internal.resolver.jdbc.JdbcMigrationExecutor.execute(JdbcMigrationExecutor.java:47) at org.flywaydb.core.internal.command.DbMigrate$5.doInTransaction(DbMigrate.java:287) at org.flywaydb.core.internal.command.DbMigrate$5.doInTransaction(DbMigrate.java:285) at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72) at org.flywaydb.core.internal.command.DbMigrate.applyMigration(DbMigrate.java:285) at org.flywaydb.core.internal.command.DbMigrate.access$800(DbMigrate.java:46) at org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:207) at org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:156) at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72) at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:156) at org.flywaydb.core.Flyway$1.execute(Flyway.java:864) at org.flywaydb.core.Flyway$1.execute(Flyway.java:811) at org.flywaydb.core.Flyway.execute(Flyway.java:1171) at org.flywaydb.core.Flyway.migrate(Flyway.java:811) at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:419) ... 33 more Caused by: org.flywaydb.core.api.FlywayException: Unable to obtain inputstream for resource: org/dspace/storage/rdbms/xmlworkflow/h2/xml_workflow_migration.sql at org.flywaydb.core.internal.util.scanner.classpath.ClassPathResource.loadAsString(ClassPathResource.java:83) at org.dspace.storage.rdbms.xmlworkflow.V5_0_2014_11_04__Enable_XMLWorkflow_Migration.migrate(V5_0_2014_11_04__Enable_XMLWorkflow_Migration.java:70) at org.flywaydb.core.internal.resolver.jdbc.JdbcMigrationExecutor.execute(JdbcMigrationExecutor.java:45) ... 47 more {code} So the reason is there does not exist a file {{h2/xml_workflow_migration.sql}}, taking care of setting up H2 database tables for any XMLWorkflow-specific database migrations. Probably, a file {{h2/data_workflow_migration.sql}} also will be required. There do exist files {{postgres/xml_workflow_migration.sql}} and {{oracle/xml_workflow_migration.sql}}. Is there a way to automatically generate {{xml_workflow_migration.sql}} for H2 and add it to DSpace's source code repository?

    Sakai JIRA | 7 months ago | Gerrit Hübbers
    java.sql.SQLException: Flyway migration error occurred
  3. 0

    Could not create socket factory 'com.google.cloud.sql.mysql.SocketFactory;'

    Stack Overflow | 6 months ago | displayname
    org.flywaydb.core.api.FlywayException: Unable to obtain Jdbc connection from DataSource
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Play 2.4 RC3 testing fails due to Wrong user name or password

    GitHub | 2 years ago | schmitch
    org.flywaydb.core.api.FlywayException: Unable to obtain Jdbc connection from DataSource (jdbc:h2:mem:play-test-404376192;MODE=PostgreSQL;DB_CLOSE_DELAY=-1) for user 'null': Falscher Benutzer Name oder Passwort Wrong user name or password [28000-187]
  6. 0

    I refreshed my DSpace 6 database with the contents of a DSpace 5 database in order to test the DSpace 6 upgrade process. 1. The migration launched by ant fails 2. I confirmed the error by running "dspace database info" 3. "dspace database migrate" fails 4. I ran "dpsace database repair" 5. I ran "dspace database migrate" successfully This behavior could be very distressing to institutions running the upgrade process. *1.Migration launched by ANT* [java] 2016-06-08 10:58:34,451 INFO org.dspace.storage.rdbms.DatabaseUtils @ Loading Flyway DB migrations from: filesystem:/opt/dspace/etc/postgres, classpath:org.dspace.storage.rdbms.sqlmigration.postgres, classpath:org.dspace.storage.rdbms.migration [java] [java] Database URL: jdbc:postgresql://localhost:5432/dspace [java] Migrating database to latest version... (Check dspace logs for details) [java] 2016-06-08 10:58:34,486 INFO org.flywaydb.core.internal.util.VersionPrinter @ Flyway 3.2.1 by Boxfuse [java] 2016-06-08 10:58:34,514 INFO org.flywaydb.core.internal.dbsupport.DbSupportFactory @ Database: jdbc:postgresql://localhost:5432/dspace (PostgreSQL 9.4) [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ Pending DSpace database schema migrations: [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 4.9.2015.10.26 DS-2818 registry update SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2015.03.06 DS 2701 Dso Uuid Migration JDBC PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2015.03.07 DS-2701 Hibernate migration SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2015.08.31 DS 2701 Hibernate Workflow Migration JDBC PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.01.03 DS-3024 SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.01.26 DS 2188 Remove DBMS Browse Tables JDBC PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.02.25 DS-3004-slow-searching-as-admin SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.04.01 DS-1955 Increase embargo reason SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.04.04 DS-3086-OAI-Performance-fix SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.04.14 DS-3125-fix-bundle-bitstream-delete-rights SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.05.10 DS-3168-fix-requestitem item id column SQL PENDING [java] 2016-06-08 10:58:34,725 INFO org.flywaydb.core.internal.command.DbValidate @ Validated 27 migrations (execution time 00:00.045s) [java] Migration exception: [java] java.sql.SQLException: Flyway migration error occurred [java] at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:570) [java] at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:478) [java] at org.dspace.storage.rdbms.DatabaseUtils.main(DatabaseUtils.java:260) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [java] at java.lang.reflect.Method.invoke(Method.java:606) [java] at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229) [java] at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81) [java] Caused by: org.flywaydb.core.api.FlywayException: Validate failed. Migration Checksum mismatch for migration 1.1 [java] -> Applied to database : 864087011 [java] -> Resolved locally : 1058944165 [java] at org.flywaydb.core.Flyway.doValidate(Flyway.java:1108) [java] at org.flywaydb.core.Flyway.access$300(Flyway.java:62) [java] at org.flywaydb.core.Flyway$1.execute(Flyway.java:1012) [java] at org.flywaydb.core.Flyway$1.execute(Flyway.java:1006) [java] at org.flywaydb.core.Flyway.execute(Flyway.java:1418) [java] at org.flywaydb.core.Flyway.migrate(Flyway.java:1006) [java] at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:559) [java] ... 8 more [java] 2016-06-08 10:58:34,727 INFO org.springframework.context.support.ClassPathXmlApplicationContext @ Closing org.springframework.context.support.ClassPathXmlApplicationContext@3822307d: startup date [Wed Jun 08 10:58:30 EDT 2016]; root of context hierarchy [java] 2016-06-08 10:58:34,734 INFO org.springframework.beans.factory.support.DefaultListableBeanFactory @ Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@12fd41e0: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.dspace.servicemanager.spring.DSpaceBeanPostProcessor#0,org.dspace.example.Example,org.dspace.app.sherpa.submit.SHERPASubmitConfigurationService,importService,PubmedImportService,PubmedMetadataFieldMapping,lookupID,org.dspace.app.requestitem.RequestItemAuthorExtractor,org.dspace.app.sherpa.SHERPAService,org.dspace.app.sherpa.submit.SHERPASubmitService,org.dspace.discovery.SearchService,org.dspace.identifier.service.IdentifierService,org.dspace.identifier.VersionedHandleIdentifierProvider,org.dspace.core.DBConnection,org.dspace.storage.rdbms.DatabaseRegistryUpdater#0,org.dspace.storage.rdbms.GroupServiceInitializer#0,org.dspace.storage.rdbms.PostgreSQLCryptoChecker#0,org.dspace.storage.rdbms.SiteServiceInitializer#0,org.dspace.core.LoggerServiceImpl#0,propertyPlaceholderConfigurer,dspaceConfigurationFactoryBean,org.dspace.services.CachingService,org.dspace.caching.ehcache.CacheManager,org.dspace.services.SessionService,org.dspace.services.EventService,org.dspace.services.email.EmailServiceImpl,dSpaceServicesFactory,org.dspace.app.itemmarking.ItemMarkingExtractor.type,org.dspace.app.itemmarking.ItemMarkingExtractor.availability,typeMap,collectionMap,rdfFactory,org.dspace.rdf.conversion.SimpleDSORelationsConverterPlugin,org.dspace.rdf.conversion.MetadataConverterPlugin,org.dspace.rdf.conversion.StaticDSOConverterPlugin,org.dspace.rdf.conversion.RDFConverter,org.dspace.rdf.storage.LocalURIGenerator,org.dspace.rdf.storage.HandleURIGenerator,org.dspace.rdf.storage.DOIURIGenerator,org.dspace.rdf.storage.DOIHandleURIGenerator,org.dspace.rdf.storage.RDFStorage,org.dspace.app.requestitem.dao.impl.RequestItemDAOImpl#0,org.dspace.app.util.dao.impl.WebAppDAOImpl#0,org.dspace.authorize.dao.impl.ResourcePolicyDAOImpl#0,org.dspace.checker.dao.impl.ChecksumHistoryDAOImpl#0,org.dspace.checker.dao.impl.ChecksumResultDAOImpl#0,org.dspace.checker.dao.impl.MostRecentChecksumDAOImpl#0,org.dspace.content.dao.impl.CollectionDAOImpl#0,org.dspace.content.dao.impl.BitstreamDAOImpl#0,org.dspace.content.dao.impl.BitstreamFormatDAOImpl#0,org.dspace.content.dao.impl.BundleDAOImpl#0,org.dspace.content.dao.impl.CommunityDAOImpl#0,org.dspace.content.dao.impl.ItemDAOImpl#0,org.dspace.content.dao.impl.MetadataFieldDAOImpl#0,org.dspace.content.dao.impl.MetadataSchemaDAOImpl#0,org.dspace.content.dao.impl.MetadataValueDAOImpl#0,org.dspace.content.dao.impl.SiteDAOImpl#0,org.dspace.content.dao.impl.WorkspaceItemDAOImpl#0,org.dspace.eperson.dao.impl.EPersonDAOImpl#0,org.dspace.eperson.dao.impl.Group2GroupCacheDAOImpl#0,org.dspace.eperson.dao.impl.GroupDAOImpl#0,org.dspace.eperson.dao.impl.RegistrationDataDAOImpl#0,org.dspace.eperson.dao.impl.SubscriptionDAOImpl#0,org.dspace.handle.dao.impl.HandleDAOImpl#0,org.dspace.harvest.dao.impl.HarvestedItemDAOImpl#0,org.dspace.harvest.dao.impl.HarvestedCollectionDAOImpl#0,org.dspace.identifier.dao.impl.DOIDAOImpl#0,org.dspace.versioning.dao.impl.VersionDAOImpl#0,org.dspace.versioning.dao.impl.VersionHistoryDAOImpl#0,org.dspace.workflowbasic.dao.impl.BasicWorkflowItemDAOImpl#0,org.dspace.workflowbasic.dao.impl.TaskListItemDAOImpl#0,org.dspace.xmlworkflow.storedcomponents.dao.impl.ClaimedTaskDAOImpl#0,org.dspace.xmlworkflow.storedcomponents.dao.impl.CollectionRoleDAOImpl#0,org.dspace.xmlworkflow.storedcomponents.dao.impl.InProgressUserDAOImpl#0,org.dspace.xmlworkflow.storedcomponents.dao.impl.PoolTaskDAOImpl#0,org.dspace.xmlworkflow.storedcomponents.dao.impl.WorkflowItemRoleDAOImpl#0,org.dspace.xmlworkflow.storedcomponents.dao.impl.XmlWorkflowItemDAOImpl#0,org.dspace.storage.bitstore.BitstreamStorageService,localStore,s3Store,sessionFactory,dataSource,dspaceDataSource,org.dspace.util.MultiFormatDateParser,claimactionAPI,reviewactionAPI,editactionAPI,finaleditactionAPI,singleuserreviewactionAPI,selectrevieweractionAPI,scorereviewactionAPI,evaluationactionAPI,autoassignactionAPI,noUserSelectionActionAPI,assignoriginalsubmitteractionAPI,reviewaction,editaction,finaleditaction,selectrevieweraction,singleuserreviewaction,scorereviewaction,evaluationaction,claimaction,autoassignAction,noUserSelectionAction,originalSubmitterAssignAction,org.dspace.authority.AuthoritySearchService,dspace.DSpaceAuthorityIndexer,AuthorityTypes,OrcidSource,pubmedMetadataFieldMap,pubmedLanguageContrib,dateContrib,pubmedContrib,titleContrib,abstractContrib,authorContrib,combinedauthorList,lastNameContrib,firstNameContrib,keywordContrib,yearContrib,monthContrib,dayContrib,languageContrib,dc.title,dc.description.abstract,dc.contributor.author,dc.date.issued,dc.language.iso,dc.subject,dc.identifier.other,prefixToNamespaceMapping,maxRetry,pubmedService,requestItemServiceFactory,itemExportServiceFactory,itemImportServiceFactory,mediaFilterServiceFactory,sfxServiceFactory,appUtilServiceFactory,authenticateServiceFactory,authorityServiceFactory,contentAuthorityServiceFactory,authorizeServiceFactory,checkerServiceFactory,contentServiceFactory,coreServiceFactory,curateServiceFactory,disseminateServiceFactory,embargoServiceFactory,ePersonServiceFactory,eventServiceFactory,handleServiceFactory,harvestServiceFactory,identifierServiceFactory,licenseServiceFactory,statisticsServiceFactory,storageServiceFactory,versionServiceFactory,workflowServiceFactory,org.dspace.versioning.service.VersioningService,solrServiceResourceIndexPlugin,SolrServiceSpellIndexingPlugin,solrServiceMetadataBrowseIndexingPlugin,hasContentInOriginalBundle,org.dspace.discovery.configuration.DiscoveryConfigurationService,defaultConfiguration,homepageConfiguration,homepageTagCloudFacetConfiguration,defaultTagCloudFacetConfiguration,tagCloudConfiguration,browseTagCloudConfiguration,searchFilterTitle,searchFilterAuthor,searchFilterSubject,searchFilterIssued,searchFilterContentInOriginalBundle,sortTitle,sortDateIssued,org.dspace.app.requestitem.RequestItemServiceImpl#0,org.dspace.app.itemexport.ItemExportServiceImpl#0,org.dspace.app.itemimport.ItemImportServiceImpl#0,org.dspace.app.mediafilter.MediaFilterServiceImpl#0,org.dspace.app.sfx.SFXFileReaderServiceImpl#0,org.dspace.app.util.MetadataExposureServiceImpl#0,org.dspace.app.util.OpenSearchServiceImpl#0,org.dspace.app.util.WebAppServiceImpl#0,org.dspace.authenticate.AuthenticationServiceImpl#0,org.dspace.authorize.AuthorizeServiceImpl#0,org.dspace.authorize.ResourcePolicyServiceImpl#0,org.dspace.authority.AuthorityValueServiceImpl#0,org.dspace.authority.AuthorityServiceImpl#0,org.dspace.checker.ChecksumHistoryServiceImpl#0,org.dspace.checker.ChecksumResultServiceImpl#0,org.dspace.checker.MostRecentChecksumServiceImpl#0,org.dspace.checker.SimpleReporterServiceImpl#0,org.dspace.content.CollectionServiceImpl#0,org.dspace.content.BitstreamFormatServiceImpl#0,org.dspace.content.BitstreamServiceImpl#0,org.dspace.content.BundleServiceImpl#0,org.dspace.content.CommunityServiceImpl#0,org.dspace.content.InstallItemServiceImpl#0,org.dspace.content.ItemServiceImpl#0,org.dspace.content.MetadataFieldServiceImpl#0,org.dspace.content.MetadataSchemaServiceImpl#0,org.dspace.content.MetadataValueServiceImpl#0,org.dspace.content.SiteServiceImpl#0,org.dspace.content.SupervisedItemServiceImpl#0,org.dspace.content.WorkspaceItemServiceImpl#0,org.dspace.content.authority.ChoiceAuthorityServiceImpl#0,org.dspace.content.authority.MetadataAuthorityServiceImpl#0,org.dspace.core.LegacyPluginServiceImpl#0,org.dspace.core.LicenseServiceImpl#0,org.dspace.core.NewsServiceImpl#0,org.dspace.curate.WorkflowCuratorServiceImpl#0,org.dspace.disseminate.CitationDocumentServiceImpl#0,org.dspace.embargo.EmbargoServiceImpl#0,org.dspace.eperson.AccountServiceImpl#0,org.dspace.eperson.EPersonServiceImpl#0,org.dspace.eperson.GroupServiceImpl#0,org.dspace.eperson.RegistrationDataServiceImpl#0,org.dspace.eperson.SubscribeServiceImpl#0,org.dspace.eperson.SupervisorServiceImpl#0,org.dspace.event.EventServiceImpl#0,org.dspace.handle.HandleServiceImpl#0,org.dspace.harvest.HarvestedCollectionServiceImpl#0,org.dspace.harvest.HarvestedItemServiceImpl#0,org.dspace.harvest.HarvestSchedulingServiceImpl#0,org.dspace.identifier.DOIServiceImpl#0,org.dspace.license.CreativeCommonsServiceImpl#0,elasticSearchLoggerService,solrLoggerService,org.dspace.versioning.VersionHistoryServiceImpl#0,org.dspace.workflowbasic.TaskListItemServiceImpl#0,org.dspace.workflowbasic.BasicWorkflowItemServiceImpl#0,org.dspace.workflowbasic.BasicWorkflowServiceImpl#0,org.dspace.app.itemimport.BTEBatchImportService,batchImportTransformationEngine,batchImportLinearWorkflow,org.dspace.submit.lookup.SubmissionLookupService,phase1TransformationEngine,multipleDataLoader,org.dspace.submit.lookup.SubmissionLookupOutputGenerator,phase1LinearWorkflow,mapConverter_arxivSubject,mapConverter_pubstatusPubmed,removeLastDot,phase2TransformationEngine,submissionItemDataLoader,phase2linearWorkflow,fieldMergeModifier,valueConcatenationModifier,languageCodeModifier,org.dspace.submit.lookup.DSpaceWorkspaceItemOutputGenerator,bibTeXDataLoader,csvDataLoader,tsvDataLoader,risDataLoader,endnoteDataLoader,oaipmhDataLoader,pubmedOnlineDataLoader,pubmedFileDataLoader,pubmedInputMap,arXivOnlineDataLoader,arXivFileDataLoader,arxivInputMap,crossRefOnlineDataLoader,crossRefFileDataLoader,crossrefInputMap,ciniiOnlineDataLoader,ciniiFileDataLoader,ciniiInputMap,outputMap,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy [java] 2016-06-08 10:58:34,755 INFO org.dspace.services.caching.CachingServiceImpl @ destroy() [java] 2016-06-08 10:58:34,756 INFO org.springframework.cache.ehcache.EhCacheManagerFactoryBean @ Shutting down EhCache CacheManager [java] 2016-06-08 10:58:34,756 INFO org.dspace.services.sessions.SessionRequestServiceImpl @ shutdown [java] 2016-06-08 10:58:34,757 WARN org.dspace.services.sessions.SessionRequestServiceImpl @ Request interceptor (org.dspace.services.events.SystemEventService$EventRequestInterceptor@5e31b483) failed to execute on end (request-192-1465397914139): null [java] 2016-06-08 10:58:34,778 INFO org.dspace.servicemanager.spring.SpringServiceManager @ Spring Service Manager Shutdown... [java] 2016-06-08 10:58:34,778 INFO org.dspace.servicemanager.DSpaceServiceManager @ Shutdown DSpace core service manager [java] 2016-06-08 10:58:34,778 INFO org.dspace.servicemanager.DSpaceKernelImpl @ DSpace kernel shutdown completed and unregistered MBean: org.dspace:name=4d54a5c6-70bc-4aab-8929-f6632b4c0458,type=DSpaceKernel BUILD FAILED /var/data/dspace_local_build/dspace6x-aux-prs/DSpace/dspace/target/dspace-installer/build.xml:802: Java returned: 1 ------------------------------------ *2. Confirm migration failure* [dspace@dspace-aux-1 dspace6x-aux-prs]$ /opt/dspace/bin/dspace database info Database Type: postgres Database URL: jdbc:postgresql://localhost:5432/dspace Database Schema: public Database Software: PostgreSQL version 9.4.8 Database Driver: PostgreSQL Native Driver version PostgreSQL 9.4 JDBC4.1 (build 1206) PostgreSQL 'pgcrypto' extension installed/up-to-date? true (version=1.1) +----------------+--------------------------------------------------+---------------------+---------+ | Version | Description | Installed on | State | +----------------+--------------------------------------------------+---------------------+---------+ | 1 | << Flyway Init >> | 2016-04-21 10:16:52 | Baselin | | 1.1 | Initial DSpace 1.1 database schema | 2016-04-21 10:16:52 | Success | | 1.2 | Upgrade to DSpace 1.2 schema | 2016-04-21 10:16:53 | Success | | 1.3 | Upgrade to DSpace 1.3 schema | 2016-04-21 10:16:53 | Success | | 1.3.9 | Drop constraint for DSpace 1 4 schema | 2016-04-21 10:16:53 | Success | | 1.4 | Upgrade to DSpace 1.4 schema | 2016-04-21 10:16:53 | Success | | 1.5 | Upgrade to DSpace 1.5 schema | 2016-04-21 10:16:54 | Success | | 1.5.9 | Drop constraint for DSpace 1 6 schema | 2016-04-21 10:16:54 | Success | | 1.6 | Upgrade to DSpace 1.6 schema | 2016-04-21 10:16:54 | Success | | 1.7 | Upgrade to DSpace 1.7 schema | 2016-04-21 10:16:54 | Success | | 1.8 | Upgrade to DSpace 1.8 schema | 2016-04-21 10:16:54 | Success | | 3.0 | Upgrade to DSpace 3.x schema | 2016-04-21 10:16:54 | Success | | 4.0 | Upgrade to DSpace 4.x schema | 2016-04-21 10:16:54 | Success | | 4.9.2015.10.26 | DS-2818 registry update | | Ignored | | 5.0.2014.08.08 | DS-1945 Helpdesk Request a Copy | 2016-04-21 10:16:54 | Success | | 5.0.2014.09.25 | DS 1582 Metadata For All Objects drop constraint | 2016-04-21 10:16:54 | Success | | 5.0.2014.09.26 | DS-1582 Metadata For All Objects | 2016-04-21 10:16:54 | Success | | 6.0.2015.03.06 | DS 2701 Dso Uuid Migration | | Pending | | 6.0.2015.03.07 | DS-2701 Hibernate migration | | Pending | | 6.0.2015.08.31 | DS 2701 Hibernate Workflow Migration | | Pending | | 6.0.2016.01.03 | DS-3024 | | Pending | | 6.0.2016.01.26 | DS 2188 Remove DBMS Browse Tables | | Pending | | 6.0.2016.02.25 | DS-3004-slow-searching-as-admin | | Pending | | 6.0.2016.04.01 | DS-1955 Increase embargo reason | | Pending | | 6.0.2016.04.04 | DS-3086-OAI-Performance-fix | | Pending | | 6.0.2016.04.14 | DS-3125-fix-bundle-bitstream-delete-rights | | Pending | | 6.0.2016.05.10 | DS-3168-fix-requestitem item id column | | Pending | +----------------+--------------------------------------------------+---------------------+---------+ *3. database migrate fails* [dspace@dspace-aux-1 dspace6x-aux-prs]$ /opt/dspace/bin/dspace database migrate Database URL: jdbc:postgresql://localhost:5432/dspace 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:570) at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:478) at org.dspace.storage.rdbms.DatabaseUtils.main(DatabaseUtils.java:260) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) 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. Migration Checksum mismatch for migration 1.1 -> Applied to database : 864087011 -> Resolved locally : 1058944165 at org.flywaydb.core.Flyway.doValidate(Flyway.java:1108) at org.flywaydb.core.Flyway.access$300(Flyway.java:62) at org.flywaydb.core.Flyway$1.execute(Flyway.java:1012) at org.flywaydb.core.Flyway$1.execute(Flyway.java:1006) at org.flywaydb.core.Flyway.execute(Flyway.java:1418) at org.flywaydb.core.Flyway.migrate(Flyway.java:1006) at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:559) ... 8 more *4. Run database repair* [dspace@dspace-aux-1 dspace6x-aux-prs]$ /opt/dspace/bin/dspace database repair Database URL: jdbc:postgresql://localhost:5432/dspace Attempting to repair any previously failed migrations (or mismatched checksums) via FlywayDB... (Check dspace logs for details) Done. ----------------------------------------------------------- *5. Run database migrate - successful* [dspace@dspace-aux-1 dspace6x-aux-prs]$ /opt/dspace/bin/dspace database migrate Database URL: jdbc:postgresql://localhost:5432/dspace Migrating database to latest version... (Check dspace logs for details) Done. [dspace@dspace-aux-1 dspace6x-aux-prs]$ /opt/dspace/bin/dspace database info Database Type: postgres Database URL: jdbc:postgresql://localhost:5432/dspace Database Schema: public Database Software: PostgreSQL version 9.4.8 Database Driver: PostgreSQL Native Driver version PostgreSQL 9.4 JDBC4.1 (build 1206) PostgreSQL 'pgcrypto' extension installed/up-to-date? true (version=1.1) +----------------+--------------------------------------------------+---------------------+---------+ | Version | Description | Installed on | State | +----------------+--------------------------------------------------+---------------------+---------+ | 1 | << Flyway Init >> | 2016-04-21 10:16:52 | Baselin | | 1.1 | Initial DSpace 1.1 database schema | 2016-04-21 10:16:52 | Success | | 1.2 | Upgrade to DSpace 1.2 schema | 2016-04-21 10:16:53 | Success | | 1.3 | Upgrade to DSpace 1.3 schema | 2016-04-21 10:16:53 | Success | | 1.3.9 | Drop constraint for DSpace 1 4 schema | 2016-04-21 10:16:53 | Success | | 1.4 | Upgrade to DSpace 1.4 schema | 2016-04-21 10:16:53 | Success | | 1.5 | Upgrade to DSpace 1.5 schema | 2016-04-21 10:16:54 | Success | | 1.5.9 | Drop constraint for DSpace 1 6 schema | 2016-04-21 10:16:54 | Success | | 1.6 | Upgrade to DSpace 1.6 schema | 2016-04-21 10:16:54 | Success | | 1.7 | Upgrade to DSpace 1.7 schema | 2016-04-21 10:16:54 | Success | | 1.8 | Upgrade to DSpace 1.8 schema | 2016-04-21 10:16:54 | Success | | 3.0 | Upgrade to DSpace 3.x schema | 2016-04-21 10:16:54 | Success | | 4.0 | Upgrade to DSpace 4.x schema | 2016-04-21 10:16:54 | Success | | 4.9.2015.10.26 | DS-2818 registry update | 2016-06-08 11:02:39 | OutOrdr | | 5.0.2014.08.08 | DS-1945 Helpdesk Request a Copy | 2016-04-21 10:16:54 | OutOrdr | | 5.0.2014.09.25 | DS 1582 Metadata For All Objects drop constraint | 2016-04-21 10:16:54 | OutOrdr | | 5.0.2014.09.26 | DS-1582 Metadata For All Objects | 2016-04-21 10:16:54 | OutOrdr | | 6.0.2015.03.06 | DS 2701 Dso Uuid Migration | 2016-06-08 11:02:39 | Success | | 6.0.2015.03.07 | DS-2701 Hibernate migration | 2016-06-08 11:02:39 | Success | | 6.0.2015.08.31 | DS 2701 Hibernate Workflow Migration | 2016-06-08 11:02:46 | Success | | 6.0.2016.01.03 | DS-3024 | 2016-06-08 11:02:46 | Success | | 6.0.2016.01.26 | DS 2188 Remove DBMS Browse Tables | 2016-06-08 11:02:46 | Success | | 6.0.2016.02.25 | DS-3004-slow-searching-as-admin | 2016-06-08 11:02:46 | Success | | 6.0.2016.04.01 | DS-1955 Increase embargo reason | 2016-06-08 11:02:46 | Success | | 6.0.2016.04.04 | DS-3086-OAI-Performance-fix | 2016-06-08 11:02:46 | Success | | 6.0.2016.04.14 | DS-3125-fix-bundle-bitstream-delete-rights | 2016-06-08 11:02:46 | Success | | 6.0.2016.05.10 | DS-3168-fix-requestitem item id column | 2016-06-08 11:02:46 | Success | +----------------+--------------------------------------------------+---------------------+---------+

    Sakai JIRA | 6 months ago | Terry Brady
    java.sql.SQLException: Flyway migration error occurred

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.flywaydb.core.api.FlywayException

      Unable to obtain inputstream for resource: org/dspace/storage/rdbms/xmlworkflow/h2/xml_workflow_migration.sql

      at org.flywaydb.core.internal.util.scanner.classpath.ClassPathResource.loadAsString()
    2. ${project.artifactId}
      ClassPathResource.loadAsString
      1. org.flywaydb.core.internal.util.scanner.classpath.ClassPathResource.loadAsString(ClassPathResource.java:83)
      1 frame
    3. DSpace Kernel :: API and Implementation
      V5_0_2014_11_04__Enable_XMLWorkflow_Migration.migrate
      1. org.dspace.storage.rdbms.xmlworkflow.V5_0_2014_11_04__Enable_XMLWorkflow_Migration.migrate(V5_0_2014_11_04__Enable_XMLWorkflow_Migration.java:70)
      1 frame
    4. ${project.artifactId}
      Flyway.migrate
      1. org.flywaydb.core.internal.resolver.jdbc.JdbcMigrationExecutor.execute(JdbcMigrationExecutor.java:45)
      2. org.flywaydb.core.internal.command.DbMigrate$5.doInTransaction(DbMigrate.java:287)
      3. org.flywaydb.core.internal.command.DbMigrate$5.doInTransaction(DbMigrate.java:285)
      4. org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72)
      5. org.flywaydb.core.internal.command.DbMigrate.applyMigration(DbMigrate.java:285)
      6. org.flywaydb.core.internal.command.DbMigrate.access$800(DbMigrate.java:46)
      7. org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:207)
      8. org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:156)
      9. org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72)
      10. org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:156)
      11. org.flywaydb.core.Flyway$1.execute(Flyway.java:864)
      12. org.flywaydb.core.Flyway$1.execute(Flyway.java:811)
      13. org.flywaydb.core.Flyway.execute(Flyway.java:1171)
      14. org.flywaydb.core.Flyway.migrate(Flyway.java:811)
      14 frames
    5. DSpace Kernel :: API and Implementation
      Context.<init>
      1. org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:419)
      2. org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:338)
      3. org.dspace.storage.rdbms.DatabaseManager.initialize(DatabaseManager.java:1373)
      4. org.dspace.storage.rdbms.DatabaseManager.getDataSource(DatabaseManager.java:650)
      5. org.dspace.storage.rdbms.DatabaseManager.getConnection(DatabaseManager.java:629)
      6. org.dspace.core.Context.init(Context.java:121)
      7. org.dspace.core.Context.<init>(Context.java:95)
      7 frames
    6. org.dspace
      AbstractUnitTest.init
      1. org.dspace.AbstractUnitTest.init(AbstractUnitTest.java:139)
      1 frame
    7. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:497)
      4 frames
    8. JUnit
      ParentRunner.run
      1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      4. org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
      5. org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      6. org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      7. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      8. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      9. org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      10. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      11. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      12. org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      13. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      14. org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      15. org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      16. org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      16 frames
    9. JUnit4 Provider
      JUnit4Provider.invoke
      1. org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
      2. org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
      3. org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
      3 frames
    10. SureFire
      ForkedBooter.main
      1. org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
      2. org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
      3. org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
      3 frames