CSP-9363 - Failed to create a daily backup

Product: Confluence

Environment

Operating System  
Affect Version/s 2.3.3
JVM  
Database  
Application Server  

Error Message

com.atlassian.confluence.importexport.ImportExportException: Couldn't
backup database data. at
com.atlassian.confluence.importexport.impl.AbstractXmlExporter.backupEnt
ities(AbstractXmlExporter.java:181) at
com.atlassian.confluence.importexport.impl.AbstractXmlExporter.backupEve
rything(AbstractXmlExporter.java:85) at
com.atlassian.confluence.importexport.impl.FileXmlExporter.backupEveryth
ing(FileXmlExporter.java:73) at
com.atlassian.confluence.importexport.impl.AbstractXmlExporter.doExport(
AbstractXmlExporter.java:78) at
com.atlassian.confluence.importexport.impl.FileXmlExporter.doExport(File
XmlExporter.java:40) at
com.atlassian.confluence.importexport.DefaultImportExportManager.exportA
s(DefaultImportExportManager.java:111) at

Symptom

Could not create a manual backup as well.

Diagnostics/Test

The logs contained the "net.sf.hibernate.ObjectNotFoundException.throwIfNull(ObjectNotFoundException.java:24)" error. Asked the customer to provide a backup of his database to locate the NULL object that was causing the problem

Root Cause

There were references to NULL objects in the database that were causing the XML backup failure. The problem was caused due to some "external links" which were still referencing two non-existing pages in Confluence.

Solution

Tried debugging the exact table that was causing the problem by referring to the logs and by enabling detailed hibernate logging and then using this guide to locate the table that was having a reference to a NULL object.
Executed the following query on the table:

delete from extrnlnks where contentid = <somevale>

where "somevalue" is the value pointed in the error logs. This is the ID that was pointing to a non-existing page.

Labels