Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-111854

Cannot import blog using copy as new if already exists

    Details

      Description

      Reproducing Steps

      1. Create a new blog entry.
      2. Using the 3-dot menu in the top left corner go to Export/Import > Export > New Export Process.
      3. Export using the default configuration.
      4. Download the resulting lar file.
      5. For the same site's blog administration, go now to Export/Import > Import > New Import Process.
      6. Select the downloaded lar file.
      7. Change the Update Data strategy to Copy as New and import.
        Expected: Import is successful and a new web content is added.
        Observed in 7.1.x : Import succeeds but there is no new blog entry.
        Observed in master and 7.2.x: Import fails with details:

        An unexpected error occurred with the publication process. Please check your portal and publishing configuration.
        The model.resource.com.liferay.asset.display.page.model.AssetDisplayPageEntry 1d78cc18-771d-80af-ab4d-4d3bedacf3da could not be imported because of the following error: Could not execute JDBC batch update.

        The log file shows the error trace:

        2020-04-14 09:01:29.735 ERROR [liferay/background_task-8][JDBCExceptionReporter:234] Batch entry 0 insert into AssetDisplayPageEntry (mvccVersion, ctCollectionId, uuid_, groupId, companyId, userId, userName, createDate, modifiedDate, classNameId, classPK, layoutPageTemplateEntryId, type_, plid, assetDisplayPageEntryId) values (0, 0, 'f9f16524-4d55-5bd4-c676-e57a57ddb960', 41102, 20097, 20127, 'Test Test', '2020-04-14 07:50:36.076000+00', '2020-04-14 07:50:36.076000+00', 32101, 41303, 0, 1, 0, 41516) was aborted: ERROR: duplicate key value violates unique constraint "ix_68525006"_  Detail: Key (groupid, classnameid, classpk, ctcollectionid)=(41102, 32101, 41303, 0) already exists.  Call getNextException to see other errors in the batch. [Sanitized]
        2020-04-14 09:01:29.738 ERROR [liferay/background_task-8][JDBCExceptionReporter:234] ERROR: duplicate key value violates unique constraint "ix_68525006"_  Detail: Key (groupid, classnameid, classpk, ctcollectionid)=(41102, 32101, 41303, 0) already exists. [Sanitized]
        2020-04-14 09:01:29.778 ERROR [liferay/background_task-8][BackgroundTaskMessageListener:182] Unable to execute background task
        com.liferay.exportimport.kernel.lar.PortletDataException: Could not execute JDBC batch update
        	at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:408)
        	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:381)
        	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:367)
        	at com.liferay.blogs.internal.exportimport.data.handler.BlogsEntryStagedModelDataHandler._importAssetDisplayPage(BlogsEntryStagedModelDataHandler.java:429)
        	at com.liferay.blogs.internal.exportimport.data.handler.BlogsEntryStagedModelDataHandler.doImportStagedModel(BlogsEntryStagedModelDataHandler.java:332)
        	at com.liferay.blogs.internal.exportimport.data.handler.BlogsEntryStagedModelDataHandler.doImportStagedModel(BlogsEntryStagedModelDataHandler.java:64)
        	at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:367)
        	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:381)
        	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:367)
        	at com.liferay.blogs.web.internal.exportimport.data.handler.BlogsAdminPortletDataHandler.doImportData(BlogsAdminPortletDataHandler.java:170)
        	at com.liferay.exportimport.kernel.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:390)
        	at com.liferay.exportimport.internal.controller.PortletImportControllerImpl.importPortletData(PortletImportControllerImpl.java:409)
        	at com.liferay.exportimport.internal.controller.PortletImportControllerImpl.importPortletData(PortletImportControllerImpl.java:340)
        	at com.liferay.exportimport.internal.controller.PortletImportControllerImpl.doImportPortletInfo(PortletImportControllerImpl.java:1039)
        	at com.liferay.exportimport.internal.controller.PortletImportControllerImpl.importFile(PortletImportControllerImpl.java:293)
        	at com.liferay.portlet.exportimport.service.impl.ExportImportLocalServiceImpl.importPortletInfo(ExportImportLocalServiceImpl.java:430)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        	at java.lang.reflect.Method.invoke(Method.java:498)
        	at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50)
        	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:69)
        	at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57)
        	at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49)
        	at com.sun.proxy.$Proxy152.importPortletInfo(Unknown Source)
        	at com.liferay.exportimport.kernel.service.ExportImportLocalServiceUtil.importPortletInfo(ExportImportLocalServiceUtil.java:182)
        	at com.liferay.exportimport.internal.background.task.PortletImportBackgroundTaskExecutor$PortletImportCallable.call(PortletImportBackgroundTaskExecutor.java:143)
        	at com.liferay.exportimport.internal.background.task.PortletImportBackgroundTaskExecutor$PortletImportCallable.call(PortletImportBackgroundTaskExecutor.java:129)
        	at com.liferay.portal.spring.transaction.BaseTransactionExecutor.execute(BaseTransactionExecutor.java:37)
        	at com.liferay.portal.spring.transaction.TransactionInvokerImpl.invoke(TransactionInvokerImpl.java:39)
        	at com.liferay.portal.kernel.transaction.TransactionInvokerUtil.invoke(TransactionInvokerUtil.java:28)
        	at com.liferay.exportimport.internal.background.task.PortletImportBackgroundTaskExecutor.execute(PortletImportBackgroundTaskExecutor.java:88)
        	at com.liferay.portal.background.task.internal.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:62)
        	at com.liferay.portal.kernel.backgroundtask.DelegatingBackgroundTaskExecutor.execute(DelegatingBackgroundTaskExecutor.java:41)
        	at com.liferay.portal.background.task.internal.ThreadLocalAwareBackgroundTaskExecutor.execute(ThreadLocalAwareBackgroundTaskExecutor.java:72)
        	at com.liferay.portal.background.task.internal.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:136)
        	at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
        	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)
        	at com.liferay.portal.messaging.internal.ParallelDestination$1.run(ParallelDestination.java:56)
        	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)
        Caused by: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
        	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
        	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
        	at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
        	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:268)
        	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)
        	at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
        	at com.liferay.portal.dao.orm.hibernate.event.NestableFlushEventListener.onFlush(NestableFlushEventListener.java:61)
        	at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
        	at com.liferay.portal.spring.hibernate.PortletTransactionManager$TransactionStatusWrapper.reset(PortletTransactionManager.java:260)
        	at com.liferay.portal.spring.hibernate.PortletTransactionManager.commit(PortletTransactionManager.java:63)
        	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.commit(DefaultTransactionExecutor.java:41)
        	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
        	at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57)
        	at com.liferay.portal.service.ServiceContextAdvice.invoke(ServiceContextAdvice.java:60)
        	at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57)
        	at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49)
        	at com.sun.proxy.$Proxy716.addAssetDisplayPageEntry(Unknown Source)
        	at com.liferay.asset.display.page.internal.exportimport.staged.model.repository.AssetDisplayPageStagedModelRepository.addStagedModel(AssetDisplayPageStagedModelRepository.java:60)
        	at com.liferay.asset.display.page.internal.exportimport.staged.model.repository.AssetDisplayPageStagedModelRepository.addStagedModel(AssetDisplayPageStagedModelRepository.java:36)
        	at com.liferay.asset.display.page.internal.exportimport.data.handler.AssetDisplayPageStagedModelDataHandler.doImportStagedModel(AssetDisplayPageStagedModelDataHandler.java:132)
        	at com.liferay.asset.display.page.internal.exportimport.data.handler.AssetDisplayPageStagedModelDataHandler.doImportStagedModel(AssetDisplayPageStagedModelDataHandler.java:38)
        	at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:367)
        	... 41 more
        Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into AssetDisplayPageEntry (mvccVersion, ctCollectionId, uuid_, groupId, companyId, userId, userName, createDate, modifiedDate, classNameId, classPK, layoutPageTemplateEntryId, type_, plid, assetDisplayPageEntryId) values (0, 0, 'f9f16524-4d55-5bd4-c676-e57a57ddb960', 41102, 20097, 20127, 'Test Test', '2020-04-14 07:50:36.076000+00', '2020-04-14 07:50:36.076000+00', 32101, 41303, 0, 1, 0, 41516) was aborted: ERROR: duplicate key value violates unique constraint "ix_68525006"_  Detail: Key (groupid, classnameid, classpk, ctcollectionid)=(41102, 32101, 41303, 0) already exists.  Call getNextException to see other errors in the batch. [Sanitized]
        	at org.postgresql.jdbc.BatchResultHandler.handleError(BatchResultHandler.java:148)
        	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2126)
        	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:469)
        	at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:791)
        	at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1547)
        	at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:125)
        	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java)
        	at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
        	at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
        	... 60 more
        Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "ix_68525006"_  Detail: Key (groupid, classnameid, classpk, ctcollectionid)=(41102, 32101, 41303, 0) already exists. [Sanitized]
        	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2412)
        	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2125)
        	... 67 more
        

      Note: Fixing this issue related to index ix_68525006 will uncover the related issue LPS-111841.
      Note: Not reproducible for 7.0.x

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              beck.liu Beck Liu
              Reporter:
              ricardo.couso Ricardo Couso
              Participants of an Issue:
              Recent user:
              Jason Pince
              Engineering Assignee:
              Ricardo Couso
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                26 weeks, 4 days ago

                  Packages

                  Version Package
                  7.1.10 DXP FP18
                  7.1.X
                  7.2.10 DXP FP5
                  7.2.10.2 DXP SP2
                  7.2.X
                  7.3.10 DXP GA1
                  Master