Resolution
System Integrity Check failures caused by custom, third-party, or archived database tables and indexes can be resolved by identifying and safely removing those tables and indexes from the Octopus Server database before proceeding with the upgrade.
Symptom
The System Integrity Check task fails during an Octopus Deploy upgrade process. The raw output typically lists specific database tables and indexes that were not created by Octopus Deploy.
Scope: when this is the right article
This article applies when:
- You are performing an Octopus Server upgrade (major, minor, or patch).
- The System Integrity Check fails with errors or warnings referencing database tables and/or indexes not managed by Octopus Deploy.
- Your environment contains custom database objects (e.g., GDPR archive tables, legacy data stores, third-party integrations, or automatic tuning) that share or are enabled for the same database as Octopus Deploy.
Cause
The System Integrity Check validates that the database schema matches the expected Octopus Deploy structure. If the check encounters tables or indexes that were not created by Octopus Deploy, it flags them as a potential schema mismatch or integrity risk, causing the check to fail or show warnings. This is often due to custom data archival processes, compliance tools, legacy scripts, or automatic database tuning that created tables and/or indexes within the Octopus database.
Example System Integrity Check output with unexpected tables:
01:17:01 Error | Unexpected item: USER_TABLE dbo.DeploymentHistory_GDPR_Removed.ChannelId nvarchar(100/0/0) NULL
| Unexpected item: USER_TABLE dbo.DeploymentHistory_GDPR_Removed.ChannelName nvarchar(400/0/0) NULL
| Unexpected item: USER_TABLE dbo.DeploymentHistory_GDPR_Removed.CompletedTime datetimeoffset(10/34/7) NULL
| Unexpected item: USER_TABLE dbo.DeploymentHistory_GDPR_Removed.Created datetimeoffset(10/34/7) NOT NULL
| Unexpected item: USER_TABLE dbo.DeploymentHistory_GDPR_Removed.DeployedBy nvarchar(400/0/0) NULL
| Unexpected item: USER_TABLE dbo.DeploymentHistory_GDPR_Removed.DeploymentId nvarchar(100/0/0) NOT NULL
| Unexpected item: USER_TABLE dbo.DeploymentHistory_GDPR_Removed.DeploymentName nvarchar(400/0/0) NOT NULL
| Unexpected item: USER_TABLE dbo.DeploymentHistory_GDPR_Removed.DurationSeconds int(4/10/0) NULL
| Unexpected item: USER_TABLE dbo.DeploymentHistory_GDPR_Removed.EnvironmentId nvarchar(100/0/0) NOT NULL
Example System Integrity Check output with unexpected indexes:
01:18:00 Error | Unexpected item: IDX dbo.nci_msft_ServerTask_AB5AAE1906BE6C222B52AED15548B332 CompletedTime
| Unexpected item: IDX dbo.nci_msft_ServerTask_AB5AAE1906BE6C222B52AED15548B332 JSON
| Unexpected item: IDX dbo.nci_msft_ServerTask_AB5AAE1906BE6C222B52AED15548B332 Name
| Unexpected item: IDX dbo.nci_msft_ServerTask_AB5AAE1906BE6C222B52AED15548B332 NONCLUSTERED 0
| Unexpected item: IDX dbo.nci_msft_ServerTask_AB5AAE1906BE6C222B52AED15548B332 QueueTime
| Unexpected item: IDX dbo.nci_msft_ServerTask_AB5AAE1906BE6C222B52AED15548B332 SpaceId
| Unexpected item: IDX dbo.nci_msft_ServerTask_AB5AAE1906BE6C222B52AED15548B332 State
Diagnosis and fix
- Review the integrity check output: Identify the exact table names and/or index names flagged as non-Octopus tables.
- Verify table/index purpose: Confirm with your internal teams whether the flagged tables and/or indexes are still required. In some cases, the tables may contain archived or legacy data, or old indexes are persisting that are no longer actively used by Octopus Deploy.
- Backup the database: Before making any changes, perform a full backup of the Octopus Server database and Master Key
- Remove or relocate the tables and/or indexes: If the tables and/or indexes are confirmed to be unused or can be safely moved to a separate database or archive schema, remove them from the live Octopus database. Ensure that no Octopus Deploy processes, scripts, or integrations reference these tables.
- Re-run the System Integrity Check: Execute the System Integrity Check again to confirm it passes before proceeding with the upgrade.
Verify
- The System Integrity Check completes successfully with no warnings or errors related to non-Octopus tables.
- Octopus Deploy continues to function normally after the upgrade, with no loss of active configuration, projects, or deployment history.
- If the tables contained critical data, verify that the data was successfully archived or migrated before removal.