-
Bug
-
Resolution: Fixed
-
High
-
9.1.0
-
9.01
-
7
-
Severity 1 - Critical
-
-
Issue Summary
Editing a priority in Jira resulting in results in 500 errors (unique constraint issues at database level). The issue affects all supported databases.
This is reproducible on Data Center: YES
Steps to Reproduce
- Navigate to "Administration --> Issues --> Priorities" page.
- Try to edit any existing priority for Name or Description.
- Click update once changes are made.
Expected Results
Ideally the UPDATE should happen without any issues and and UPDATE statement should be registered in the SQL logs (success message in application logs).
Actual Results
The application throws 500 errors in the GUI as shown in the attached screenshot.
The below exception is thrown in the atlassian-jira.log file:
2022-07-25 14:19:23,384+0000 http-nio-8080-exec-4 ERROR [o.a.c.c.C.[.[localhost].[/jira].[action]] Servlet.service() for servlet [action] in context with path [/jira] threw exception [com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Priority][sequence,1][statusColor,#d04437][name,Highest][iconurl,/images/icons/priorities/highest.png][description,This problem will block progress.][id,1] (SQL Exception while executing the following:INSERT INTO public.priority (ID, SEQUENCE, pname, DESCRIPTION, ICONURL, STATUS_COLOR) VALUES (?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint "pk_priority" Detail: Key (id)=(1) already exists.))] with root cause org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "pk_priority" Detail: Key (id)=(1) already exists.
SQL logging will help get the exact query triggered. Ideally and UPDATE statement should trigger in place of INSERT statement.
2022-07-25 14:19:23,268+0000 http-nio-8080-exec-4 xxxxx 859x306x1 xxxxxx /secure/admin/EditPriority.jspa 1ms "INSERT INTO public.priority (ID, SEQUENCE, pname, DESCRIPTION, ICONURL, STATUS_COLOR) VALUES ('1', '1', 'Highest', 'This problem will block progress.', '/images/icons/priorities/highest.png', '#d04437')" org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "pk_priority" Detail: Key (id)=(1) already exists. at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2565) [postgresql-42.2.25.jar:42.2.25] at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2297) [postgresql-42.2.25.jar:42.2.25] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:322) [postgresql-42.2.25.jar:42.2.25] at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:481) [postgresql-42.2.25.jar:42.2.25] at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:401) [postgresql-42.2.25.jar:42.2.25]
Workaround
- Create a new priority with desired changes
- Delete existing priority you want to edit
- While deleting an existing priority select a new priority (the one you created in first step) for the issues that are currently using it