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

Unable to complete import: An invalid XML character (Unicode: 0xffff) was found in the CDATA section

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

      Trying to import an XML backup into Confluence, we might have the below issue:

      Import failed. Check your server logs for more information. com.atlassian.confluence.importexport.ImportExportException: Unable to complete import: An invalid XML character (Unicode: 0xffff) was found in the CDATA section.
      

      Couldn't find the specific steps to reproduce it but certain XML backups have this issue. This has including been documented here:

      The entities.xml file, and can be fixed by

      1. Unzip the export zip file
      2. Run the below command on the entities.xml file:
        perl -i -pe 's/\xef\xbf\xbf//g' entities.xml
        
      3. Zip up the contents, making sure the root directory has entities.xml

      For Windows Users falling into the 0xFFFF problem - The Perl script and the .JAR File doesn't work for Windows, I couldn't understand the reason yet, however, I created a Power Shell script to fix it. Just run it in the Power Shell ISE or save it as a .PS file and execute it through PS. Here's the script:

      1. Don't forget to change the path of the yourfile entry below to have the PS script picking up the file from the correct place.
      2. Don't forget to change the path of the output file below to have the PS script saving the clean file in the correct place.
        $yourfile = "C:\Users\atlassian\Documents\Horlle\entities.xml"
        $outputfile = "C:\Users\atlassian\Documents\Horlle\entities_clean.xml"
        get-content -path $yourfile | out-file $outputfile -encoding utf8
        

            [CONFSERVER-38089] Unable to complete import: An invalid XML character (Unicode: 0xffff) was found in the CDATA section

            Mine is An invalid XML character (Unicode: 0x1c) was found in the CDATA section using Confluence 7.17.0. These are bugs in the backup process why has this not been fixed in both Jira & Confluence?

            Richard Minick added a comment - Mine is An invalid XML character (Unicode: 0x1c) was found in the CDATA section using Confluence 7.17.0. These are bugs in the backup process why has this not been fixed in both Jira & Confluence?

            Makes me loose faith in humanity in 7.19.1. Workaround does not work, my invalid character is 0xb.

            Kevin Suter added a comment - Makes me loose faith in humanity in 7.19.1. Workaround does not work, my invalid character is 0xb.

            just encountered the same issue in confluence 7.19.0

            Akshay Deshpande added a comment - just encountered the same issue in confluence 7.19.0

            Jay Kantaria added a comment - - edited

            Just encountered 7.14.1 Data Center.  Out of 68 space exported and imported one would not complete with this issue.

            Jay Kantaria added a comment - - edited Just encountered 7.14.1 Data Center.  Out of 68 space exported and imported one would not complete with this issue.

            Ruins my day in 7.13.1

            Maksym Berezhnyi added a comment - Ruins my day in 7.13.1

            David (K15t) added a comment - - edited

            Also reproducible in Confluence 7.12.0.

            David (K15t) added a comment - - edited Also reproducible in Confluence 7.12.0.

            We observe that also in 7.6.2

            Sinan Yildirim added a comment - We observe that also in 7.6.2

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

            Zhenhuan Zhou (Inactive) added a comment - A fix for this issue is available to Server and Data Center customers in Confluence 6.13.1 Upgrade now or check out the Release Notes to see what other issues are resolved.

            This issue was experienced in 6.5.1  Data was transferred from old (and previously upgraded) 6.5.1 server to a new install on a new server.

            The command line perl fix worked.

            Josiah Eubank added a comment - This issue was experienced in 6.5.1  Data was transferred from old (and previously upgraded) 6.5.1 server to a new install on a new server. The command line perl fix worked.

            Facing same issue..can someone tell me what can we delete from entities.xml manually 

            CLSA CorporateApplication added a comment - Facing same issue..can someone tell me what can we delete from entities.xml manually 

              lgrzyb lukasz
              lmaia Luiz Maia (Inactive)
              Affected customers:
              20 This affects my team
              Watchers:
              42 Start watching this issue

                Created:
                Updated:
                Resolved: