Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-38993

Space Export With Special Characters Increases String Length, causing the Space Import to Fail

XMLWordPrintable

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

      Summary

      Whenever a user inserts special characters as content in Confluence, and an inline comment is created from that content, the resulting Space Export will convert the special characters and the resulting string in the entities.xml import will be greater than the original string. If the original string was close to 255 characters, the 'converted' string will be greater than 255 characters and the import will fails 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 inline comment 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 space export does not add characters for special characters.

      Notes

      For the error to be replicated in an import, the original string 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

      Edit the inlie comment to be shorter/remove the special characters. Alternatively, you can edit the entities.xml file and shorten the inline comment there to be less than 255 characters.

              pwallach Phil Wallach
              ajean Andy J.
              Votes:
              5 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: