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

Failure to override objects in a data store in a staged environment using s3

    Details

      Description

      Issue
      Failure to override objects in a data store in a staged environment using s3

      This problem is related to LPS-103419, which introduces changes to master that allow this to work (the following steps fail in 7.2.x but work on master).

      The use case simulates a failed staging attempt by performing a database rollback (which is conceptually similar to a transaction rollback) following a staging attempt, and performs a second staging publish.

      Steps to Reproduce

      1. Set dl.store.impl=com.liferay.portal.store.s3.S3Store in portal-ext.properties
      2. Start up Liferay
      3. Navigate to Control Panel > System Settings, search for the File Storage in the Platform section
      4. Select the option to edit the S3 Store configuration
      5. Update the S3 Store configuration to point to a valid endpoint and bucket (make sure to delete files in this bucket to avoid potential oddities in testing)
      6. Enable Local Live staging
      7. Upload a document to the Staging site and confirm that it's present in the S3 bucket
      8. Shutdown the server
      9. Take a backup of the database (if using Hypersonic, make a copy of the Hypersonic folder)
      10. Restart the server and publish the site
      11. Shutdown the server
      12. Restore the database backup taken in step 8 to simulate a database rollback
      13. Restart the server and publish the site

      Actual Behavior
      Staging process fails with the following error.

      An unexpected error occurred with the publication process. Please check your portal and publishing configuration.
      The model.resource.com.liferay.portal.repository.liferayrepository.model.LiferayFileEntry messageImage_1572246653178.jpg could not be imported because of the following error: {companyId=20101, repositoryId=20124, fileName=201, version=1.0}.

      Stack Trace:

      2021-05-27 04:19:26.636 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:182] Unable to execute background task
      com.liferay.exportimport.kernel.lar.PortletDataException: {companyId=20101, repositoryId=20124, fileName=201, version=1.0}
      	at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:437)
      	at com.liferay.document.library.internal.exportimport.data.handler.FileEntryStagedModelDataHandler.importStagedModel(FileEntryStagedModelDataHandler.java:197)
      	at com.liferay.document.library.internal.exportimport.data.handler.FileEntryStagedModelDataHandler.importStagedModel(FileEntryStagedModelDataHandler.java:112)
      	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:453)
      	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:439)
      	at com.liferay.exportimport.changeset.web.internal.portlet.data.handler.ChangesetPortletDataHandler.doImportData(ChangesetPortletDataHandler.java:220)
      	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.site.internal.exportimport.data.handler.StagedGroupStagedModelDataHandler.importSitePortlets(StagedGroupStagedModelDataHandler.java:599)
      	at com.liferay.site.internal.exportimport.data.handler.StagedGroupStagedModelDataHandler.doImportStagedModel(StagedGroupStagedModelDataHandler.java:323)
      	at com.liferay.site.internal.exportimport.data.handler.StagedGroupStagedModelDataHandler.doImportStagedModel(StagedGroupStagedModelDataHandler.java:78)
      	at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:396)
      	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:453)
      	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:439)
      	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:211)
      	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.$Proxy129.importLayouts(Unknown Source)
      	at com.liferay.exportimport.kernel.service.ExportImportLocalServiceUtil.importLayouts(ExportImportLocalServiceUtil.java:118)
      	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.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 com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:753)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:665)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: com.liferay.document.library.kernel.exception.DuplicateFileException: {companyId=20101, repositoryId=20124, fileName=201, version=1.0}
      	at com.liferay.portal.store.s3.S3Store.updateFile(S3Store.java:437)
      	at com.liferay.portal.store.s3.S3Store.addFile(S3Store.java:115)
      	at com.liferay.portlet.documentlibrary.store.DLStoreImpl.addFile(DLStoreImpl.java:118)
      	at com.liferay.document.library.kernel.store.DLStoreUtil.addFile(DLStoreUtil.java:131)
      	at com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.addFileEntry(DLFileEntryLocalServiceImpl.java:278)
      	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.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.$Proxy89.addFileEntry(Unknown Source)
      	at com.liferay.portal.repository.liferayrepository.LiferayLocalRepository.addFileEntry(LiferayLocalRepository.java:139)
      	at com.liferay.portal.repository.util.LocalRepositoryWrapper.addFileEntry(LocalRepositoryWrapper.java:62)
      	at com.liferay.portal.repository.liferayrepository.ModelValidatorLocalRepositoryWrapper.addFileEntry(ModelValidatorLocalRepositoryWrapper.java:78)
      	at com.liferay.portal.repository.util.LocalRepositoryWrapper.addFileEntry(LocalRepositoryWrapper.java:62)
      	at com.liferay.portal.repository.liferayrepository.LiferayWorkflowLocalRepositoryWrapper.addFileEntry(LiferayWorkflowLocalRepositoryWrapper.java:72)
      	at com.liferay.portal.repository.util.LocalRepositoryWrapper.addFileEntry(LocalRepositoryWrapper.java:62)
      	at com.liferay.portal.repository.liferayrepository.LiferayProcessorLocalRepositoryWrapper.addFileEntry(LiferayProcessorLocalRepositoryWrapper.java:67)
      	at com.liferay.portal.repository.util.LocalRepositoryWrapper.addFileEntry(LocalRepositoryWrapper.java:62)
      	at com.liferay.portal.repository.util.LocalRepositoryWrapper.addFileEntry(LocalRepositoryWrapper.java:62)
      	at com.liferay.portal.repository.capabilities.CapabilityLocalRepository.addFileEntry(CapabilityLocalRepository.java:80)
      	at com.liferay.portlet.documentlibrary.service.impl.DLAppLocalServiceImpl.addFileEntry(DLAppLocalServiceImpl.java:293)
      	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.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:66)
      	at com.sun.proxy.$Proxy486.addFileEntry(Unknown Source)
      	at com.liferay.document.library.kernel.service.DLAppLocalServiceWrapper.addFileEntry(DLAppLocalServiceWrapper.java:175)
      	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.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:66)
      	at com.sun.proxy.$Proxy487.addFileEntry(Unknown Source)
      	at com.liferay.document.library.kernel.service.DLAppLocalServiceWrapper.addFileEntry(DLAppLocalServiceWrapper.java:175)
      	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.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:66)
      	at com.sun.proxy.$Proxy487.addFileEntry(Unknown Source)
      	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.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.$Proxy100.addFileEntry(Unknown Source)
      	at com.liferay.document.library.internal.exportimport.data.handler.FileEntryStagedModelDataHandler.doImportStagedModel(FileEntryStagedModelDataHandler.java:498)
      	at com.liferay.document.library.internal.exportimport.data.handler.FileEntryStagedModelDataHandler.doImportStagedModel(FileEntryStagedModelDataHandler.java:112)
      	at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:396)
      	... 43 more

      Expected Behavior
      Object should be overwritten in s3

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              summer.zhang Summer Zhang
              Reporter:
              minhchau.dang Minhchau Dang
              Participants of an Issue:
              Recent user:
              Summer Zhang
              Engineering Assignee:
              Michael Prigge
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

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

                  Packages

                  Version Package
                  7.2.X