Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-3571

Unable to upgrade DSpace 5 DB with XmlWorkflow enabled to DSpace 6 DB schema



    • Attachments:
    • Comments:
    • Documentation Status:
      Complete or Committed


      When upgrading a DSpace 5 instance that has XML Workflow enabled, the migration fails with the error message:

      /bin/dspace database migrate
      Database URL: jdbc:postgresql://localhost:5432/dspace
      Migrating database to latest version... (Check dspace logs for details)
      Caught exception:
      java.lang.RuntimeException: Error attempting to update Bitstream Format and/or Metadata Registries
      at org.dspace.storage.rdbms.DatabaseRegistryUpdater.updateRegistries(DatabaseRegistryUpdater.java:93)
      at org.dspace.storage.rdbms.DatabaseRegistryUpdater.afterMigrate(DatabaseRegistryUpdater.java:121)
      at org.flywaydb.core.internal.command.DbMigrate$3.doInTransaction(DbMigrate.java:250)
      at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72)

      However, when running bin/dspace database status I can see that all migration have succeeded or have been (safely) ignored.

      In addition, Tomcat refuses to start the XMLUI and OAI webapps. These webapps output the following error message in the logs:

      2017-04-13 14:31:35,951 INFO  org.hibernate.tool.hbm2ddl.SchemaValidator @ HHH000229: Running schema validator
      2017-04-13 14:31:36,048 INFO  org.hibernate.tool.hbm2ddl.TableMetadata @ HHH000261: Table found: public.tasklistitem
      2017-04-13 14:31:36,048 INFO  org.hibernate.tool.hbm2ddl.TableMetadata @ HHH000037: Columns: [workflow_id, eperson_id, tasklist_id]
      2017-04-13 14:31:36,049 FATAL org.dspace.core.Context @ Cannot obtain the bean which provides a database connection. Check previous entries in the dspace.log to find why the db failed to initialize.

      I have been debugging the start-up process and it appears this problem is related to the {[tasklistitem}} table. Since I have XML workflow enabled, this table has not been migrated due to the logic in this class: https://github.com/DSpace/DSpace/blob/dspace-6.0/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V6_0_2015_08_31__DS_2701_Hibernate_Workflow_Migration.java This means the following migration did not run: https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/workflow/postgres/basicWorkflow/V6.0_2015.08.11__DS-2701_Basic_Workflow_Migration.sql

      BUT the tasklistitem table is a default table in DSpace and thus always present (and empty in my case). This is a problem for Hibernate as it will validate the org.dspace.workflowbasic.TaskListItem and notice that the column types do not match (because the migration for basic workflow was not executed).




            • Assignee:
              tom.desair Tom Desair
            • Votes:
              0 Vote for this issue
              2 Start watching this issue


              • Created: