Project import fails with NumberFormatException in Jira Server/Data Center

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

When importing a Jira Software project, the import fails and the following error is displayed in the logs (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 2016-04-01 01:47:03,483 JiraTaskExectionThread-6 ERROR username 103x3090x1 13tcomw 195.xxx.xxx.xxx,127.0.0.1 /secure/admin/ProjectImportSummary.jspa [c.a.j.imports.xml.DefaultBackupXmlParser] Unexpected import failure java.lang.NumberFormatException: null at java.lang.Long.parseLong(Unknown Source) at java.lang.Long.valueOf(Unknown Source) at com.atlassian.greenhopper.imports.SprintImportHandler.endTable(SprintImportHandler.java:105) at com.atlassian.jira.imports.project.ao.handler.ChainedAoSaxHandler.endTable(ChainedAoSaxHandler.java:260) at com.atlassian.jira.imports.project.ao.handler.ChainedAoSaxHandler.endElement(ChainedAoSaxHandler.java:187) 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.importAoData(DefaultProjectImportManager.java:708) at com.atlassian.jira.imports.project.DefaultProjectImportManager.doImport(DefaultProjectImportManager.java:656) at com.atlassian.jira.bc.imports.project.DefaultProjectImportService.doImport(DefaultProjectImportService.java:416) at com.atlassian.jira.web.action.admin.importer.project.ProjectImportSummary$ProjectImportCallable.call(ProjectImportSummary.java:285) at com.atlassian.jira.web.action.admin.importer.project.ProjectImportSummary$ProjectImportCallable.call(ProjectImportSummary.java:236) at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:453) (...)

Cause

There are issues in the imported project which are included in Sprints that do not exist in the database anymore (in the AO_60DB71_SPRINT table).

JSWSERVER-16064 - JIRA should Check if Tickets are Referencing a Sprint that does not Exist

Investigation

Run the following query in the source instance's database (the Jira Software instance where the XML Backup was taken) to find the affected entries:

ℹ️The queries below were tested for PostgreSQL and MySQL, you would need to find the corresponding query for your database type

Query 2 (PostgreSQL)

1 2 3 4 -- List all references to the nonexistent Sprints SELECT * FROM customfieldvalue WHERE customfield = (SELECT ID FROM customfield WHERE customfieldtypekey LIKE '%com.pyxis.greenhopper.jira:gh-sprint%') AND CAST(stringvalue as int) NOT IN (SELECT "ID" FROM "AO_60DB71_SPRINT");

Query 2 (MySQL)

1 2 3 4 -- List all references to the nonexistent Sprints SELECT * FROM customfieldvalue WHERE customfield = (SELECT ID FROM customfield WHERE customfieldtypekey LIKE '%com.pyxis.greenhopper.jira:gh-sprint%') AND stringvalue NOT IN (SELECT ID FROM AO_60DB71_SPRINT);

Resolution

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.

  1. Stop your Jira Software source instance.

  2. Run the SQL query below in the database to delete the invalid Sprint references:

    Query 3 (PostgreSQL)

    1 2 3 DELETE FROM customfieldvalue WHERE customfield = (SELECT ID FROM customfield WHERE customfieldtypekey LIKE '%com.pyxis.greenhopper.jira:gh-sprint%') AND CAST(stringvalue AS int) NOT IN (SELECT "ID" FROM "AO_60DB71_SPRINT");

    Query 3 (MySQL)

    1 2 3 DELETE FROM customfieldvalue WHERE customfield = (SELECT ID FROM customfield WHERE customfieldtypekey LIKE '%com.pyxis.greenhopper.jira:gh-sprint%') AND stringvalue NOT IN (SELECT ID FROM AO_60DB71_SPRINT);
  3. Start your Jira Software source instance.

  4. Generate a new XML Backup from the source instance and perform the Project Import in the target instance again.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.