Seeing the following error when executing clear up submitted tasks.
When executing the "Cleanup Submitted Tasks" task in Identity Manager, the task fails and the following error is recorded in the logs or View Submitted Tasks (VST): Task "Cleanup Submitted Tasks": Failed to execute CleanupSubmittedTasksEvent. ERROR MESSAGE: Violation of PRIMARY KEY constraint 'PK_archive_runtimeStatusDetail12'. Cannot insert duplicate key in object 'dbo.archive_runtimeStatusDetail12'. The duplicate key value is (XXXXXX).
In Oracle environments, the error appears as: ORA-00001: unique constraint (IAMARCHIVE.PK_ARCH_RUNTIMESTATUSDETAIL12) violated
This issue is frequently reported following database migrations, manual restores of task persistence data, or when database replicas become out-of-sync.
The error occurs because the cleanup process attempts to move a task record from the runtime table (runtimeStatusDetail12) to the archive table (archive_runtimeStatusDetail12), but a record with the same ID already exists in the archive destination. This data inconsistency typically results from:
If the Archive information is not needed, for example shortly after the initial installation, or in non-production environments, drop the archive tables, denoted by the ARCHIVE_ in the database and restart Identity Manager to recreate those tables.
If the Archive information is needed, for example in Production environments, please see KB 44246 How to find duplicates for IM tasksession12_5 and archive_tasksession12_5__clean_up for information on how to locate and cleanup the duplicate information.