Uploaded image for project: 'Jira Service Management Data Center'
  1. Jira Service Management Data Center
  2. JSDSERVER-16340

Assets Object History is not being saved when history IDs exceed 2 billion

XMLWordPrintable

      Issue Summary

      Assets have a limit on the number of object history records. AO_8542F1_IFJ_OBJ_HIST.'ID' cannot hold more than 11 digits long. When the number of object exceeds this limit, object will be created but no history will be added.

      Steps to Reproduce

      1. Install Jira with Oracle db
      2. Recreate the sequence with the desired starting point. Otherwise we would need to use a loop or manually execute a series of SELECT NEXTVAL statements to increment the sequence.
        DROP SEQUENCE AO_8542F1_IFJ_OBJ_HIST_ID_SEQ;
        
        CREATE SEQUENCE AO_8542F1_IFJ_OBJ_HIST_ID_SEQ
        START WITH 441954398642
        INCREMENT BY 1
        NOCACHE
        NOCYCLE;
        
      3. Enable the SQL logging in jira.
      4. Create an Object or edit any object
      5. Go to Object History view and nothing will be there.

      Expected Results

      Object History should contains changes made.

      Actual Results

      No records will be saved. The following exception can be seeing in atlassian-jira-sql.log.

      2025-07-24 10:06:49,058+0000 http-nio-8080-exec-1394  606x39848367x3 1uv6sk1 /rest/insight/1.0/object/48747979 3 ms "INSERT INTO "AO_8542F1_IFJ_OBJ_HIST" ("IMPORT_SOURCE_ID","NEW_KEY_VALUES","ACTOR_USER_KEY","OLD_VALUE","CREATED","NEW_VALUE","INSIGHT_VERSION","OBJECT_ID","OLD_KEY_VALUES","OBJECT_TYPE_ATTRIBUTE_ID","TYPE","AFFECTED_ATTRIBUTE") VALUES (?,?,?,?,?,?,?,?,?,?,?,?) {1=null, 2={"values":[{"textValue":"test12345"}]}, 3=xxxx, 4=test1234, 5=2025-07-24 10:06:49.054, 6=test12345, 7=20.3.5-REL-0001, 8=48747979, 9={"values":[{"id":-1,"textValue":"test1234"}]}, 10=4704, 11=2, 12=Name}"
      java.sql.BatchUpdateException: ORA-06502: PL/SQL: numeric or value error: number precision too large
          ORA-06512: at "JSDPRD.AO_8542F1_IFJ_OBJ_H804341978", line 2
          ORA-04088: error during execution of trigger 'JSDPRD.AO_8542F1_IFJ_OBJ_H804341978'
          
      	at oracle.jdbc.driver.OraclePreparedStatement.executeLargeBatch(OraclePreparedStatement.java:9711) [ojdbc10.jar:19.3.0.0.0]
      	at oracle.jdbc.driver.T4CPreparedStatement.executeLargeBatch(T4CPreparedStatement.java:1447) [ojdbc10.jar:19.3.0.0.0]
      	at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:9487) [ojdbc10.jar:19.3.0.0.0]
      	at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:237) [ojdbc10.jar:19.3.0.0.0]
      	at org.apache.commons.dbcp2.DelegatingStatement.executeBatch(DelegatingStatement.java:230) [?:?]
      	...
      	at com.riadalabs.jira.plugins.insight.services.core.dal.dao.impl.InsightActiveObject.create(InsightActiveObject.java:76) [?:?]
      	at com.riadalabs.jira.plugins.insight.services.core.dal.dao.impl.ObjectHistoryDaoImpl.lambda$createObjectHistoriesAO$0(ObjectHistoryDaoImpl.java:85) [?:?]
      	at java.base/java.lang.Iterable.forEach(Iterable.java:75) [?:?]
      	at com.riadalabs.jira.plugins.insight.services.core.dal.dao.impl.ObjectHistoryDaoImpl.createObjectHistoriesAO(ObjectHistoryDaoImpl.java:85) [?:?]
      	at com.riadalabs.jira.plugins.insight.services.core.dal.impl.ObjectDalImpl.createHistoryEvents(ObjectDalImpl.java:281) [?:?]
      	at com.riadalabs.jira.plugins.insight.actions.attribute.HistoryServiceImpl.createHistoryEvents(HistoryServiceImpl.java:63) [?:?]
      	at com.riadalabs.jira.plugins.insight.actions.attribute.AttributeActionsExecutorImpl.createHistoryEvents(AttributeActionsExecutorImpl.java:81) [?:?]
      	at com.riadalabs.jira.plugins.insight.actions.attribute.AttributeActionsExecutorImpl.executeAttributeActions(AttributeActionsExecutorImpl.java:39) [?:?]
      	at com.riadalabs.jira.plugins.insight.services.core.ObjectServiceImpl.handleAttributes(ObjectServiceImpl.java:974) [?:?]
      	at com.riadalabs.jira.plugins.insight.services.core.ObjectServiceImpl.updateExistingObject(ObjectServiceImpl.java:847) [?:?]
      	at com.riadalabs.jira.plugins.insight.services.core.ObjectServiceImpl.storeObjectInternal(ObjectServiceImpl.java:636) [?:?]
      	at com.riadalabs.jira.plugins.insight.services.core.ObjectServiceImpl.storeObject(ObjectServiceImpl.java:497) [?:?]
      	at com.riadalabs.jira.plugins.insight.services.core.ObjectServiceImpl.storeObject(ObjectServiceImpl.java:337) [?:?]
      	at com.riadalabs.jira.plugins.insight.channel.web.api.rest.services.object.ObjectResource.updateObject(ObjectResource.java:412) [?:?]
      

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

      Versions Tested

      Please confirm all versions that have been tested for this issue, and indicate whether the tested version is affected or not affected, below: 

      Testing Requirements Version Affected Version
      Customers Reported Version 10.3.6 Yes
      Most Recent Bug-Fix Release    
      Previous Major Release 5.12 Yes
      Most Recent LTS    
      Previous Supported LTS    
      Other Versions..    
      (Add rows as needed)    

              c8bcca445054 Benjamin Suess
              9f03f4114502 Pablo Bartolome (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: