Using the database integrity checker

Searching for common data inconsistencies, the Database Integrity Checker attempts to ensure that all Jira data is in a consistent state.

This is useful in a number of situations, for example:

  • Before migrating a project to a new workflow
  • An external program is modifying Jira's database
  • Troubleshooting a server crash

If an error is encountered, most of the integrity checks provide a 'repair' option that attempts to reset the data to a stable state.

For all of the following procedures, you must be logged in as a user with the Jira system administrator global permissions.

Skip to:

Using the Integrity Checker

  1. From the top navigation bar select Administration  > System
  2. Select System support > Integrity checker to open the Integrity checker page.
    The integrity checker has a number of integrity checks that look for common inconsistencies in Jira's stored data. Explore integrity checks in details
  3. Select one or more options you would like to run and select the Check button.
  4. While the checks are running, you can track the status of the operation in the progress bar. When the operation is complete, select the Acknowledge button.
  5. The preview screen will display to show you if all the checks have passed.

    1. If any data inconsistencies are found, they'll display in red and the Fix button will also appear on the page. To fix the incosistencies, select the check for which they appear and select the Fix button.

    2. Messages in yellow are warnings that the check won't correct. Jira will auto-recover from these inconsistencies when an action is taken on an issue.

      We strongly recommend taking a backup of your data before correcting any data inconsistencies.

  6. If any inconsistencies were found and you chose to correct them, you will be presented with a summary screen describing all the corrective actions that have taken place.

Integrity Checker will display the number of records that is limited by the jira.integrity.checker.displayable.results.limit property. This means, if the limit is set to 20, each check will display a maximum of 20 results.

Integrity Checker will also fix the number of affected records that is limited by the jira.integrity.checker.results.limit property. This means, if the limit is set to 1000, a maximum of 1000 records will be fixed. If 2000 affected records are found, you may proceed to fix 1000 records only and run the check again or adjust the limit to address more records.

Modify property keys

Audit events

There are three types of audit events related to Integrity Checker:

  • Integrity checker task started, when check or fix starts.

  • Integrity checker task finished, when check or fix is finished and acknowledged by the person who runs the operation.

  • Integrity checker task removed, when one system admin ran a check or fix, it finished, but:

    • it wasn't acknowledged by the submitter. If this happens, the submitter can find it back in the audit log, use the Progress URL to return to the page, and acknowledge the task.

    • the node of task submission was restarted and another system admin entered the https://{JIRA_HOME}/secure/admin/IntegrityChecker!default.jspa. If this happens, the task can’t be acknowledged anymore. To solve it, run the check or fix again.

Overview of the integrity checks

The integrity checker has a number of integrity checks that look for common inconsistencies in Jira's stored data.

Check nameIs it a long-running fix?What it checksHow it fixes
Check Issue Relations
Check Issue for Relation 'ParentProject'

Yes Plus

Checks if the Project ID on the Issue points to an existing project.

Deletes the issue if it has no corresponding project. Particularly deletes:

  • Comments (actions)

  • Worklogs

  • Subtasks

  • Issue links

  • Change items

  • Moved issue key history if the issue was moved between the projects

  • Issue properties

  • Node associations

  • User associations

  • Custom field values

  • Workflow entries

  • Issue generic value from the database

  • Associated notifications

It's being deindexed and the delete event is being sent.

(warning) This action doesn't remove attachments stored on disk or S3.

Check Issue for Relation 'RelatedOSWorkflowEntry'

Yes Plus

Checks if the Workflow ID on the issue points to an existing OS Workflow Entry.

  • Gets the workflow for a given issue type and project.
  • Creates a new OS workflow entry for a given issue and workflow.
  • Sets the step to the initial status, such as "to do."
  • Removes abandoned records from the OS Workflow Entry table (the records that have no corresponding issue).

Check that all Issue Links are associated with valid issues

No Minus

Checks if the source or destination issue ID in the Issue Link points to an existing issue.

Deletes the broken Issue Link from the database.

Check Search Request

Check search request references a valid project

Yes Plus

