Confluence 6 针对 key "cp_" 或 "cps_" 的 "Duplicate Entry" 问题解决

简介: 如果你遇到了下面的错误信息,例如:com.atlassian.confluence.importexport.ImportExportException: Unable to complete import becaus...

如果你遇到了下面的错误信息,例如:

com.atlassian.confluence.importexport.ImportExportException: Unable to complete import because the data does not match the constraints in the Confluence schema. Cause: MySQLIntegrityConstraintViolationException: Duplicate entry '1475804-Edit' for key 'cps_unique_type'

上面表示在 XML 的备份文件中恢复的数据库没有正确的权限,通常是因为使用了第三方的插件的原因。这个问题在 Confluence 3.5.2 的后续版本中已经修复了,请参考 CONF-22123 中的说明。如果你的版本已经是新的版本了,你的导出文件可能需要手动进行修改来删除掉重复权限实例,或者整个记录都需要被删除。下面的 SQL 可以被用来找到这个记录。

SELECT * FROM CONTENT_PERM WHERE USERNAME IS NULL AND GROUPNAME IS NULL ;
 
FROM CONTENT_PERM cp
WHERE cp.USERNAME IS NOT NULL AND cp.GROUPNAME IS NOT NULL ;
 
SELECT cps1.ID, cps1.CONTENT_ID, cps1.CONT_PERM_TYPE FROM CONTENT_PERM_SET cps1, CONTENT_PERM_SET cps2
WHERE cps1.ID <> cps2.ID AND
 
( SELECT scps.ID FROM CONTENT_PERM_SET scps WHERE scps.CONTENT_ID = cps.CONTENT_ID AND scps.CONT_PERM_TYPE = cp.CP_TYPE) AS suggested_cps_id
FROM CONTENT_PERM cp, CONTENT_PERM_SET cps
WHERE cp.CPS_ID = cps.ID AND
 
FROM CONTENT_PERM cp1, CONTENT_PERM_SET cps1, CONTENT_PERM cp2, CONTENT_PERM_SET cps2
WHERE
cp1.ID <> cp2.ID AND
 
FROM CONTENT_PERM cp1, CONTENT_PERM_SET cps1, CONTENT_PERM cp2, CONTENT_PERM_SET cps2
WHERE
cp1.ID <> cp2.ID AND
 
SELECT * FROM CONTENT_PERM_SET
WHERE ID NOT IN ( SELECT DISTINCT CPS_ID FROM CONTENT_PERM);

删除所有找到的记录,然后尝试重新导出。

 

https://www.cwiki.us/display/CONFLUENCEWIKI/Troubleshooting+XML+backups+that+fail+on+restore

目录
相关文章
|
8月前
|
Linux
Centos7使用man查找命令时,报错No manual entry for xxxx
Centos7使用man查找命令时,报错No manual entry for xxxx
179 0
|
7月前
|
Oracle 关系型数据库 Linux
Requirements for Installing Oracle Database/Client 19c on OL8 or RHEL8 64-bit (x86-64) (Doc ID 2668780.1)
Requirements for Installing Oracle Database/Client 19c on OL8 or RHEL8 64-bit (x86-64) (Doc ID 2668780.1)
57 0
|
8月前
|
关系型数据库 MySQL 数据库
Mysql-错误处理: Found option without preceding group in config file
Mysql-错误处理: Found option without preceding group in config file
874 0
|
Ubuntu Linux
No manual entry for ls解决办法
No manual entry for ls解决办法
|
数据可视化 关系型数据库 MySQL
MySql命令报错:Duplicate entry ‘10‘ for key ‘PRIMARY‘解决方案
MySql命令报错:Duplicate entry ‘10‘ for key ‘PRIMARY‘解决方案
647 0
SAP WM 批量修改Storage Bin的Storage Bin Type栏位值
SAP WM 批量修改Storage Bin的Storage Bin Type栏位值
SAP WM 批量修改Storage Bin的Storage Bin Type栏位值
SAP WM中阶Storage Type的Capacity Check – Check based on maximum quantity per bin in storage type.
SAP WM中阶Storage Type的Capacity Check – Check based on maximum quantity per bin in storage type.
SAP WM中阶Storage Type的Capacity Check – Check based on maximum quantity per bin in storage type.
|
关系型数据库 MySQL
MySQL - Duplicate entry for key PRIMARY
MySQL - Duplicate entry for key PRIMARY
335 0