Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-63367

Cloud to server import fails with 'could not find entity' errors in logs

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

      Summary

      Cloud to Server Import Fails due to unknown Entities

      Environment

      • Cloud backup created from JIRA Build 1000.571.2#100021-sha1:be9d69a21ddd1ef41d0d1a95feb6b77a6714b7e4
      • JIRA Server 7.2.1

      Steps to Reproduce

      1. Generate backup from cloud instance
      2. Restore to JIRA Server 7.2.1

      Expected Results

      The import will complete successfully.

      Actual Results

      The below exception is thrown in the atlassian-jira.log file and the import fails:

      2016-11-29 16:25:52,443 JiraImportTaskExecutionThread-1 ERROR anonymous 971x59x1 1ddmzvy 172.20.44.29 /secure/SetupImport.jspa [c.a.j.bc.dataimport.DefaultDataImportService] Error importing data: java.lang.IllegalArgumentException: [GenericDelegator.makeValue] could not find entity for entityName: UpgradeTaskHistory
      java.lang.IllegalArgumentException: [GenericDelegator.makeValue] could not find entity for entityName: UpgradeTaskHistory
              at org.ofbiz.core.entity.GenericDelegator.makeValue(GenericDelegator.java:491)
              at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.makeValue(DefaultOfBizDelegator.java:315)
              at com.atlassian.jira.ofbiz.WrappingOfBizDelegator.makeValue(WrappingOfBizDelegator.java:182)
              at com.atlassian.jira.bc.dataimport.OfbizImportHandler.parseValue(OfbizImportHandler.java:287)
              at com.atlassian.jira.bc.dataimport.OfbizImportHandler.startElement(OfbizImportHandler.java:204)
              at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
              at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
              at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(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.bc.dataimport.DefaultDataImportService.restoreData(DefaultDataImportService.java:891)
              at com.atlassian.jira.bc.dataimport.DefaultDataImportService.performImport(DefaultDataImportService.java:719)
              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)
      

      Prior to the failure the following error is also observed:

      2016-11-29 16:12:43,621 JiraImportTaskExecutionThread-1 INFO anonymous 971x59x1 1ddmzvy 172.20.44.29 /secure/SetupImport.jspa [c.a.j.bc.dataimport.OfbizImportHandler] Failed to parse value for element UpgradeTaskHistoryAuditLog.
      java.lang.IllegalArgumentException: [GenericDelegator.makeValue] could not find entity for entityName: UpgradeTaskHistoryAuditLog
      	at org.ofbiz.core.entity.GenericDelegator.makeValue(GenericDelegator.java:491)
      	at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.makeValue(DefaultOfBizDelegator.java:315)
      	at com.atlassian.jira.ofbiz.WrappingOfBizDelegator.makeValue(WrappingOfBizDelegator.java:182)
      	at com.atlassian.jira.bc.dataimport.OfbizImportHandler.parseValue(OfbizImportHandler.java:287)
      	at com.atlassian.jira.bc.dataimport.OfbizImportHandler.parseValueFailsafe(OfbizImportHandler.java:271)
      	at com.atlassian.jira.bc.dataimport.OfbizImportHandler.startElement(OfbizImportHandler.java:207)
      	at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
      	at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(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.bc.dataimport.DefaultDataImportService.parseXmlAndValidateBackupData(DefaultDataImportService.java:367)
      	at com.atlassian.jira.bc.dataimport.DefaultDataImportService.doImport(DefaultDataImportService.java:290)
      	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)
      

      Workaround

      • Unzip the backup
      • Run the following command to remove these entries
        • egrep -v "(UpgradeTaskHistoryAuditLog|UpgradeTaskHistory)" entities.xml > entities-purged.xml
      • Run the command to rezip the backup:
        • mv entities-purged.xml entities.xml ; zip -r MyBackupFile.zip entities.xml activeobjects.xml
      • Restore should now complete successfully

            [JRASERVER-63367] Cloud to server import fails with 'could not find entity' errors in logs

            Hi All,

            Thought of sharing this, if anyone who is running JIRA as Windows Service and got pointed to this bug by Atlassian Support to follow the workaround, follow the below steps as we were advised by Shaun, Atlassian support in Austin, TX: 

            1. Create text file on the Desktop called "search.txt"
            2. In that file add 2 lines of text and save the file:
            • UpgradeTaskHistoryAuditLog
            • UpgradeTaskHistory
            1. Move the entities.xml file to the desktop.
            2. Open Powershell and change directories to the desktop
            3. Run the following command to remove the offending lines from entities.xml
            • FINDSTR /v /g:search.txt entities.xml > entities-purged.xml

            After these steps you can rename the entities-purged.xml back to entities.xml, create a zip that contains activeobjects.xml and entities.xml, and restore the backup.

            Hope this helps.

            cheers

            Micromine Helpdesk added a comment - Hi All, Thought of sharing this, if anyone who is running JIRA as Windows Service and got pointed to this bug by Atlassian Support to follow the workaround, follow the below steps as we were advised by Shaun, Atlassian support in Austin, TX:  Create text file on the Desktop called "search.txt" In that file add 2 lines of text and save the file: UpgradeTaskHistoryAuditLog UpgradeTaskHistory Move the entities.xml file to the desktop. Open Powershell and change directories to the desktop Run the following command to remove the offending lines from entities.xml FINDSTR /v /g:search.txt entities.xml > entities-purged.xml After these steps you can rename the entities-purged.xml back to entities.xml, create a zip that contains activeobjects.xml and entities.xml, and restore the backup. Hope this helps. cheers

            Hello,

            Imports into JIRA 7.3 and newer will not encounter this problem.

            If you are migrating from JIRA Cloud to JIRA Server you should import into the latest production release of JIRA Server. See Migrating from JIRA Cloud to Server applications

            The workaround provided in the description may be used when importing to perform JIRA Service Desk upgrade tasks. See After upgrading to JIRA Service Desk 3.2.x or greater, Service Desk project's navigation bar shows "Unable to render element due to an error"

            Cheers!
            Tim | Atlassian

            Tim Evans (Inactive) added a comment - Hello, Imports into JIRA 7.3 and newer will not encounter this problem. If you are migrating from JIRA Cloud to JIRA Server you should import into the latest production release of JIRA Server. See Migrating from JIRA Cloud to Server applications The workaround provided in the description may be used when importing to perform JIRA Service Desk upgrade tasks. See After upgrading to JIRA Service Desk 3.2.x or greater, Service Desk project's navigation bar shows "Unable to render element due to an error" Cheers! Tim | Atlassian

            This is obsolete now that 7.3 has been released. The user would be importing from Cloud into JIRA 7.3 which includes the UpgradeTaskHistoryAuditLog and UpgradeTaskHistory tables.

            A related issue is that a JIRA Server instance prior to 7.0 must go through JIRA Service Desk 3.0.X or 3.1.X prior to going to 3.2.X or newer.

            This problem is encountered if an instance that currently has or previously had JIRA Service Desk is upgraded from <7.0 to 7.3.

            • The instance will need to be downgraded to 7.1.9 with JIRA Service Desk 3.1.9 so that the upgrade tasks can run.
              • A common way of doing this is to export to XML and import into 7.1.9 with JSD 3.1.9. After making sure JSD works export to xml and import back into 7.2+.
            • The user will encounter this error when they try to import the XML from 7.3 into 7.1.9.

            Tim Evans (Inactive) added a comment - This is obsolete now that 7.3 has been released. The user would be importing from Cloud into JIRA 7.3 which includes the UpgradeTaskHistoryAuditLog and UpgradeTaskHistory tables. A related issue is that a JIRA Server instance prior to 7.0 must go through JIRA Service Desk 3.0.X or 3.1.X prior to going to 3.2.X or newer. This problem is encountered if an instance that currently has or previously had JIRA Service Desk is upgraded from <7.0 to 7.3. The instance will need to be downgraded to 7.1.9 with JIRA Service Desk 3.1.9 so that the upgrade tasks can run. A common way of doing this is to export to XML and import into 7.1.9 with JSD 3.1.9. After making sure JSD works export to xml and import back into 7.2+. The user will encounter this error when they try to import the XML from 7.3 into 7.1.9.

              tevans Tim Evans (Inactive)
              ddiblasio David Di Blasio
              Affected customers:
              1 This affects my team
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: