ERROR: duplicate key value violates unique constraint "pk_os_historystep"

HI, i'e getting this error:

Could not move to history step for #12605: root cause: while inserting: [GenericEntity:OSHistoryStep][owner,][caller,admin][dueDate,null][stepId,1][actionId,11][finishDate,2016-09-19 16:41:50.744][id,12712][startDate,2016-09-19 16:30:38.133][entryId,12605][status,null] (SQL Exception while executing the following:INSERT INTO public.OS_HISTORYSTEP (ID, ENTRY_ID, STEP_ID, ACTION_ID, OWNER, START_DATE, DUE_DATE, FINISH_DATE, STATUS, CALLER) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint "pk_os_historystep"))

 

Any clues?

 

1 answer

0 votes
Chris Fuller Atlassian Team Sep 19, 2016

This is a database corruption.

I'm not completely familiar with this part of the schema, but the fact that OSHistoryStep doesn't have its own entry in sequence_value_item leads me to believe that it is supposed to get its id from a moved OSCurrentStep rather than generating its own.  It would therefore be a problem if the same ID exists in both tables.  In other words, this query should return 0 rows:

SELECT id FROM os_historystep WHERE id IN (SELECT id FROM os_currentstep);

 

If it doesn't, then this would seem to be the problem.  But I'm not 100% certain how you got here or what the best way is to fix it.  If it were me, I'd probably take a backup of the database and then delete the offending rows from os_historystep.  That is, if you have your own JIRA Server or JIRA Data Center instance.

If you are in JIRA Cloud, there is a current incident related to problems in changes to the sequence value generation.  You should open a support request and include a reference to "HOT-47776" or this JRA:

https://jira.atlassian.com/browse/JRA-62558

 

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

432 views 1 14
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot