XML restore fails with message "The processing instruction target matching "[xX][mM][lL]" is not allowed"

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

While restoring an XML backup it errors out and the following appears in the atlassian-jira.log:

2013-10-22 09:55:30,988 JiraImportTaskExecutionThread-1 INFO admin 595x49x1 16ilmkn 127.0.0.1 /secure/admin/XmlRestore.jspa [jira.bc.dataimport.DefaultDataImportService] Start parsing XML with SAX Parser.
[Fatal Error] :1:7: The processing instruction target matching "[xX][mM][lL]" is not allowed.
2013-10-22 09:55:31,048 JiraImportTaskExecutionThread-1 ERROR admin 595x49x1 16ilmkn 127.0.0.1 /secure/admin/XmlRestore.jspa [jira.bc.dataimport.DefaultDataImportService] Error parsing export file: org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	...

Also, the following appears on the screen:

Cause

The XML backup can't start with blank spaces. According to the XML spec, you can't have anything at all before the XML prolog. Since we use XML declaration, the entities file must start with:

<?xml version="1.0" ...

In some cases, non-printing characters like the byte order mark (BOM) can cause trouble by taking up the first few bytes of a file.

Resolution

  1. Decompress the backup file;
  2. Open the entities.xml file in a text editor and remove anything blank space or any character in front of the following statement:

    <?xml version="1.0" ...
  3. Compress the backup file again and restart the XML restore.
Last modified on Mar 30, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.