-
Type:
Bug
-
Resolution: Won't Fix
-
Priority:
Low
-
Component/s: Backup & Restore - Import From JIRA Server
-
None
-
3
-
Severity 2 - Major
Issue presents to the customer as a generic failure.
Issue presents in the logs as follows (similar to this - customer specific data are redacted):
org.xml.sax.SAXException: com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Issue]... (ERROR: value too long for type character varying(255))) java.lang.Exception: com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Issue]... (ERROR: value too long for type character varying(255))) at com.atlassian.jira.bc.dataimport.OfbizImportHandler.startElement(OfbizImportHandler.java:228) at org.apache.xerces.parsers.AbstractSAXParser.startElement(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.CloudImportService.restoreData(CloudImportService.java:348) at com.atlassian.jira.bc.dataimport.CloudImportService.performDbImport(CloudImportService.java:147) at com.atlassian.jira.bc.dataimport.CloudImportTaskRunner.performTasksOnImportDb(CloudImportTaskRunner.java:286) at com.atlassian.jira.bc.dataimport.CloudImportTaskRunner.lambda$null$2(CloudImportTaskRunner.java:157) at com.atlassian.connpool.impl.AbstractConnectionPoolProvider.withPrivatePool(AbstractConnectionPoolProvider.java:134) at com.atlassian.jira.connpool.JiraViburConnectionPoolProvider.withPrivatePool(JiraViburConnectionPoolProvider.java:89) at com.atlassian.jira.bc.dataimport.AbstractBackupTaskRunner.lambda$null$0(AbstractBackupTaskRunner.java:59) at java.util.Optional.map(Optional.java:215) at com.atlassian.jira.bc.dataimport.AbstractBackupTaskRunner.lambda$runWithSeparateContextAsync$1(AbstractBackupTaskRunner.java:58) at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590) at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1582) at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) Caused by: java.lang.Exception: com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Issue]... (ERROR: value too long for type character varying(255))) ... 26 more Caused by: com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Issue]... (ERROR: value too long for type character varying(255))) at com.atlassian.jira.bc.dataimport.OfbizImportHandler.lambda$createValue$6(OfbizImportHandler.java:672) at com.atlassian.jira.bc.dataimport.OfbizImportHandler.createValue(OfbizImportHandler.java:676) at com.atlassian.jira.bc.dataimport.OfbizImportHandler.endElement(OfbizImportHandler.java:630) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source) ... 24 more Caused by: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Issue]... (ERROR: value too long for type character varying(255))) at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:219) at org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:177) at org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:89) at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:584) at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:570) at org.ofbiz.core.entity.GenericValue.create(GenericValue.java:114) at com.atlassian.jira.bc.dataimport.OfbizImportHandler.createWithRetry(OfbizImportHandler.java:692) at com.atlassian.jira.bc.dataimport.OfbizImportHandler.lambda$createValue$6(OfbizImportHandler.java:663) ... 28 more Caused by: org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:INSERT INTO public.jiraissue (ID, pkey, issuenum, PROJECT, REPORTER, ASSIGNEE, CREATOR, issuetype, SUMMARY, DESCRIPTION, ENVIRONMENT, PRIORITY, RESOLUTION, issuestatus, CREATED, UPDATED, DUEDATE, RESOLUTIONDATE, VOTES, WATCHES, TIMEORIGINALESTIMATE, TIMEESTIMATE, TIMESPENT, WORKFLOW_ID, SECURITY, denormalised_subtask_parent, FIXFOR, COMPONENT) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: value too long for type character varying(255)) at org.ofbiz.core.entity.jdbc.SQLProcessor.executeUpdate(SQLProcessor.java:619) at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:211) ... 35 more Caused by: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(255) at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:363) at sun.reflect.GeneratedMethodAccessor561.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.vibur.dbcp.proxy.AbstractInvocationHandler.targetInvoke(AbstractInvocationHandler.java:144) at org.vibur.dbcp.proxy.StatementInvocationHandler.on(StatementInvocationHandler.java:161) at com.atlassian.jira.connpool.JiraViburConnectionPoolProvider.lambda$null$5(JiraViburConnectionPoolProvider.java:142) at org.vibur.dbcp.proxy.StatementInvocationHandler.processExecute(StatementInvocationHandler.java:123) at org.vibur.dbcp.proxy.StatementInvocationHandler.restrictedInvoke(StatementInvocationHandler.java:85) at org.vibur.dbcp.proxy.StatementInvocationHandler.restrictedInvoke(StatementInvocationHandler.java:37) at org.vibur.dbcp.proxy.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:80) at com.sun.proxy.$Proxy4707.executeUpdate(Unknown Source) at org.ofbiz.core.entity.jdbc.SQLProcessor.executeUpdate(SQLProcessor.java:611) ... 36 more
We can get this error when the database the jira backup is exported from has a wider issue summary column than we accept (255 characters). When we try to insert the summary into its column in the database it will fail to insert because it is too long, thus causing the import to fail.
Workaround
Manually look through the entities.xml and fix the issues summary data to be shorter than 255 characters long. Typically people will truncate this but another option is to also move the content to the description field.
Other
In the general case there's not a lot we can do for this type of issue, but in this specific case I think there's an argument to be made to:
- copy the summary into the description field (if present); and
- truncate the summary; but
- fail the import if we can't do those things.