Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

We got a duplicate key in the table OS_HISTORYSTEP_PREV

Andreas K. June 29, 2023

The following message did appear:

"Could not move to history step for #135773: root cause: while inserting: [GenericEntity:OSHistoryStepPrev][previousId,472537][id,472552] (SQL Exception while executing the following:INSERT INTO jiradb.OS_HISTORYSTEP_PREV (ID, PREVIOUS_ID) VALUES (?, ?) (Violation of PRIMARY KEY constraint 'PK_OS_HISTORYSTEP_PREV'. Cannot insert duplicate key in object 'jiradb.OS_HISTORYSTEP_PREV'. The duplicate key value is (472552, 472537).))

It seems that you have tried to perform an illegal workflow operation.

If you think you shouldn't get this message, please contact your Jira administrators."

 

How can we solve this problem?

1 answer

1 vote
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 29, 2023

The TLDR version of this is that your database is corrupt.

The usual reason for this is that someone has been writing to a Jira database outside Jira, without having a comprehensive understanding of what they are doing, and they've got it wrong.

You can also do it with poorly written scripts or apps, and it can sometimes happen when a server crashes hard in the middle of a database write.

You will need to work out which one of those happened because you need to know where all the damage was done in order to be able to fix it (and in the case of scripts/apps, fix the script or remove the app.  For people using SQL, kill their access immediately - never let people into a Jira database, even read-only)

Suggest an answer

Log in or Sign up to answer