XML restore fails with message "The processing instruction target matching "[xX][mM][lL]" is not allowed"
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
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.
*Fisheye および Crucible は除く
症状
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:
原因
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.
ソリューション
- Decompress the backup file;
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" ...
- Compress the backup file again and restart the XML restore.