Uploaded image for project: 'Jira Platform Cloud'
  1. Jira Platform Cloud
  2. JRACLOUD-68464

Importing from Cloud to an empty Server instance fails producing an NullPointerException

XMLWordPrintable

      Summary

      Importing from Cloud to an empty Server instance fails producing an NullPointerException

      Steps to Reproduce

      1. Export data from a cloud instance
      2. Set up or access a test Server instance (7.6.2 is fine to reproduce)
      3. Attempt to import the data

      Expected Results

      The import works without problems

      Actual Results

      The import stops at 90% and then fails producing an error. Tables appear to be partially generated during the process, so a new import requires deleting and recreating the application DB beforehand. If the import was made using the Setup Wizard during a fresh installation, the UI does not display any errors but users won't be able to login afterwards.

      The below exception is thrown in the catalina.log file:

      2018-01-03 16:49:56,678 JiraImportTaskExecutionThread-1 ERROR admin 1009x287x1 6z8rud 172.21.44.34 /secure/admin/XmlRestore.jspa [c.a.j.bc.dataimport.DefaultDataImportService] Error importing data: java.lang.NullPointerException
      java.lang.NullPointerException
      	at com.atlassian.activeobjects.backup.ActiveObjectsTableCreator.getTypeInfo(ActiveObjectsTableCreator.java:111)
      	at com.atlassian.activeobjects.backup.ActiveObjectsTableCreator.toDdlField(ActiveObjectsTableCreator.java:93)
      	at com.atlassian.activeobjects.backup.ActiveObjectsTableCreator.toDdlTable(ActiveObjectsTableCreator.java:83)
      	at com.atlassian.activeobjects.backup.ActiveObjectsTableCreator.create(ActiveObjectsTableCreator.java:70)
      	at com.atlassian.activeobjects.backup.ActiveObjectsTableCreator.create(ActiveObjectsTableCreator.java:57)
      	at com.atlassian.dbexporter.importer.TableDefinitionImporter.doImportNode(TableDefinitionImporter.java:50)
      	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(.java:584)
      	at com.atlassian.jira.bc.dataimport.DefaultDataImportService.performImport(DefaultDataImportService.java:758)
      	at com.atlassian.jira.bc.dataimport.DefaultDataImportService.doImport(DefaultDataImportService.java:331)
      	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:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      

      Workaround

      Manually removing all data relating to AO_575BF5 from activeobjects.xml allows the import to complete successfully:

      1. Extract the contents of the backup (zip) file.
      2. Using your preferred text editor, open the file activeobjects.xml.
      3. Look and delete all the tags containing a reference to the table AO_575BF5. You need to remove each complete entry related to it (see my example image-2018-01-04-19-26-39-993.png. The example is using a different table, but the principle is the same. The XML file might appear in a format difficult to read, so you might want to do the following:
        • For Windows Users: use a text editor that can format the XML to be humanly easier to read and edit, in my case I used Notepad++ with the XML Tools plugin, and used the function 'Pretty print' from the XML Plugin (see my example image-2018-01-04-19-12-05-438.png).
        • For Unix based OS, another option to format the XML file is with the command:
          xmllint --format activeobjects.xml > activeobjects_formatted.xml
          
          • You will need to rename the activeobjects_formatted.xml back to activeobjects.xml before zipping them.
      1. Once all the entries related to the table AO_575BF5 have been removed, save the file and create a new zip file using the newly saved activeobjects.xml and the original entities.xml.
      2. Attempt the Restore System again.

        1. image-2018-01-04-19-12-05-438.png
          326 kB
          Andy Heinzer
        2. image-2018-01-04-19-26-39-993.png
          100 kB
          Andy Heinzer

              crolf Christian
              scapuzzimato Stefano Capuzzimato (Inactive)
              Votes:
              9 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: