Uploaded image for project: 'Fedora Repository Project'
  1. Fedora Repository Project
  2. FCREPO-3355

Fedora fails to start when the root object is index but does not exist

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Received
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: Fedora 6.0.0
    • Fix Version/s: None
    • Component/s: f4-core
    • Labels:
      None

      Description

      Demian Katz reported in Slack that they were getting errors when attempting to start F6 on top of migrated F3 objects.

      org.springframework.dao.DuplicateKeyException: PreparedStatementCallback; SQL [INSERT INTO ocfl_id_map (fedora_id, fedora_root_id, ocfl_id) VALUES (?, ?, ?)]; Unique index or primary key violation: "PUBLIC.PRIMARY_KEY_6 ON PUBLIC.OCFL_ID_MAP(FEDORA_ID) VALUES 1"; SQL statement:
      INSERT INTO ocfl_id_map (fedora_id, fedora_root_id, ocfl_id) VALUES (?, ?, ?) [23505-200]; nested exception is org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: Unique index or primary key violation: "PUBLIC.PRIMARY_KEY_6 ON PUBLIC.OCFL_ID_MAP(FEDORA_ID) VALUES 1"; SQL statement:
      INSERT INTO ocfl_id_map (fedora_id, fedora_root_id, ocfl_id) VALUES (?, ?, ?) [23505-200]

      This exception is caused by attempting to insert duplicate Fedora IDs into the OCFL index table.

      Demian had initially started F6 on an empty repository before restarting it on their migrated objects, which is when the error occurred. After they removed their H2 file, they were able to start F6 ontop of the F3 objects as expected.

      The root cause of the issue is that when F6 was first started on the empty repository, it created the Fedora root object. Then, when it was started a second time, it did not attempt to reindex because the reindex conditions were not met (OCFL objects existed and the Fedora root object was in the index). However, the init code then attempted to retrieve the root object, which was indexed, but was unable to because the object was never created in the migrated OCFL repository. So, the init code attempted to create a new root object, which result in the above exception because the root object was already in the index.

      One possible solution to this problem, is to expand the criteria for reindexing to include the OCFL repository not containing the Fedora root object. However, in order to do this, the Fedora root object must be assigned a static OCFL id.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            pwinckles Peter Winckles
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support