XML restore fails with entityName error in Jira server
Symptoms
Your JIRA application fails to restore a XML backup and presents messages similar to the below in the atlassian-jira.log.
2013-01-01 13:01:09,350 JiraImportTaskExecutionThread-1 ERROR XXXXXX 781x19x1 1bk15j5 0:0:0:0:0:0:0:1 /secure/SetupImport.jspa [jira.bc.dataimport.DefaultDataImportService] Error importing data: java.lang.IllegalArgumentException: [GenericDelegator.makeValue] could not find entity for entityName: LinkEntity
java.lang.IllegalArgumentException: [GenericDelegator.makeValue] could not find entity for entityName: LinkEntity
at org.ofbiz.core.entity.GenericDelegator.makeValue(GenericDelegator.java:430)
at sun.reflect.GeneratedMethodAccessor120.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.atlassian.multitenant.impl.MultiTenantComponentFactoryImpl$AbstractMultiTenantAwareInvocationHandler.invokeInternal(MultiTenantComponentFactoryImpl.java:181)
at com.atlassian.multitenant.impl.MultiTenantComponentFactoryImpl$MultiTenantAwareMethodInterceptor.intercept(MultiTenantComponentFactoryImpl.java:230)
at org.ofbiz.core.entity.GenericDelegator$$EnhancerByCGLIB$$9e98ab2.makeValue(<generated>)
at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.makeValue(DefaultOfBizDelegator.java:385)
at com.atlassian.jira.action.admin.OfbizImportHandler.startElement(OfbizImportHandler.java:176)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
(...)
JiraImportTaskExecutionThread-1 ERROR XXXXX 775x191x1 13ia0t7 0:0:0:0:0:0:0:1 /secure/admin/XmlRestore.jspa [jira.bc.dataimport.DefaultDataImportService] Error importing data: java.lang.IllegalArgumentException: [GenericDelegator.makeValue] could not find entity for entityName: KPlugins
java.lang.IllegalArgumentException: [GenericDelegator.makeValue] could not find entity for entityName: KPlugins
at org.ofbiz.core.entity.GenericDelegator.makeValue(GenericDelegator.java:430)
at sun.reflect.GeneratedMethodAccessor285.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.atlassian.multitenant.impl.MultiTenantComponentFactoryImpl$AbstractMultiTenantAwareInvocationHandler.invokeInternal(MultiTenantComponentFactoryImpl.java:181)
at com.atlassian.multitenant.impl.MultiTenantComponentFactoryImpl$MultiTenantAwareMethodInterceptor.intercept(MultiTenantComponentFactoryImpl.java:230)
at org.ofbiz.core.entity.GenericDelegator$$EnhancerByCGLIB$$6c2a9e86.makeValue(<generated>)
at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.makeValue(DefaultOfBizDelegator.java:371)
at com.atlassian.jira.action.admin.OfbizImportHandler.startElement(OfbizImportHandler.java:160)
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)
(...)
2016-01-04 19:00:06,390 JiraImportTaskExecutionThread-1 ERROR anonymous 1140x23x1 gt55l6 192.168.10.122 /secure/SetupImport.jspa [c.a.j.bc.dataimport.DefaultDataImportService] Error importing data: java.lang.IllegalArgumentException: [GenericEntity.setString] "q_text" is not a field of
java.lang.IllegalArgumentException: [GenericEntity.setString] "q_text" is not a field of
at org.ofbiz.core.entity.GenericEntity.setString(GenericEntity.java:326)
at com.atlassian.jira.action.admin.OfbizImportHandler.endElement(OfbizImportHandler.java:506)
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)
Cause
There are two possible causes for this problem.
Cause #1
The XML backup was generated from an instance which has some specific third party plugins installed that use JIRA application default entity model for data storage, which is unsupported.
Some of the plug-ins known to cause the problem are:
- Minyaa Suite (formerly Kaamelot Plugin)
- Database Custom Field (depends on katl-commons). Raised with the plugin developers under DBCF-215.
- Blitz Action. Raised with the plugin developers under KBA-44.
- User Group Picker (depends on katl-commons). Raised with the third-party plugin developers under UGP-55.
- JJupin (depends on katl-commons). Raised with the third-party plugin developers under IMJ-303.
- qanda
These add-ons are not supported by Atlassian, therefore it's recommended to contact the vendor responsible for each in the occurrence of this problem before proceeding with any action.
-
JRA-40722Getting issue details...
STATUS
Cause #2
The XML backup was generated from an application version newer than the targeted JIRA application instance.
Since different versions of JIRA applications may use different entity models, importing a backup from a newer version of a JIRA application can introduce this sort of problems, therefore it's unsupported.
Resolution
For "Cause #1"
Carefully check what plugins you had installed on the JIRA application source instance and install them all on the new application before restoring the data.
This may require the purchase of additional licenses.
For "Cause #2"
Import the backup file into a version of JIRA applications equal to or newer than the one from where the backup was generated.
Workaround
Only for "Cause #1"
You will lose all the functionality and data provided by those third party plugins. You may also lose functionalities from other plugins we're not aware of.
If you don't intend to keep those plugins in your new JIRA application instance or if the solution provided by the vendor contacted was insufficient, you can purge all the data related to those add-ons from the XML file following the below steps.
Copy your backup file and keep it in a safe place in case of you need the previous data in the future;
Unzip the file and edit the
entities.xml
file. Remove all the following tags:TimesheetEntity TimesheetScheme Myaa ReportEntity ReportScheme LinkEntity LinkScheme WorklogExt WorklogType KPlugins KPluginsCfg cfgDefaultValue cfgLDefaultValue cfgValue cfgLValue QANDAA QANDAQ QANDAE a_text q_text jjlf_project jjlf_config jjlf_category KListenerSils JiraCapacityPlan additionalTaskDescription testexecutionhistory KRSSecurity KBlitzActions
Note: If you're using an Unix-based operating system, you can run the below command on a terminal window.
egrep -v "(QANDAA|QANDAQ|QANDAE|a_text|q_text|TimesheetEntity|TimesheetScheme|Myaa|ReportEntity|ReportScheme|LinkEntity|LinkScheme|WorklogExt|WorklogType|KPlugins|KPluginsCfg|cfgDefaultValue|cfgLDefaultValue|cfgValue|cfgLValue|jjlf_config|jjlf_project|jjlf_category|KListenerSils|JiraCapacityPlan|additionalTaskDescription|testexecutionhistory|KRSSecurity|KBlitzActions)" entities.xml > entities-purged.xml
Additionally there is a Java file that can be used to do this, located at https://bitbucket.org/atlassianlabs/xml-purge/downloads/xml-purge-1.0-SNAPSHOT.jar. Download that and run the following (this requires Java 8):
java -jar xml-purge-1.0-SNAPSHOT.jar entities.xml > entities-purged.xml
Zip the modified
entities.xml
file back into a backup file;Note: If you're running an Unix-based operating system, you can run the below command on a terminal window.
mv entities-purged.xml entities.xml ; zip -r MyBackupFile.zip entities.xml activeobjects.xml
Restart the XML restore process;