I am getting an sql Exception Unique constraint violation SYS_IDX_57 in Jira 4.4.5

srikanth Asoori maringanti December 23, 2012

Inside my program I have written the following statement

stmt.executeUpdate("INSERT INTO CUSTOMFIELDVALUE VALUES(10001,12800,12000,NULL,'0.46 Days',NULL,NULL,NULL,NULL)");

I think the error has came because I manually created the Id(10001).

My question is how in jira the id for CUSTOMFIELDVALUE TABLE IS CREATED

And also what is SYS_IDX_57?

2 answers

1 accepted

0 votes
Answer accepted
Naren
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.
December 23, 2012

Hi Srikanth,

What is the error generated in the log? Please go through this link, you'll get a clear picture about JIRA Database Schema. Also check out the Example SQL Queries in JIRA.

srikanth Asoori maringanti December 23, 2012

Thanks Naren for your help.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 23, 2012

You should also reverse out the SQL changes you made to restore functionality before you do anything else.

srikanth Asoori maringanti December 23, 2012

Ok nic thanks a lot

Renjith Pillai
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.
December 24, 2012

And Srikanth, to stress on the database part, please do not directly manipulate JIRA database. It can result in a broken JIRA installation and restore will be your only option.

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 23, 2012

Could you please stop tagging things with "on demand" when you are NOT using OnDemand?

Anyway, yes, you should never update a Jira database with SQL unless you know exactly what you are doing. You probably have neglected to update the counter table sequence_value_item

Also, if you are going to use SQL on a Jira database, you MUST NOT have Jira running. I can't emphasise this enough - Jira MUST be offline, shutdown, inactive. When you restart it after executing the SQL, you will then need to re-index it

Stop your Jira now if it was running, update sequence_value_item, restart and reindex.

Suggest an answer

Log in or Sign up to answer