You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
8000
OpenClinica-3.13 upgrade issue with the duplicates in the table event_crf #3568
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.
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?
Activity
tomhickerson commentedon Apr 24, 2023
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?