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

XML Exports containing special characters (like an Ellipsis) in Highlighted Inline Comments Increases String Length, causing the XML Import to Fail

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

      Summary

      Whenever a user inserts an ellipsis character (i.e. "…" which is three dots represented as a single character) as content in Confluence, and an inline comment is created from highlighting that content, the resulting Site Export (or Space Export containing comments) will convert the ellipsis to three separate period characters (i.e. 3 "." in a row). Thus, the resulting string in the entities.xml import will be longer in character count than the original string. If the original string was close to 255 characters, the 'converted' string will be greater than 255 characters. This causes subsequent attempts to import this data to fail with the following error:

       ERROR [Long running task: Importing data] [sf.hibernate.util.JDBCExceptionReporter] logExceptions Data truncation: Data too long for column 'STRINGVAL' at row 1

      or this one:

      Caused by: java.sql.BatchUpdateException: Batch entry 2 insert into CONTENTPROPERTIES (PROPERTYNAME, STRINGVAL, LONGVAL, DATEVAL, PROPERTYID) values ('inline-original-selection', 'typedef struct EthrLagGroupCbkEntryData{    EthrLagGroupLagLinkList ethrLagLinkList; /* List of LAG links */    EthrLagMemberSpeed ethrLagMemberSpeed;    EthrManualMacAddress ethrManualMacAddress;    ......    EthrLagSpared16 spareField1;    EthrLagSpared8...', NULL, NULL, XXXX) was aborted

      This error is dependant on the content you are making a comment from.

      Steps to Reproduce

      1. Log in to Confluence and create a new page
      2. Enter the following as text in the page
        typedef struct EthrLagGroupCbkEntryData
        {
            EthrLagGroupLagLinkList ethrLagLinkList; /* List of LAG links */
            EthrLagMemberSpeed ethrLagMemberSpeed;
            EthrManualMacAddress ethrManualMacAddress;
            ……
            EthrLagSpared16 spareField1;
            EthrLagSpared8
        
      3. highlight the content and wait for the inline comment icon to appear
      4. create an inline comment
      5. notice the string length for the highlighted text is less than 255 characters
      6. Perform a space export, selecting custom to include comments
      7. Once the zip is created, open the entities.xml and search for the inline comment
      8. Notice the new content is more than 255 characters
        typedef struct EthrLagGroupCbkEntryData{    EthrLagGroupLagLinkList ethrLagLinkList; /* List of LAG links */    EthrLagMemberSpeed ethrLagMemberSpeed;    EthrManualMacAddress ethrManualMacAddress;    ......    EthrLagSpared16 spareField1;    EthrLagSpared8
      9. This breaks the Space Import since the data column size for STRINGVAL is 255.

      Expected Results

      The export does not add characters to special characters like the ellipsis.

      Notes

      For the error to be replicated in an import, the original string for the highlighted text has to be close to 255 characters. If the string is not close, the conversion will not affect the import as it will remain under 255.

      Workaround

      Before exporting, delete the inline comments which are highlighting text which are close to 255 characters and contain the ellipsis character. Alternatively, you can edit the entities.xml file and shorten the inline comment there to be less than 255 characters.

            [CONFSERVER-38993] XML Exports containing special characters (like an Ellipsis) in Highlighted Inline Comments Increases String Length, causing the XML Import to Fail

            Quan Pham added a comment -

            A fix for this issue is available to Server and Data Center customers in Confluence 7.0.1
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            Quan Pham added a comment - A fix for this issue is available to Server and Data Center customers in Confluence 7.0.1 Upgrade now or check out the Release Notes to see what other issues are resolved.

            gpdavis added a comment -

            Hey, 

            When is this going to be released?

            gpdavis added a comment - Hey,  When is this going to be released?

            Hi,

             

            Just observed in 6.13.1.

             

            Deleted Account (Inactive) added a comment - Hi,   Just observed in 6.13.1.  

            6.8.1 is still affected

            Yevgen Lasman added a comment - 6.8.1 is still affected

            Whats' the ETA on resolving this? 

            Jacques Malette added a comment - Whats' the ETA on resolving this? 

            Hello Community, hello Attlassian,

            we run into the same problem on one of our customers systems.

            We think the bug is in all Confluence versions with installed "Confluence Inline Comments" plugin and inline comments where the selection is greater than 255 chars.

             

            You can reproduced the bug

            1. Connect Confluence as an admin.

            2. Export a space with a Inline-Comment-Selection >255 chars.

            3. Try to import this in a new Confluence instance.

            The import doesn't works. The log write something like this

                "ERROR: value too long for type character varying(255)"

             

            Workaround

            1. Modify the database entry CONTENTPROPERTIES from varchar(255) to varchar(256) or higher.

            2. Start the import.

            3. Search in the database all problem comments.

            SELECT * FROM `%DATABASENAME%`.CONTENTPROPERTIES WHERE LENGTH(STRINGVAL) > 255 ;

            4. Open the entities.xml and find the correct comment location and delete the last char before the "..." in the end.

            5. Start your import again with the modified entities.xml file.

             

            Resolution:

            In "Confluence Inline Comments" plugin:

                com.atlassian.confluence.plugins.inlinecomments.service.InlineCommentPropertyManager.java

            There is the truncate() method:

            private String truncate(String input){
            return StringUtils.abbreviate(StringUtils.trim(input), 255);
            }

            Overwrite the 255 to 254 and the problem should be solved.

             

            Best regards,

            Pascal 

             

            Pascal Offenhäusser (Scandio) added a comment - Hello Community, hello Attlassian, we run into the same problem on one of our customers systems. We think the bug is in all Confluence versions with installed "Confluence Inline Comments" plugin and inline comments where the selection is greater than 255 chars.   You can reproduced the bug 1. Connect Confluence as an admin. 2. Export a space with a Inline-Comment-Selection >255 chars. 3. Try to import this in a new Confluence instance. The import doesn't works. The log write something like this      "ERROR: value too long for type character varying(255)"   Workaround 1. Modify the database entry CONTENTPROPERTIES from varchar(255) to varchar(256) or higher. 2. Start the import. 3. Search in the database all problem comments. SELECT * FROM `%DATABASENAME%`.CONTENTPROPERTIES WHERE LENGTH(STRINGVAL) > 255 ; 4. Open the entities.xml and find the correct comment location and delete the last char before the "..." in the end. 5. Start your import again with the modified entities.xml file.   Resolution : In "Confluence Inline Comments" plugin:      com.atlassian.confluence.plugins.inlinecomments.service.InlineCommentPropertyManager.java There is the truncate() method: private String truncate( String input){ return StringUtils.abbreviate(StringUtils.trim(input), 255); } Overwrite the 255 to 254 and the problem should be solved.   Best regards, Pascal   

            I had this problem because the inline comment contained an ellipse symbol (…) The export converted the symbol to 3 dots.

            Jasper Knops added a comment - I had this problem because the inline comment contained an ellipse symbol (…) The export converted the symbol to 3 dots.

              lgrzyb lukasz
              ajean Andy J.
              Affected customers:
              22 This affects my team
              Watchers:
              34 Start watching this issue

                Created:
                Updated:
                Resolved: