Project import fails with NumberFormatException in Jira Server/Data Center

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

問題

When importing a Jira Software project, the import fails and the following error is displayed in the logs (atlassian-jira.log):

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)
(...)

原因

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 - Getting issue details... STATUS

調査

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:

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

Query 2 (PostgreSQL)
-- 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)
-- 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);


ソリューション

データベースの変更を行う場合は必ず事前にバックアップを取得してください。可能な場合は、まずステージング サーバーで SQL コマンドの変更、挿入、更新、または削除を行うようにします。

  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)
    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)
    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.


最終更新日 2022 年 8 月 17 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.