Upgrade failed: Table 'LABEL' has a multi-column primary key on [ID, LABELID]

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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:

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:

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.

(info) 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:

CREATE VIEW schema.LABEL (LABELID, NAME, OWNER, NAMESPACE, CREATIONDATE, LASTMODDATE) AS SELECT LABELID, NAME, OWNER, NAMESPACE, CREATIONDATE, LASTMODDATE FROM schema.LABEL;

Last modified on Nov 22, 2020

Was this helpful?

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