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

Asset publisher can not publish the same document to live twice after staging

    Details

      Description

      Steps to Reproduce:

      1. Add a new site and make it staging
      2. Go to staging site to add two documents (document_1.jpg and document_2.jpg)
      3. Add a new page with asset publisher widget
      4. Go to the staging site page and configure the AP
      5. Change the asset selection to manual
      6. Select document_1.jpg for the asset entries
      7. Go to the page to publish to live (successful)
      8. Go back to the staging site and configure the AP
      9. Remove the docuemnt_1.jpg and select the document_2.jpg
        • Actual Result:┬áThe page is blank and the error "Your request failed to complete." is displayed, but you will find that the document_2.jpg has been selected when you back to the page
      10. Click publish to live(successful)
      11. Go to the staging site page and configure the AP again
      12. Change the document_2.jpg to document_1.jpg
      13. Try to publish to live (Failed)

      Expected Result:
      Publish successfully

      Actual Result:
      Publish failed

      Console error:

      2020-10-16 07:50:48.034 ERROR [liferay/background_task-9][JDBCExceptionReporter:234] Duplicate entry '20011-42136-com_liferay_asset_publisher_web_portlet_AssetPublish' for key 'IX_63EAFC82'
      2020-10-16 07:50:48.071 ERROR [liferay/background_task-9][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.layout.admin.web.internal.exportimport.data.handler.LayoutStagedModelDataHandler.importLayoutClassedModelUsages(LayoutStagedModelDataHandler.java:1501)
              at com.liferay.layout.admin.web.internal.exportimport.data.handler.LayoutStagedModelDataHandler.doImportStagedModel(LayoutStagedModelDataHandler.java:935)
              at com.liferay.layout.admin.web.internal.exportimport.data.handler.LayoutStagedModelDataHandler.doImportStagedModel(LayoutStagedModelDataHandler.java:148)
              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.exportimport.kernel.lar.StagedModelDataHandlerUtil.doImportReferenceStagedModel(StagedModelDataHandlerUtil.java:454)
              at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importReferenceStagedModel(StagedModelDataHandlerUtil.java:296)
              at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importReferenceStagedModels(BaseStagedModelDataHandler.java:859)
              at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:365)
              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.site.internal.exportimport.data.handler.StagedGroupStagedModelDataHandler.doImportStagedModel(StagedGroupStagedModelDataHandler.java:348)
              at com.liferay.site.internal.exportimport.data.handler.StagedGroupStagedModelDataHandler.doImportStagedModel(StagedGroupStagedModelDataHandler.java:78)
              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.exportimport.internal.controller.LayoutImportController.doImportFile(LayoutImportController.java:592)
              at com.liferay.exportimport.internal.controller.LayoutImportController.importFile(LayoutImportController.java:221)
              at com.liferay.portlet.exportimport.service.impl.ExportImportLocalServiceImpl.importLayouts(ExportImportLocalServiceImpl.java:189)
              at sun.reflect.GeneratedMethodAccessor893.invoke(Unknown Source)
              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.change.tracking.internal.aop.CTTransactionAdvice.invoke(CTTransactionAdvice.java:80)
              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.$Proxy165.importLayouts(Unknown Source)
              at com.liferay.exportimport.kernel.service.ExportImportLocalServiceUtil.importLayouts(ExportImportLocalServiceUtil.java:105)
              at com.liferay.exportimport.internal.background.task.LayoutStagingBackgroundTaskExecutor$LayoutStagingImportCallable.call(LayoutStagingBackgroundTaskExecutor.java:285)
              at com.liferay.exportimport.internal.background.task.LayoutStagingBackgroundTaskExecutor$LayoutStagingImportCallable.call(LayoutStagingBackgroundTaskExecutor.java:258)
              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.LayoutStagingBackgroundTaskExecutor.execute(LayoutStagingBackgroundTaskExecutor.java:145)
              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.doReceive(BaseMessageListener.java:48)
              at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:34)
              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:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      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.$Proxy876.addLayoutClassedModelUsage(Unknown Source)
              at com.liferay.layout.internal.exportimport.staged.model.repository.LayoutClassedModelUsageStagedModelRepository.addStagedModel(LayoutClassedModelUsageStagedModelRepository.java:54)
              at com.liferay.layout.internal.exportimport.staged.model.repository.LayoutClassedModelUsageStagedModelRepository.addStagedModel(LayoutClassedModelUsageStagedModelRepository.java:33)
              at com.liferay.layout.internal.exportimport.data.handler.LayoutClassedModelUsageStagedModelDataHandler.doImportStagedModel(LayoutClassedModelUsageStagedModelDataHandler.java:199)
              at com.liferay.layout.internal.exportimport.data.handler.LayoutClassedModelUsageStagedModelDataHandler.doImportStagedModel(LayoutClassedModelUsageStagedModelDataHandler.java:48)
              at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:367)
              ... 49 more
      Caused by: java.sql.BatchUpdateException: Duplicate entry '20011-42136-com_liferay_asset_publisher_web_portlet_AssetPublish' for key 'IX_63EAFC82'
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
              at com.mysql.cj.util.Util.handleNewInstance(Util.java:192)
              at com.mysql.cj.util.Util.getInstance(Util.java:167)
              at com.mysql.cj.util.Util.getInstance(Util.java:174)
              at com.mysql.cj.jdbc.exceptions.SQLError.createBatchUpdateException(SQLError.java:224)
              at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchSerially(ClientPreparedStatement.java:855)
              at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchInternal(ClientPreparedStatement.java:437)
              at com.mysql.cj.jdbc.StatementImpl.executeBatch(StatementImpl.java:814)
              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)
              ... 68 more
      Caused by: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '20011-42136-com_liferay_asset_publisher_web_portlet_AssetPublish' for key 'IX_63EAFC82'
              at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:117)
              at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
              at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
              at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:955)
              at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1094)
              at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchSerially(ClientPreparedStatement.java:834)
              ... 74 more
       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jeremy.chen Jeremy Chen
              Reporter:
              jeremy.chen Jeremy Chen
              Participants of an Issue:
              Recent user:
              Jeremy Chen
              Engineering Assignee:
              Pavel Savinov
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                12 weeks, 6 days ago

                  Packages

                  Version Package
                  Master