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.
回避策
- Follow the instructions to enable Enabling Detailed SQL Logging
- Attempt the Space import
- Confluence を停止します。
- Find the INSERT query that is causing the unique constraint violation
- Note the banadanacontext and bandanakey values being set
Delete whatever entry already exists:
delete from BANDANA where BANDANACONTEXT = '<BANDANACONTEXT-value-from-insert-query>' and BANDANAKEY = '<BANDANAKEY-value-from-insert-query>';
- Confluence を起動します。
- Attempt the Space import (repeat as needed)
最終更新日 2017 年 8 月 28 日
Powered by Confluence and Scroll Viewport.