Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-74138

Editing a priority in Jira resulting in results in 500 errors (unique constraint issues at database level)

XMLWordPrintable

    • 9.01
    • 7
    • Severity 1 - Critical
    • Hide
      Atlassian Update – 29 July 2022

      Hi All,

      Thank you for bringing the issue to our attention! We recognise that this is a severe issue and have already started working on it as reflected by the status and we aim to release the fix with 9.1.1. We will provide more updates as the fix gets released

      Regards,
      Roman Kolosovskiy
      Jira Product team

      Show
      Atlassian Update – 29 July 2022 Hi All, Thank you for bringing the issue to our attention! We recognise that this is a severe issue and have already started working on it as reflected by the status and we aim to release the fix with 9.1.1. We will provide more updates as the fix gets released Regards, Roman Kolosovskiy Jira Product team

      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

      1. Navigate to "Administration --> Issues --> Priorities" page.
      2. Try to edit any existing priority for Name or Description.
      3. 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

      1. Create a new priority with desired changes
      2. Delete existing priority you want to edit 
      3. While deleting an existing priority select a new priority (the one you created in first step) for the issues that are currently using it 

              f5e0e0ab36de Kamil Bar
              vyadavayyanamath@atlassian.com Vivek Yadavayyanamath
              Votes:
              6 Vote for this issue
              Watchers:
              29 Start watching this issue

                Created:
                Updated:
                Resolved: