Space XML Import Fails with Violation of PRIMARY KEY Constraint in OS_PROPERTYENTRY Related to Third Party Plugin Class

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Problem

Importing Space XML backup fails with the following errors seen in the UI

Import failed. Check your server logs for more information. com.atlassian.confluence.importexport.ImportExportException: Unable to complete import: could not insert: [bucket.user.propertyset.BucketPropertySetItem#BucketPropertySetItem[entityId=175966075,entityName=confluence_ContentEntityObject,key=net.customware.confluence.plugin.toc:cached:1,type=6,boolean=false,string=,text=


Similarly, the following error logs appears in the atlassian-confluence.log:

2016-02-28 16:40:35,509 ERROR [Long running task: Importing data] [sf.hibernate.util.JDBCExceptionReporter] logExceptions Violation of PRIMARY KEY constraint 'PK_OS_PROPERTYENTRY_7C3A67EB'. Cannot insert duplicate key in object 'dbo.OS_PROPERTYENTRY'. The duplicate key value is (confluence_ContentEntityObject, 199343510, com.adaptavist.bubbles.forum.FORUM_TOPIC_PAGE).

As we can seem this error seems to be related to the class com.adaptavist.bubbles.forum.FORUM_TOPIC_PAGE or Community Bubbles Plugin by Adaptavist. This plugin has been discontinued since the release of confluence 5.0.

Other observed errors are:

  1. Related to the class net.customware.confluence.plugin.toc. This plugin is no longer available as it has been upgraded to Table Of Contents plugin.

    Caused by: java.sql.SQLException: Violation of PRIMARY KEY constraint 'PK__OS_PROPERTYENTRY__7C3A67EB'. Cannot insert duplicate key in object 'dbo.OS_PROPERTYENTRY'. The duplicate key value is (confluence_ContentEntityObject, 175966075, net.customware.confluence.plugin.toc:cached:1).
  2. Related to the class "socialbookmarkingurl". This plugin no longer available in Atlassian Marketplace

    Caused by: java.sql.SQLException: Violation of PRIMARY KEY constraint 'PK__OS_PROPERTYENTRY__7C3A67EB'. Cannot insert duplicate key in object 'dbo.OS_PROPERTYENTRY'. The duplicate key value is (confluence_ContentEntityObject, 175966193, socialbookmarkingurl).

If the error is related to the class "confluence.inline.tasks.sequence.last":

Caused by: java.sql.SQLException: Violation of PRIMARY KEY constraint 'PK__OS_PROPERTYENTRY__7C3A67EB'. Cannot insert duplicate key in object 'dbo.OS_PROPERTYENTRY'. The duplicate key value is (confluence_ContentEntityObject, 175966193, confluence.inline.tasks.sequence.last,type=5,boolean=false,string=2,text=,int=0,double=0.0,long=0,date=).

Do not proceed with this documentation and contact Atlassian Support instead. This is because "confluence.inline.tasks.sequence.last" is confluence bundled plugin and deleting might result in data loss with some inline tasks.

Cause

This issue is caused by slightly corrupted database. These data in the database are caches that should have been deleted when upgrading the plugins mentioned above.

Diagnosis

Make sure the third party plugins mentioned in the error logs does not exist anymore in the instance.

If none of the offending third party present, continue with Resolution

Resolution

  1. Shut down the source Confluence instance 
  2. Run the following SQL query:

    DELETE FROM OS_PROPERTYENTRY WHERE entity_key = '<confluence_entity_key>';

    Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

  3. Once those entries are removed, followed by a full cache flush in Confluence Admin >> Cache Statistics >> Flush All. Proceed with generating the XML export again.

Replace the '<confluence_entity_key>' with the entity key that the error mentioned. For example:

DELETE FROM OS_PROPERTYENTRY WHERE entity_key = 'net.customware.confluence.plugin.toc';
DELETE FROM OS_PROPERTYENTRY WHERE entity_key = 'com.adaptavist.bubbles.forum.FORUM_TOPIC_PAGE';
DELETE FROM OS_PROPERTYENTRY WHERE entity_key = 'socialbookmarkingurl';

Last modified on Nov 14, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.