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

JIRA unable to create statuses after upgrade to 6.2-OD-3/icebat-85.0 if there's previously been custom statuses created

    XMLWordPrintable

Details

    Description

      NOTE: This bug report is for JIRA Server. Using JIRA Cloud? See the corresponding bug report.

      Steps to reproduce

      1. Start with JIRA < 6.2-OD-3/icebat-85.0.
      2. Create a custom issue status, which is created with an ID of 10000.
      3. Upgrade to JIRA 6.2-OD-3/icebat-85.0.
      4. Try to create another issue status, and you'll receive a stack trace:
        com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Status][id,10000][sequence,12][description,null][name,A New Status][statuscategory,1][iconurl,/images/icons/statuses/generic.png] (SQL Exception while executing the following:INSERT INTO public.issuestatus (ID, SEQUENCE, pname, DESCRIPTION, ICONURL, STATUSCATEGORY) VALUES (?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint "pk_issuestatus"))
        	at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.createValue(DefaultOfBizDelegator.java:395)
        	at com.atlassian.jira.ofbiz.WrappingOfBizDelegator.createValue(WrappingOfBizDelegator.java:219)
        	at com.atlassian.jira.config.AbstractIssueConstantsManager.createConstant(AbstractIssueConstantsManager.java:38)
        	at com.atlassian.jira.config.DefaultStatusManager.createStatus(DefaultStatusManager.java:73)
        	at com.atlassian.jira.bc.config.DefaultStatusService.createStatus(DefaultStatusService.java:75)
        	at com.atlassian.jira.web.action.admin.statuses.ViewStatuses.addConstant(ViewStatuses.java:196)
        	at com.atlassian.jira.web.action.admin.constants.AbstractViewConstants.doAddConstant(AbstractViewConstants.java:42)
        	at com.atlassian.jira.web.action.admin.statuses.ViewStatuses.doAddStatus(ViewStatuses.java:134)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        	at java.lang.reflect.Method.invoke(Method.java:597)
        	at webwork.util.InjectionUtils$DefaultInjectionImpl.invoke(InjectionUtils.java:70)
        [...]
        

      Try to create it a second time and it'll work fine, as the new status is then created with an ID of 10001. The more custom issue statuses already exist in an instance, the more times you have to click Add in order to get past the latest ID.

      Workaround

      If on OnDemand contact support, support will:

      1. Shutdown JIRA
      2. Backup the database
      3. Identify the current maximum value of the issuestatus id
        select id::integer from issuestatus order by id desc limit 1;
        
      4. Update the sequence_value_item table to define the Status sequence ID as 1 higher than the value identified in the previous step
        update sequence_value_item set seq_id = <value from above + 1> where seq_name = 'Status';
        
      5. Start JIRA back up.

      Attachments

        Issue Links

          Activity

            People

              rtekhov Roman Tekhov (Inactive)
              nmason Nick Mason
              Votes:
              9 Vote for this issue
              Watchers:
              29 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: