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

Database integrity checks in 'Instance optimizer' generate error "We couldn't load audit events" on Audit log.

XMLWordPrintable

      Issue Summary

      After running the new tool Database integrity checks, which is bundled in Jira 10.3.8, an error is shown in the Audit log User Interface "We couldn't load audit events" in some specific scenarios:

      This could happen after a large output of IDs returned by Database integrity checks. If the category Database integrity checks is added to the search list, it can also affect the regular search of Audit Log.

      Steps to Reproduce

      In some specific scenarios, after the new Database Integrity checks run scheduled or manually, if found issues to be fixed. Depends on the result, meaning, a large output of affected IDs is fixed, it is recorded into the Database of the integrity checker to be shown as a result under the Advanced Audit Report.

      Expected Results

      Results of Database Integrity Checks will be displayed with no error for all range interval (no additional filter added)

      Actual Results

      No results are displayed, and an error under the left side corner will be displayed:

      The exception below is thrown in the xxxxxxx.log file:

      2025-08-06 15:35:50,824-0400 http-nio-8185-exec-25 url: /rest/auditing/1.0/events; user: user ERROR c548 935x517x3 n7d5wd 127.0.0.1 /rest/auditing/1.0/events [c.a.p.r.v2.exception.ThrowableExceptionMapper] Uncaught exception <id> thrown by REST service: com.fasterxml.jackson.databind.JsonMappingException: String value length (20047857) exceeds the maximum allowed (20000000, from `StreamReadConstraints.getMaxStringLength()`) (through reference chain: java.lang.Object[][0]->com.atlassian.audit.ao.dao.JacksonAttributesSerializer$AuditAttributeData["value"])
      java.lang.RuntimeException: com.fasterxml.jackson.databind.JsonMappingException: String value length (20047857) exceeds the maximum allowed (20000000, from `StreamReadConstraints.getMaxStringLength()`) (through reference chain: java.lang.Object[][0]->com.atlassian.audit.ao.dao.JacksonAttributesSerializer$AuditAttributeData["value"])
      	at com.atlassian.audit.ao.dao.JacksonAttributesSerializer.deserialize(JacksonAttributesSerializer.java:62)
      	at com.atlassian.audit.ao.dao.AoAuditEntityMapper.map(AoAuditEntityMapper.java:49)
      	at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
      Caused by: com.fasterxml.jackson.databind.JsonMappingException: String value length (20047857) exceeds the maximum allowed (20000000, from `StreamReadConstraints.getMaxStringLength()`) (through reference chain: java.lang.Object[][0]-
       

      In the HAR file ,we see the following error:

      { "message": "com.fasterxml.jackson.databind.JsonMappingException: String value length (20047857) exceeds the maximum allowed (20000000, from `StreamReadConstraints.getMaxStringLength()`) (through reference chain: java.lang.Object[][0]->com.atlassian.audit.ao.dao.JacksonAttributesSerializer$AuditAttributeData[\"value\"])",
        "status-code": 500,
        "stack-trace": "Please contact your admin passing attached Log's referral number: <id>"}
      

      Workaround

      There are two possible tested workarounds here:

      1. Adjusting the time filter or filter by specific categories to filter out the integrity check logs will let the Advanced audit log display results, for example, set a time range of between five days.
      2. Identifying and removing the IDs was added to the column on the AO_C77861_AUDIT_ENTITY that is exceeding the 20000000 characters:

      A. Identify the entries that are exceeding the 20000000 characters. You can use the following query as a sample to identify in the database:

      SELECT "ID", 
             LENGTH("ATTRIBUTES") AS "AttrLength", 
             LENGTH("CHANGE_VALUES") AS "ChangeValuesLength", 
             LENGTH("RESOURCES") AS "ResourcesLength"
      FROM "AO_C77861_AUDIT_ENTITY"
      WHERE LENGTH("ATTRIBUTES") > 20000000 
         OR LENGTH("CHANGE_VALUES") > 20000000 
         OR LENGTH("RESOURCES") > 20000000;
      
      SELECT *
      FROM "AO_C77861_AUDIT_ENTITY"
      WHERE LENGTH("ATTRIBUTES") > 20000000 
         OR LENGTH("CHANGE_VALUES") > 20000000 
         OR LENGTH("RESOURCES") > 20000000;

      B. Next, with the query result, if any, observe if the second line, AttrLength value, is bigger than the value 20000000, it should be, and run the delete query so this record will be removed from the Audit table;

      DELETE FROM "AO_C77861_AUDIT_ENTITY" WHERE "ID" = X
      

      Please make sure you have a backup of your database before you attempt these changes.

      After that, refresh the Advanced Audit log and perform a new search using Integrity categories, which will return the output with no errors since the value that exceeds the 20000000 characters has been removed AO_C77861_AUDIT_ENTITY, queried by Jira REST /rest/auditing/1.0/events to show the results.

              Unassigned Unassigned
              43a387dfe58d Rodrigo Bruch
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: