Issue Operations are Failed by the PK Violation of Database
Symptom
Unable to do any action on issue, including Edit, Assign, Transit... along with the Primary Key Violation Exception thrown in log file.
SQL Exception while executing the following:
INSERT INTO ***.changegroup (ID, issueid, AUTHOR, CREATED) VALUES (?, ?, ?, ?) (***: unique constraint (***.PK_CHANGEGROUP) violated )
Cause
The cause is the dis-synchronization between the sequence setting and seq_id of changegroup table, which may relate to the incomplete transaction triggered by database connection failure.
Workaround
Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
Run the following SQL in your JIRA database to synchronize sequence setting for changegroup
update SEQUENCE_VALUE_ITEM SET seq_id = (select max(ID) from changegroup) + 10 where seq_name='ChangeGroup'
- Restart JIRA.