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 vote
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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Sunday in Agility

You asked for it, so we delivered: images on issues have arrived

A picture tells a thousand words. And agility boards have just released their latest feature: cover images on issues – so now your board can tell a story at first glance. Upload attachmen...

189 views 1 11
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