Cloud backup fails to restore in JIRA Server with NumberFormatException

XMLWordPrintable

    • 21
    • Severity 2 - Major
    • 16

      NOTE: This bug report is for JIRA Cloud. Using JIRA Server? See the corresponding bug report.

      Summary

      When restoring a JIRA Cloud backup into JIRA Server a NumberFormatException error is thrown in the logs, failing to import AO tables.

      Steps to Reproduce

      Restore a JIRA Cloud backup into JIRA Server

      Expected Results

      Backup is restored successfully

      Actual Results

      Backup created by JIRA Cloud is not escaping backslashes correctly, causing the import to expect an html code after the backslashes

      The following error is thrown in the logs

      2016-10-11 10:34:00,491 JiraImportTaskExecutionThread-1 INFO anonymous 633x26x1 kyp0t 127.0.0.1 /secure/SetupImport.jspa [c.a.j.bc.dataimport.DefaultDataImportService] Importing data is 90% complete...
      2016-10-11 10:34:01,006 JiraImportTaskExecutionThread-1 INFO anonymous 633x26x1 kyp0t 127.0.0.1 /secure/SetupImport.jspa [c.a.j.bc.dataimport.DefaultDataImportService] Finished storing Generic Values.
      2016-10-11 10:34:01,078 JiraImportTaskExecutionThread-1 DEBUG anonymous 633x26x1 kyp0t 127.0.0.1 /secure/SetupImport.jspa [c.a.activeobjects.osgi.ActiveObjectsServiceFactory] startCleaning
      2016-10-11 10:34:01,085 JiraImportTaskExecutionThread-1 DEBUG anonymous 633x26x1 kyp0t 127.0.0.1 /secure/SetupImport.jspa [c.a.activeobjects.osgi.ActiveObjectsServiceFactory] stopCleaning
      2016-10-11 10:34:04,064 JiraImportTaskExecutionThread-1 ERROR anonymous 633x26x1 kyp0t 127.0.0.1 /secure/SetupImport.jspa [c.a.j.bc.dataimport.DefaultDataImportService] Error importing data: java.lang.NumberFormatException: For input string: "olle"
      java.lang.NumberFormatException: For input string: "olle"
       at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
       at java.lang.Integer.parseInt(Integer.java:580)
       at com.atlassian.dbexporter.node.stax.StaxUtils.unicodeDecode(StaxUtils.java:103)
       at com.atlassian.dbexporter.node.stax.StaxStreamReader$1.getContentAsString(StaxStreamReader.java:125)
       at com.atlassian.dbexporter.importer.DataImporter$BaseInserter.setValue(DataImporter.java:354)
       at com.atlassian.dbexporter.importer.DataImporter.importTable(DataImporter.java:112)
       at com.atlassian.dbexporter.importer.DataImporter.access$000(DataImporter.java:41)
       at com.atlassian.dbexporter.importer.DataImporter$1.call(DataImporter.java:71)
       at com.atlassian.dbexporter.importer.DataImporter$1.call(DataImporter.java:64)
       at com.atlassian.dbexporter.jdbc.JdbcUtils.withConnection(JdbcUtils.java:28)
       at com.atlassian.dbexporter.importer.DataImporter.doImportNode(DataImporter.java:64)
       at com.atlassian.dbexporter.importer.AbstractImporter.importNode(AbstractImporter.java:44)
       at com.atlassian.dbexporter.DbImporter.importData(DbImporter.java:69)
       at com.atlassian.activeobjects.backup.ActiveObjectsBackup.restore(ActiveObjectsBackup.java:151)
       at com.atlassian.jira.bc.dataimport.DefaultDataImportService.restoreActiveObjects(DefaultDataImportService.java:554)
       at com.atlassian.jira.bc.dataimport.DefaultDataImportService.performImport(DefaultDataImportService.java:728)
       at com.atlassian.jira.bc.dataimport.DefaultDataImportService.doImport(DefaultDataImportService.java:324)
       at com.atlassian.jira.web.action.setup.DataImportAsyncCommand.call(DataImportAsyncCommand.java:60)
       at com.atlassian.jira.web.action.setup.DataImportAsyncCommand.call(DataImportAsyncCommand.java:28)
       at com.atlassian.jira.task.ImportTaskManagerImpl$TaskCallableDecorator.call(ImportTaskManagerImpl.java:157)
       at com.atlassian.jira.task.ImportTaskManagerImpl$TaskCallableDecorator.call(ImportTaskManagerImpl.java:133)
       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 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
       at java.lang.Thread.run(Thread.java:745)
      2016-10-11 10:34:04,074 JiraImportTaskExecutionThread-1 WARN anonymous 633x26x1 kyp0t 127.0.0.1 /secure/SetupImport.jspa [c.a.j.p.d.dao.impl.CachingOrganizationDaoImpl] onImportCompleted - clearing cache !!
      2016-10-11 10:34:04,079 JiraImportTaskExecutionThread-1 INFO anonymous 633x26x1 kyp0t 127.0.0.1 /secure/SetupImport.jspa [c.a.j.bc.dataimport.DefaultDataImportService] Importing data is 100% complete...
      
      
      

      On this case, we had the following row causing problems in the activeobjects.xml file.

      <row>
       <integer>3444</integer>
       <integer>7409</integer>
       <string>excerpt</string>
       <string>'Collect status' column has been commented out on Views\Collectors\Index.cshtml</string>
       </row>
      
      
      

       

      Workaround

      Add a second backslash to the activeobjects.xml file to escape the one already present like the following, zip the activeobjects.xml and exntities.xml file back and restore JIRA again. We wrote a script to automate this details in this comment

      <row>
       <integer>3444</integer>
       <integer>7409</integer>
       <string>excerpt</string>
       <string>'Collect status' column has been commented out on Views\\Collectors\\Index.cshtml</string>
       </row>
      
      
      

      You should be able to find the problematic row to edit using a regex similar to the following replacing the "olle" part with the one in the error thrown

      \\.olle
      

            Assignee:
            Unassigned
            Reporter:
            Marcus Silveira
            Votes:
            3 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              Resolved: