Project Import of Software project fails with Unexpected import failure

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

Problem

While performing a project import , the project import fails.

The following or similar appear in the atlassian-jira.log

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 2016-01-28 21:17:46,155 JiraTaskExectionThread-3 DEBUG jira 1277x1055x1 1y08lty 127.0.0.1 /secure/admin/ProjectImportSelectProject.jspa [c.a.j.i.p.ao.handler.ChainedAoSaxHandler] Starting parsing Document with ChainedAoSaxHandler 2016-01-28 21:17:47,676 JiraTaskExectionThread-3 ERROR jira 1277x1055x1 1y08lty 127.0.0.1 /secure/admin/ProjectImportSelectProject.jspa [c.a.j.imports.xml.DefaultBackupXmlParser] Unexpected import failure java.lang.NullPointerException at com.atlassian.greenhopper.imports.LexorankPreImportHandler.addFieldMapping(LexorankPreImportHandler.java:94) at com.atlassian.greenhopper.imports.LexorankPreImportHandler.handleEntity(LexorankPreImportHandler.java:78) at com.atlassian.jira.imports.project.ao.handler.ChainedAoSaxHandler.endRow(ChainedAoSaxHandler.java:286) at com.atlassian.jira.imports.project.ao.handler.ChainedAoSaxHandler.endElement(ChainedAoSaxHandler.java:190) at com.atlassian.jira.imports.project.ao.handler.ChainedAoSaxHandler.endElement(ChainedAoSaxHandler.java:148) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at com.atlassian.security.xml.RestrictedXMLReader.parse(RestrictedXMLReader.java:103) at com.atlassian.jira.imports.xml.DefaultBackupXmlParser$XmlParser.parseXml(DefaultBackupXmlParser.java:115) at com.atlassian.jira.imports.xml.DefaultBackupXmlParser.parse(DefaultBackupXmlParser.java:64) at com.atlassian.jira.imports.xml.DefaultBackupXmlParser.parseXml(DefaultBackupXmlParser.java:52) at com.atlassian.jira.imports.xml.DefaultBackupXmlParser.parseAoBackupXml(DefaultBackupXmlParser.java:46) at com.atlassian.jira.imports.project.DefaultProjectImportManager.getAoProjectImportData(DefaultProjectImportManager.java:358) at com.atlassian.jira.imports.project.DefaultProjectImportManager.getProjectImportData(DefaultProjectImportManager.java:252) at com.atlassian.jira.bc.imports.project.DefaultProjectImportService.getProjectImportData(DefaultProjectImportService.java:578) at com.atlassian.jira.web.action.admin.importer.project.ProjectImportSelectProject$MappingResultCallable.call(ProjectImportSelectProject.java:252) at com.atlassian.jira.web.action.admin.importer.project.ProjectImportSelectProject$MappingResultCallable.call(ProjectImportSelectProject.java:233) at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:458) at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:426) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at com.atlassian.jira.task.ForkedThreadExecutor$ForkedRunnableDecorator.run(ForkedThreadExecutor.java:216) at java.lang.Thread.run(Thread.java:745) 2016-01-28 21:17:47,677 JiraTaskExectionThread-3 ERROR jira 1277x1055x1 1y08lty 127.0.0.1 /secure/admin/ProjectImportSelectProject.jspa [c.a.j.imports.project.DefaultProjectImportService] There was an unexpected problem processing the file '/opt/data/jira/import/jira-7.0.9.export.zip' when performing a project import.
1 2 3 2024-07-17 03:17:24,997+0000 JiraTaskExecutionThread-3 ERROR fabian.bracco [c.a.j.imports.xml.DefaultBackupXmlParser] Unexpected import failure java.lang.NullPointerException: Cannot invoke "com.atlassian.jira.imports.project.customfield.ExternalCustomFieldConfiguration.getCustomField()" because "customFieldConfiguration" is null at com.atlassian.greenhopper.imports.LexorankPreImportHandler.addFieldMapping(LexorankPreImportHandler.java:87)

The key information to look here is "com.atlassian.greenhopper.imports.LexorankPreImportHandler.addFieldMapping" - effectively the Project Importer is trying to map the source lexorank configuration to the target one and is failing to do so.

Cause

The rank values in the database (exported to activeobjects.xml) refer to a non-existing LexoRank field which causes the project import to fail.

This could be caused by the bug below, after removing duplicated LexoRank fields:

Resolution 1

This is tested on PostgreSQL and may need modifying for other DBMS such as Oracle or SQL Server.

Always back up your data before making any database modifications. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

  • Run the following SQL against the source JIRA's database to remove any orphaned rank values:

1 2 3 4 DELETE FROM "AO_60DB71_LEXORANK" WHERE "FIELD_ID" > 0 AND "FIELD_ID" NOT IN (SELECT id FROM customfield WHERE customfieldtypekey = 'com.pyxis.greenhopper.jira:gh-lexo-rank');
  • Lock and Reindex JIRA

  • Generate a new XML backup and use that for the project import

Resolution 2

This is tested on PostgreSQL and may need modifying for other DBMS such as Oracle or SQL Server.

Warning

Please note that Resolution 2 option is only valid if you do not have Advanced Roadmaps for Jira installed. Advanced Roadmaps for Jira saves its ranking information in the AO_60DB71_LEXORANK with large negative FIELD_ID values between the range of -859340285902835 and -123340285902321.

Deleting rank entries related to Advanced Roadmaps for Jira can break Advanced Roadmaps for Jira and prevent creation of any new Portfolio plans.

If none of the other Resolutions apply for you, but this one does and you have Advanced Roadmaps for Jira install, please contact Support.

  • If Resolution 1 does not work, another possibility is that the AO_60DB71_LEXORANK table contains multiple entries pointing to invalid rank fields, with the FIELD_ID indicated being a large negative number.

  • You can find them by using this SQL query:

    1 2 SELECT * FROM "AO_60DB71_LEXORANK" WHERE "FIELD_ID" < 0;

If the select statement returns more than a couple of rows and you do not have Advanced Roadmaps for Jira installed, do the following:

Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

It is important to do a backup of your database before the procedure as well as attempting a backup of the target instance before doing the System Restore

  1. Stop the source instance (where the XML Backup used for the project import was generated)

  2. Clean up the Lexorank table by executing the following SQL command (Please notice - this step will delete all ranking data for all issues in JIRA):

    1 DELETE FROM "AO_60DB71_LEXORANK";
  3. Obtain the Rank FIELD ID(s) from your database by running the following SQL query:

    1 SELECT * FROM customfield WHERE customfieldtypekey = 'com.pyxis.greenhopper.jira:gh-lexo-rank';
  4. Insert the initial lexorank markers by running the following SQL queries. Notice the <Rank FIELD_ID> will need to be replaced with the actual rank field id from your database (step 3 above). If there's more than one rank field, the markers will need to be inserted for all the rank fields)

    1 2 INSERT INTO "AO_60DB71_LEXORANK" ("ID", "FIELD_ID", "ISSUE_ID", "RANK", "TYPE") VALUES (DEFAULT, <Rank FIELD_ID>, -9223372036854775808, '0|000000:', 0); INSERT INTO "AO_60DB71_LEXORANK" ("ID", "FIELD_ID", "ISSUE_ID", "RANK", "TYPE") VALUES (DEFAULT, <Rank FIELD_ID>, 9223372036854775807, '0|zzzzzz:', 2);
  5. Start JIRA

  6. Run a full Reindex (JIRA Administration > System > Indexing), any of the available options will work.

  7. Generate a new XML backup

  8. Perform the Project Import in the target instance.

Resolution 3

In cases where neither Resolution 1 nor Resolution 2 are applicable, this problem has also been linked to the presence of duplicate Rank fields in Jira.

To identify and remove duplicate Rank fields, please refer to our knowledge base article Remove duplicate Rank fields in Jira server.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.