Upgrade Failed with "Table has no primary key" Error Message

お困りですか?

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

コミュニティに質問

プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。

このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。

*Fisheye および Crucible は除く

症状

The Confluence upgrade process failed due a missing primary key or constraint in one of its tables. In the below example the problematic table is the LINKS table. The following appears in atlassian-confluence.log

2015-01-12 14:22:56,204 ERROR [localhost-startStop-1] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized Upgrade failed, application will not start: Upgrade task com.atlassian.confluence.upgrade.upgradetask.LowerCaseUsernameReferencesUpgradeTask@292e1ad3 failed during the SCHEMA_UPGRADE phase due to: Table 'LINKS' has no primary key
com.atlassian.confluence.upgrade.UpgradeException: Upgrade task com.atlassian.confluence.upgrade.upgradetask.LowerCaseUsernameReferencesUpgradeTask@292e1ad3 failed during the SCHEMA_UPGRADE phase due to: Table 'LINKS' has no primary key
	at com.atlassian.confluence.upgrade.AbstractUpgradeManager.executeUpgradeStep(AbstractUpgradeManager.java:273)
	at com.atlassian.confluence.upgrade.AbstractUpgradeManager.runSchemaUpgradeTasks(AbstractUpgradeManager.java:217)
	at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:167)
	at com.atlassian.confluence.upgrade.UpgradeLauncherServletContextListener.contextInitialized(UpgradeLauncherServletContextListener.java:51)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

原因

There are two possible causes for this behavior:

  1. The constraint was previously removed while making changes to the database.
  2. The constraint was not added during a previous upgrade attempt.

ソリューション

  1. Restore your database from a working backup.
  2. Create a temporary Confluence instance that matches the version you restored to.
  3. Match the LINKS table from your Confluence with the LINKS table from the fresh installation.
  4. Shutdown your Confluence.
  5. データベースのバックアップを作成します。
  6. Add the missing constraints so the LINKS table in both instances match
  7. Confluence を起動します。
  8. Try upgrading again.
  9. If it fails again with a different table repeat the process to find out the missing constraints and fix them (AO tables can be ignored)

Since these steps involve multiple changes to the database, we strongly recommend using a DBA to assist in this task.

最終更新日: 2024 年 12 月 17 日

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

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