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

WARNINGS in JSM log - ISSUE with id=xxxxxx should have a version by now although all issues have versions

XMLWordPrintable

    • 9.04
    • 6
    • Severity 2 - Major
    • 5
    • Hide
      Atlassian Update – 20 September 2023

      Dear Customers,

      We're happy to announce that the fix to this issue will be backported to the Jira 9.4.11 LTS version, which is planned to be released in October 2023.

      Best regards,
      Daria Misiowiec
      Software Engineer, Jira DC

      Show
      Atlassian Update – 20 September 2023 Dear Customers, We're happy to announce that the fix to this issue will be backported to the Jira 9.4.11 LTS version, which is planned to be released in October 2023. Best regards, Daria Misiowiec Software Engineer, Jira DC

      Issue Summary

      With JSM 5.5 log4j v2 causes houndreds of WARN logs for any action that triggers indexing on issues. (edit/comment etc).
      The logs state that issue should have a version by now. This is misleading as all issues have versions.

      This is reproducible on Data Center: (yes)

      Steps to Reproduce

      1. Install JSM 5.5 or later
      2. Create a JSM Project and comment

      Expected Results

      No WARN messages for the index operation happens if issue has a version.

      Actual Results

      Issue indexer thread throws WARN messages multiple times for every edit

      2023-03-10 15:45:22,450+0000 SdSerialisedOffThreadProcessor:thread-4 WARN admin     [c.a.j.issue.index.DefaultIssueIndexer] ISSUE with id=10201 should have a version by now
      2023-03-10 15:45:22,644+0000 SdSerialisedOffThreadProcessor:thread-4 WARN admin     [c.a.j.issue.index.DefaultIssueIndexer] ISSUE with id=10201 should have a version by now
      

      How to validate if all issues have versions?

      We are aware of the issue causing JSM code to produce misleading logs.
      In case the log is coming from threads:

      • PsmqAsyncExecutors-job
      • SdSerialisedOffThreadProcessor
      • http-nio threads from greenhopper rest endpoints

      It is very likely that the log is misleading and in fact all issues have an issue version.

      To further validate you can run a following query:

      select count(*)
      from jiraissue
               left join issue_version on jiraissue.id = issue_version.issue_id
      where issue_version.issue_id is null;

      The correct result should be 0. In case it is more than 0 Jira is in inconsistent state and requires further diagnosis.

       

      Workaround

      Insert missing initial issue versions

      insert into issue_version
        select id, null,  updated, 1, 'N' 
        from jiraissue
        where id not in (
            select issue_id
            from issue_version
          );
      

      Insert missing initial comment versions

      insert into comment_version
        select id, issueid,  updated, 1, 'N' 
        from jiraaction
        where actiontype = 'comment'
          and id not in (
            select comment_id
            from comment_version
          );
      

      Notes

      The insertion time will depend on the size of the missing data in the versions and entities tables don't worry if it takes more than a few seconds.

      IMPORTANT

       Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

       

              755f87a38635 Krzysztof Krysiak
              c55b673763fb Alper Firengiz (Inactive)
              Votes:
              11 Vote for this issue
              Watchers:
              33 Start watching this issue

                Created:
                Updated:
                Resolved: