Restoring an XML Backup Fails due to Exception is org.xml.sax.SAXParseException

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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

Symptoms

Restoring or importing an xml backup fails, and the user may see the following error:

(Auto-migrated image: description temporarily unavailable)
(Auto-migrated image: description temporarily unavailable)

The following or a variation of it appears in the atlassian-jira.log:

1 2 3 4 5 6 7 8 [Fatal Error] :164021:3: The element type "CustomFieldValue" must be terminated by the matching end-tag "</CustomFieldValue>". 2013-02-07 13:43:15,954 JiraImportTaskExecutionThread-1 ERROR anonymous 823x14x1 fbaod1 0:0:0:0:0:0:0:1%0 /secure/SetupImport.jspa [jira.bc.dataimport.DefaultDataImportService] Error parsing export file: org.xml.sax.SAXParseException: The element type "CustomFieldValue" must be terminated by the matching end-tag "</CustomFieldValue>". org.xml.sax.SAXParseException: The element type "CustomFieldValue" must be terminated by the matching end-tag "</CustomFieldValue>". at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at com.atlassian.jira.bc.dataimport.DefaultDataImportService.parseXmlAndValidateBackupData(DefaultDataImportService.java:299) at com.atlassian.jira.bc.dataimport.DefaultDataImportService.doImport(DefaultDataImportService.java:229) at com.atlassian.jira.web.action.setup.DataImportAsyncCommand.call(DataImportAsyncCommand.java:65)

Cause

Jira can't parse the XML file due to an invalid tag closure. This causes a premature break in the file, and Jira can't complete the operation.

Workaround

Please try running an xml syntax checker of your choice on the entities.xml file from the backup zip.

Ensure that you create a copy of your backup first

For example, running xmllint on the entities.xml or activeobjects.xml file from the failed backup will report an error where an xml is broken.

1 2 xmllint --stream entities.xml xmllint --stream activeobjects.xml
1 2 3 4 5 [~/jira.5.2.5/jira/jirahome/import] xmllint --stream entities.xml entities.xml:164021: parser error : Opening and ending tag mismatch: CustomFieldValue line 1105 and entity-engine-xml </entity-engine-xml> ^ entities.xml:164022: parser error : Premature end of data in tag entity-engine-xml line 1013
  • From here, you can correct the broken tag as indicated in the syntax checker. In the above example, it means adding the tag: </entity-engine-xml>

  • Alternatively, you can backup your data and try importing again.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.