Upgrade failed: Table 'LABEL' has a multi-column primary key on [ID, LABELID]
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
When upgrading to Confluence 6.13.8, upgrade fails with the following ERROR:
1
2
2020-11-20 11:02:56,501 ERROR [localhost-startStop-1] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized Upgrade failed, application will not start: Upgrade task com.atlassian.confluence.upgrade.upgradetask.LowerCaseUsernameReferencesUpgradeTask@20ce74e2 failed during the SCHEMA_UPGRADE phase due to: Table 'LABEL' has a multi-column primary key on [ID, LABELID]
com.atlassian.confluence.upgrade.UpgradeException: Upgrade task com.atlassian.confluence.upgrade.upgradetask.LowerCaseUsernameReferencesUpgradeTask@20ce74e2 failed during the SCHEMA_UPGRADE phase due to: Table 'LABEL' has a multi-column primary key on [ID, LABELID]
When inspecting the table directly there is no extra 'ID
' column, only the "LABELID, NAME, OWNER, NAMESPACE, CREATIONDATE, LASTMODDATE
" columns which are expected.
Environment
Confluence 5.0.2
Oracle database
Cause
There was another Confluence schema in the DB in conflict
Workaround
Create a view that restricts to just the constraints this user should see:
1
CREATE VIEW ALL_CONSTRAINTS AS SELECT * FROM SYS.ALL_CONSTRAINTS WHERE OWNER = UPPER('TSPACE_USER');
This allows the upgrade to use the view instead of the table, and get past the issue.
ℹ️ a similar workaround may be applied where a view is created with name 'LABEL
' for the 'LABEL
' table, consisting of only the correct columns that exist in the correct target table:
1
CREATE VIEW schema.LABEL (LABELID, NAME, OWNER, NAMESPACE, CREATIONDATE, LASTMODDATE) AS SELECT LABELID, NAME, OWNER, NAMESPACE, CREATIONDATE, LASTMODDATE FROM schema.LABEL;
Was this helpful?