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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

86 views 0 5
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