Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-31404

Orphaned entries in the OS_PROPERTYENTRY table cause failure in space import

      NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.

      Orphaned entries should be removed from space export/OS_PROPERTYENTRY table otherwise space import would failed with the following error (for example):

      Caused by: com.atlassian.confluence.importexport.ImportExportException: Unable to complete import: Error while importing backup: could not insert: [bucket.user.propertyset.BucketPropertySetItem#BucketPropertySetItem[entityId=119570525,entityName=confluence_ContentEntityObject,key=net.customware.confluence.plugin.toc:cached:1,type=6,boolean=false,string=<null>,text=<div>
      
      com.atlassian.confluence.importexport.ImportExportException: Unable to complete import: Error while importing backup: could not insert: [bucket.user.propertyset.BucketPropertySetItem#BucketPropertySetItem[entityId=117440539,entityName=confluence_ContentEntityObject,key=isbookmark,type=5,boolean=false,string=<null>,text=<null>,int=0,double=0.0,long=0,date=<null>]]
      

      Logs also show:

      Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "os_propertyentry_pkey"
      Workaround:

      As a precaution measure, backup the database before making any changes.

      1. Run the following queries to identify the orphaned entries in Confluence database:
        SELECT * FROM OS_PROPERTYENTRY WHERE entity_key LIKE '%net.customware.confluence.plugin.toc%';
        
        SELECT
            *
        FROM
            OS_PROPERTYENTRY
        WHERE
            OS_PROPERTYENTRY.entity_name='confluence_ContentEntityObject'
        AND OS_PROPERTYENTRY.entity_id NOT IN
            (
                SELECT
                    CONTENTID
                FROM
                    CONTENT)
                    order by 2,3;
        

        If the queries above returned a result, proceed with the following:

      2. Shut down Confluence
      3. The queries to delete the orphaned entries from the database:
        DELETE FROM OS_PROPERTYENTRY WHERE entity_key LIKE '%net.customware.confluence.plugin.toc%';
        

        Note that this query is an example and refers to the entity_key value referred to in the error mentioned earlier. Depending on the imported os_propertyentry data, it may be required to remove entries with a different key.

        DELETE
        FROM
            OS_PROPERTYENTRY
        WHERE
            OS_PROPERTYENTRY.entity_name='confluence_ContentEntityObject'
        AND OS_PROPERTYENTRY.entity_id NOT IN
            (
                SELECT
                    CONTENTID
                FROM
                    CONTENT);
        
      4. Start Confluence
      5. Restore the space backup (make sure there is no identical space key exist before the restoration)

        1. uploadError.PNG
          53 kB
          Service Informatique Studyrama

            [CONFSERVER-31404] Orphaned entries in the OS_PROPERTYENTRY table cause failure in space import

            MichaelL added a comment -

            Should the queries be run on the Confluence system which contains the spaces to be exported?  Or should it be run on the Confluence system where the exported spaces are being imported?  Or on both?

            MichaelL added a comment - Should the queries be run on the Confluence system which contains the spaces to be exported?  Or should it be run on the Confluence system where the exported spaces are being imported?  Or on both?

            A fix for this issue is now available for Confluence Server customers.

            Upgrade now or check out the Release Notes to see what other issues are resolved.

            Feng Xu (Inactive) added a comment - A fix for this issue is now available for Confluence Server customers. Upgrade now or check out the Release Notes to see what other issues are resolved.

            Hi,

            Thank you for the answer.
            The issue has been solved a few month ago installing the last jira version and importing our database.

            Thanks for your help.
            Thierry

            Service Informatique Studyrama added a comment - Hi, Thank you for the answer. The issue has been solved a few month ago installing the last jira version and importing our database. Thanks for your help. Thierry

            Hi everyone,

            This issue looks like the one I get and I need someone to confirm that I can apply this solution.
            When uploading any file in my 5.8.8 confluence recently upgraded from v3 to v5, I get the issue shown in the attached file

            I have run the 2 request that retrurn 566 and 487 lines respectively.
            It is a lot and I do not want to crash my confluence.

            Does anyone can help me and confirm I can apply the delete requests listed here ?

            Thanks in advance for help

            Best regards
            Thierry

            Service Informatique Studyrama added a comment - - edited Hi everyone, This issue looks like the one I get and I need someone to confirm that I can apply this solution. When uploading any file in my 5.8.8 confluence recently upgraded from v3 to v5, I get the issue shown in the attached file I have run the 2 request that retrurn 566 and 487 lines respectively. It is a lot and I do not want to crash my confluence. Does anyone can help me and confirm I can apply the delete requests listed here ? Thanks in advance for help Best regards Thierry

            Thanks for addressing bug #2!
            From the SQL I glean this is a general DB consistency issue – wherever it may stem from.
            Could you do me the favor and make sure this gets documented somewhere (in a KB article)?! It always p...es me endlessly if I can´t find such code to remedy things. We saw the records in the staging DB, but din´t know how to get rid of it, possibly trashing the DB!

            Guenter Huber added a comment - Thanks for addressing bug #2! From the SQL I glean this is a general DB consistency issue – wherever it may stem from. Could you do me the favor and make sure this gets documented somewhere (in a KB article)?! It always p...es me endlessly if I can´t find such code to remedy things. We saw the records in the staging DB, but din´t know how to get rid of it, possibly trashing the DB!

              qpham@atlassian.com Quan Pham
              hsuhailah Hanis Suhailah (Inactive)
              Affected customers:
              9 This affects my team
              Watchers:
              28 Start watching this issue

                Created:
                Updated:
                Resolved: