Upgrade to Confluence Fails on Bandana_Unique_Key Relation

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

症状

When upgrading to 4.x or above from a 3.5.x or earlier version, the upgrade fails and the following appears in the atlassian-confluence.log:

ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized Upgrade failed, application will not start: Upgrade task com.atlassian.confluence.upgrade.upgradetask.BandanaKeyUniqueConstraintUpgradeTask@bce3d7 failed during the SCHEMA_UPGRADE phase due to: StatementCallback; bad SQL grammar [alter table BANDANA alter column BANDANACONTEXT set not null, alter column BANDANAKEY set not null, add constraint bandana_unique_key unique (BANDANACONTEXT, BANDANAKEY)]; nested exception is org.postgresql.util.PSQLException: Error: "bandana_unique_key" relation is already existed.

診断

This occurred in Postgres database, but might occur in other databases as well.

原因

The problem is caused when the database attempts to insert a constraint called bandana_unique_key, which already exists in the schema.

ソリューション

Perform a backup of the database. Then run the following SQL command in the Confluence database before attempting the upgrade.

  1. Confluence をシャットダウンします。
  2. 次のコマンドを実行します。

    ALTER TABLE bandana DROP CONSTRAINT bandana_unique_key;
    


    This will drop the constraint, but during the upgrade it will be created again.

    In MySQL, "DROP CONSTRAINT" isn't a known command, so to drop that unique key use the following:

    ALTER TABLE bandana DROP INDEX bandana_unique_key;
    

最終更新日: 2022 年 1 月 21 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.