8000 OpenClinica-3.13 upgrade issue with the duplicates in the table event_crf · Issue #3568 · OpenClinica/OpenClinica · GitHub
[go: up one dir, main page]

Skip to content
8000

OpenClinica-3.13 upgrade issue with the duplicates in the table event_crf #3568

Open

Description

@IannisK

Hello everyone,

I am having an issue upgrading OpenClinica-3.13 to a newer version. After completing all of the upgrade steps and trying to deploy it with Tomcat, the deployment fails with the following error:

SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.akaza.openclinica.dao.core.OCContextLoaderListener] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [org/akaza/openclinica/applicationContext-core-db.xml]: Invocation of init method failed; nested exception is liquibase.exception.MigrationFailedException: Migration failed for change set migration/3.14/2017-06-05-OC-7394.xml::2017-06-05-7394-1::sdibona: Reason: liquibase.exception.JDBCException: Error executing SQL ALTER TABLE event_crf ADD CONSTRAINT uniq_study_event_crf_version_study_subject UNIQUE (study_event_id, crf_version_id, study_subject_id): Caused By: Error executing SQL ALTER TABLE event_crf ADD CONSTRAINT uniq_study_event_crf_version_study_subject UNIQUE (study_event_id, crf_version_id, study_subject_id): Caused By: ERROR: could not create unique index "uniq_study_event_crf_version_study_subject" Detail: Key (study_event_id, crf_version_id, study_subject_id)=(59977, 8175, 5910) is duplicated.

I found a script for removing duplicates (OpenClinica-x.x/conf/database/PostgreSQL/upgrade/Duplicate_Delete_v5.sql), but it only works with a different table and doesn't solve my issue. There are 149 duplicates in my database, and I am unsure if manual deletion is a good idea since there are references to this table in the database.
Does anyone faced with such an issue? Unfortunately, searching doesn't provide me any relevant information.

Activity

  1. tomhickerson commented on Apr 24, 2023

    @tomhickerson

    You may want to look at the issue OC-7394 in jira.openclinica.com to get a better idea as to why this constraint was added in the first place. I can think of a situation when this duplication would happen, with repeating events. Did you have any in your study?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0