Confluence Space import fails due to 'duplicate key value violates unique constraint' error

お困りですか?

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

コミュニティに質問

問題

When importing a Space into Confluence, the import fails due to a duplicate key error.

atlassian-confluence.log ファイルに次の情報が表示されます。

Import failed. Check your server logs for more information. com.atlassian.confluence.importexport.ImportExportException: Unable to complete import because the data does not match the constraints in the Confluence schema. Cause: PSQLException: ERROR: duplicate key value violates unique constraint "bandana_unique_key"

原因

This behavior is caused by entries already existing within the Confluence database that would be duplicated by the import. 

The Confluence 'bandana' table has the following unique key constraint:

"bandana_unique_key" UNIQUE CONSTRAINT, btree (bandanacontext, bandanakey)

There are multiple possible causes for this constraint to be violated.

回避策

  1. Follow the instructions to enable Enabling Detailed SQL Logging
  2. Attempt the Space import
  3. Confluence を停止します。
  4. Find the INSERT query that is causing the unique constraint violation
    • Note the banadanacontext and bandanakey values being set
  5. Delete whatever entry already exists:

    delete from BANDANA
    where BANDANACONTEXT = '<BANDANACONTEXT-value-from-insert-query>' and BANDANAKEY = '<BANDANAKEY-value-from-insert-query>';

  6. Confluence を起動します。
  7. Attempt the Space import (repeat as needed)

 

最終更新日 2017 年 8 月 28 日

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

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