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

failure in a V6.0 migration script

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 6.0
    • Fix Version/s: 6.0
    • Component/s: None
    • Labels:
    • Attachments:
      0
    • Comments:
      2
    • Documentation Status:
      Not Required

      Description

      When deploying 6.0rc3 on an existing 5.x schema database, I get

      ...
      java.sql.SQLException: Flyway migration error occurred
      ...
      Caused by: org.flywaydb.core.internal.dbsupport.FlywaySqlScriptException:
      Migration V6.0_2016.07.21__DS-2775.sql failed
      ---------------------------------------------
      SQL State : 42P01
      Error Code : 0
      Message : ERROR: sequence "historystate_seq" does not exist
      Location : org/dspace/storage/rdbms/sqlmigration/postgres/V6.0_2016.07.21__DS-2775.sql (/home/tomcat8/file:/dspace6/lib/dspace-api-6.0-rc4-SNAPSHOT.jar!/org/dspace/storage/rdbms/sqlmigration/postgres/V6.0_2016.07.21__DS-2775.sql)
      Line : 28
      Statement : DROP SEQUENCE historystate_seq
      ...

      /dspace/bin/dspace database info
      ...

      5.0.2014.09.26 DS-1582 Metadata For All Objects 2015-11-09 15:50:45 Success
      6.0.2015.03.06 DS 2701 Dso Uuid Migration 2016-09-13 14:20:18 Success
      6.0.2015.03.07 DS-2701 Hibernate migration 2016-09-13 14:20:18 Success
      6.0.2015.08.31 DS 2701 Hibernate Workflow Migration 2016-09-13 14:21:00 Success
      6.0.2016.01.03 DS-3024 2016-09-13 14:21:00 Success
      6.0.2016.01.26 DS 2188 Remove DBMS Browse Tables 2016-09-13 14:21:00 Success
      6.0.2016.02.25 DS-3004-slow-searching-as-admin 2016-09-13 14:21:00 Success
      6.0.2016.04.01 DS-1955 Increase embargo reason 2016-09-13 14:21:00 Success
      6.0.2016.04.04 DS-3086-OAI-Performance-fix 2016-09-13 14:21:00 Success
      6.0.2016.04.14 DS-3125-fix-bundle-bitstream-delete-rights 2016-09-13 14:21:01 Success
      6.0.2016.05.10 DS-3168-fix-requestitem item id column 2016-09-13 14:21:01 Success
      6.0.2016.07.21 DS-2775   Pending
      6.0.2016.07.26 DS-3277 fix handle assignment   Pending
      6.0.2016.08.23 DS-3097   Pending

      ------------------------------------------------------------------------------------------+

      ~/src/dspace/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres$ grep 'historystate_seq' *.sql
      V1.1__Initial_DSpace_1.1_database_schema.sql:CREATE SEQUENCE historystate_seq;
      V6.0_2016.07.21__DS-2775.sql:DROP SEQUENCE historystate_seq;

      Indeed, the historystate_seq sequence doesn't exist in my 5.x format database, or even older ones.

      The failure is caused by a migration added in DS-2775. The fix is to make the DROP SEQUENCE statement conditional:
      DROP SEQUENCE IF EXISTS historystate_seq;

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                helix84 Ivan Masár
                Reporter:
                helix84 Ivan Masár
                Reviewer:
                Pascal-Nicolas Becker
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: