错误多是由于数据库忽然不可访问而产生。若是你在你的日志中看到了错误 'Couldn't backup database data' ,这个指南将会帮助你更正这个错误。咱们强烈推荐你备份 Confluence 数据库和 Confluence 的 home 目录这种备份方式来备份你的 Confluence 服务器。你可使用 Restoring Data from other Backups 的方法来恢复你的备份,若是须要的话。若是你对数据库 SQL 并不熟悉的话,咱们建议你联系你的数据库管理员来得到相关的帮助。java
Production Backup Strategy 备份方案是完美而且最有效的备份方案。若是你在备份 XML 方式遇到了问题,无论是由于内存溢出仍是下面描述的问题,咱们建议你使用 SQL 的备份方案为你可选的备份方案。sql
但愿找到数据库备份的错误或者中断的缘由,修改状态信息的日志,可以让你得到更多的有用的信息,而后根据日志修改每个数据库的配置:数据库
my_confluence_install/confluence/WEB-INF/classes/log4j.properties
而后在文件的后面添加下面的行,并保存。
log4j.logger.com.atlassian.confluence.importexport.impl.XMLDatabinder=DEBUG, confluencelog
log4j.additivity.com.atlassian.confluence.importexport.impl.XMLDatabinder=
false
|
confluence-home/logs/atlassian-confluence.log
,并滚动到文件的末尾。01 2005-08-24 00:00:33,743 DEBUG [DOCPRIV2:confluence.importexport.impl.XMLDatabinder] Writing object: com.atlassian.confluence.core.ContentPermission with ID: 5 to XML. 02 2005-08-24 00:00:33,743 DEBUG [DOCPRIV2:confluence.importexport.impl.XMLDatabinder] Writing property: type 03 2005-08-24 00:00:33,743 DEBUG [DOCPRIV2:confluence.importexport.impl.XMLDatabinder] Writing property: group 04 2005-08-24 00:00:33,743 DEBUG [DOCPRIV2:confluence.importexport.impl.XMLDatabinder] Writing property: expiry 05 2005-08-24 00:00:33,743 DEBUG [DOCPRIV2:confluence.importexport.impl.XMLDatabinder] Writing property: content 06 [DOCPRIV2:ERROR] LazyInitializer - Exception initializing proxy <net.sf.hibernate.ObjectNotFoundException: No row with the given identifier exists: 2535, 07 of class: com.atlassian.confluence.core.ContentEntityObject>net.sf.hibernate.ObjectNotFoundException: 08 No row with the given identifier exists: 2535, of class: com.atlassian.confluence.core.ContentEntityObject 09 at net.sf.hibernate.ObjectNotFoundException.throwIfNull(ObjectNotFoundException.java:24) 10 at net.sf.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:1946) 11 at net.sf.hibernate.proxy.LazyInitializer.initialize(LazyInitializer.java:53) 12 at net.sf.hibernate.proxy.LazyInitializer.initializeWrapExceptions(LazyInitializer.java:60) 13 at net.sf.hibernate.proxy.LazyInitializer.getImplementation(LazyInitializer.java:164) 14 at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:108) 15 at com.atlassian.confluence.core.ContentEntityObject$$EnhancerByCGLIB$$cc2f5557.hashCode(<generated>) 16 at java.util.HashMap.hash(HashMap.java:261) 17 at java.util.HashMap.containsKey(HashMap.java:339) 18 at com.atlassian.confluence.importexport.impl.XMLDatabinder.toGenericXML(XMLDatabinder.java:155)
catalina.out
,找到的异常的第一行。这里有错误说是在写入 ContentPermission
id 为 5 的对象到 XML 的时候出现了错误。换句话说,这个意思就是在主键为 5 的行须要更正,这个在表 CONTENTLOCK 中。但愿找到数据库中是哪一个表的那个对象,下面对应了内容存储的表:CONTENT
(line 5) 的值 2535
(line 6)。如今你已经知道了列和值。值 2535
为一个一个再也不存在的实体 ID。若是你在备份的时候遇到了下面的错误:服务器
could not insert: [bucket.user.propertyset.BucketPropertySetItem#bucket.user.propertyset.BucketPropertySetItem@a70067d3]; SQL []; Violation of PRIMARY KEY constraint 'PK_OS_PROPERTYENTRY314D4EA8'. Cannot insert duplicate key in object 'OS_PROPERTYENTRY'.; nested exception is java.sql.SQLException: Violation of PRIMARY KEY constraint 'PKOS_PROPERTYENTRY_314D4EA8'. Cannot insert duplicate key in object 'OS_PROPERTYENTRY'.
这个错误信息说的是定义为'PK_OS_PROPERTYENTRY_314D4EA8' 的主键在表 'OS_PROPERTYENTRY' 中重复了。
你能够在 'OS_PROPERTYENTRY' 表中找到 'PK_OS_PROPERTYENTRY_314D4EA8' 中定义的主键,而后找到重复的值后删除重复的值。须要肯定 "PRIMARY KEY" 必须保持不重复。一个能够找到 'OS_PROPERTYENTRY' 表中是否有重复主键的 SQL 以下:eclipse
SELECT ENTITY_NAME,ENTITY_ID,ENTITY_KEY,COUNT(*) FROM OS_PROPERTYENTRY GROUP BY ENTITY_NAME,ENTITY_ID,ENTITY_KEY HAVING COUNT(*)>1
https://www.cwiki.us/display/CONFLUENCEWIKI/Troubleshooting+failed+XML+site+backupsjsp