Checks if the Search Request (Search Filter) with a non-empty Project field points to an existing project.

  • Deletes corresponding Filter Subscriptions.

  • If it has a Column Layout, it restores the default one.

  • Deletes permissions for the Search Request.

  • Deletes the Search Request.

  • Deindexes Search Request.

  • Publishes event to an Audit Log.

Check for Duplicate Permissions

Check the permissions aren't duplicated

Yes Plus

Checks if there are records in the SCHEME_PERMISSIONS table that have the same:

  1. Scheme ID

  2. Permission ID

  3. Permission Type. Explore permissions types

  4. Parameter

  5. Permission Key. Explore project permissions

  • Deletes the duplicated record from the SchemePermissions table.

  • Sends the EntityDeletedEvent, so it's visible in the Audit Log.

Check Workflow Integrity

Check workflow entry states are correct

No Minus

Checks if there is an Issue that has a corresponding OS Workflow Entry ID with a Status equal to null or 0 (CREATED)

For found Issues, sets the corresponding OS Workflow Entry State to 1 (ACTIVATED).

Check workflow current step entries







No Minus







Checks if the Issue’s current status in the workflow is correct.

(warning) This Check iterates through all the Issues on the instance. Depending on the number of Issues, this Check can be a long-running check.

Depending on the case, it can or can’t be fixed.

Case 1: The Issue’s Status is null.

Result: This Check can't be fixed. Use Check Jira issues with null status to recover.

Case 2: The Issue’s OS Workflow Status ID is null.

Result: This Check can't be fixed. Use Check Issue for Relation 'RelatedOSWorkflowEntry' to recover.

Case 3: The Issue has the Status set, but there is no linked Step descriptor for this Status in its workflow.

Result: This Check can't be fixed.

Case 4: We found 0 records in the OS Current Step table for the Issue with the given OS Workflow Entry ID.

Result: Creates a missing OS Current Step for given Issue ID with a given Status and OS Workflow Entry ID.

Case 5: We found 1 record in the OS Current Step table for the Issue with the given OS Workflow Entry ID, but the Step ID is null or differs from the one mapped from the Issue Status.

Result: If the OS Current Step record found is invalid, sets its value in the DB. Otherwise, skips it.

Case 6: We found 1+ records in the OS Current Step table for the Issue with the given OS Workflow Entry ID.

Result: Deletes redundant steps and keeps only one.

Check Jira issues with null status

No Minus

If the Issue’s Status is null

  • Maps the missing Issue’s Status using the related OC Current Step table and Issue's Workflow.

  • Updates the changelog for issue transition from status null to the desired status.

  • Reindexes the issue.

Check Field Layout Scheme Integrity

Check field layout schemes for references to deleted custom fields

No Minus

Checks if all Field Layout Items are pointing to an existing Custom Field.

(info) Field Layout Item can specify if a given Custom Field is required in a given Field Layout. More about specifying field behavior

Deletes the faulty record from the Field Layout Item table.

Check for invalid filter subscriptions

Check FilterSubscriptions for references to non-existent scheduled job

No Minus

Checks if a Filter Subscription is linked to a Scheduled Clustered Job that doesn't exist in the Clustered Job table.

Delete the faulty record from the Filter Subscription table.

Check FilterSubscriptions for references to non-existent SearchRequests

No Minus

Checks if:

  • a Filter Subscription is linked to a Search Filter (Search Request) that doesn't exist.
  • a User that from a subscription has no permission to use this Search Filter.
  • Unschedules all Scheduled Jobs for affected subscription.

  • Deletes the Filter Subscription from the database.

Integrity Checker property keys

Integrity Checker uses the following application property keys that you can adjust any moment in the System > Advanced properties or by using REST API.

Property keyDescriptionDefault valueAdjustable in Advanced propertiesAdjustable via REST API

jira.integrity.checker.results.limit

Maximum number of fixes to process if the Check is marked as a long-running fix.

1000

Yes Plus

YesPlus

jira.integrity.checker.workflow.current.step.batch.size

Batch size for workflow current step integrity checker.

1000

Yes Plus

No Minus

jira.integrity.checker.displayable.results.limit

Maximum number of results listed in UI for a single integrity check.

20

Yes Plus

No Plus

Last modified on Nov 20, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.