Import of Local Confluence 3.5 Documentation fails with SQLIntegrityConstraintViolationException
Asked by Mark Berry:

I tried to import a local copy of the Confluence 3.5 Downloadable Documentation as described here:

<http://confluence.atlassian.com/display/ALLDOC/Confluence+Documentation+Directory>

I tried this with the Confluence 3.5 XML ZIP:

<http://confluence.atlassian.com/download/attachments/12877996/Confluence+3.5+Complete+Documentation+%28XML%29+DOC-20110317.zip>

and also with the 3.5.13 version uploaded on Dec 01 2011:

<http://confluence.atlassian.com/download/attachments/12877996/Confluence+3.5.13+Complete+Documentation+%28XML%29+DOC-174041-2.xml.zip>

I unchecked 'Build index file' and attempted to Restore from the local file system

In both cases, the import failed with a SQLIntegrityConstraintViolationException:

Import failed. Check your server logs for more information. Hibernate operation: could not insert: [com.atlassian.confluence.pages.Page#101581597](http://tracking.nottingham.ac.uk/browse/WORKSPACE-69?focusedCommentId=11501#101581597); SQL \[\]; ORA-00001: unique constraint (CONFLUENCE.SYS_C0021372) violated ; nested exception is java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (CONFLUENCE.SYS_C0021372) violated

Log file says:

com.atlassian.confluence.importexport.ImportExportException: Unable to complete import because the data does not match the constraints in the Confluence schema. Cause: SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (CONFLUENCE.BANDANA_UNIQUE_KEY) violated

There is a post on Oct 14 2011 on this page from another user suggesting that the Confluence 3.5 XML ZIP file is corrupt:

<http://confluence.atlassian.com/display/ALLDOC/Confluence+Documentation+Directory>

We use Oracle for our database, which is where the errors are being thrown from, so I'm wondering whether these files really are corrupt, or whether, perhaps, there's some aspect of our Oracle config that's responsible for this problem.

We are using Confluence 3.5.9.


Answers:
author: hsuhailah
body: The original XML zip file was corrupted and I have raised this up before at: <https://jira.atlassian.com/browse/CONF-23634>

My colleague has updated a working XML file on Dec 01, 2011 and that file should be working however you will need to delete the existing Confluence 3.5 Documentation space that has failed from being imported successfully (if any) before importing this file once again.

comments: author: Mark Berry
body: Thanks Hanis, I now see that the corrupt documentation space was indeed in place, I deleted it and the import of the Dec 01 2011 version worked rather better this time. The import of that version stalled at 90% complete, so I'm going to delete it again and try it again in case it really didn't install completely. I'll update here if I still can't get it to install properly.

The corrupt version of the XML file is still in place on the Confluence Documentation Directory page; although the fixed version is also there, the corrupt version is the obvious one to choose. Shouldn't that corrupt file be removed from that page? It would have saved me a lot of time and effort if it had been...


author: hsuhailah
body: Hey Mark,

So how does it goes with my last comment/suggestion in the support ticket? Hope all goes well now.


author: Mark Berry
body: I did manage to get this working in the end, by importing the later version of this file. I understand that the corrupt version of the file has now been removed from the Confluence Documentation Directory page, but I haven't confirmed that.

Note that the apparent stalling of the imports at 90% is just an error in the progress bar; although the import appears incomplete, when checking the imported space it's actually imported intact.

Apologies for the delay in closing this issue; I closed the separate Support Ticket but wasn't aware that this question had remained open.