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

LAR export fails if a file is missing a non-file system store (Amazon S3)

    Details

      Description

      Steps
      1. Establish your portal-ext.properties with S3 credentials:

          dl.store.s3.access.key=XXXXXXXXXXXXX
          dl.store.s3.secret.key=XXXXXXXXXXXXX
          dl.store.s3.bucket.name=XXXXXXXXXXXX
          dl.store.impl=com.liferay.portlet.documentlibrary.store.S3Store

      2. Start up the Portal
      3. Sign in as test@liferay.com
      4. In the Control Panel, access Liferay (default) site's Documents and Media section
      5. Upload a file
      6. Go to the S3 bucket interface via Amazon, and delete that file from the storage
      7. Back in the Portal, in the Documents and Media section, click the cog icon, and click "Export/Import".
      8. Export the file

      Expected Result:
      The export will complete, but report that the file is missing, as in the case of the default FileSystemStore.

      Actual Results:
      The export fails, and the Portal throws an error about the missing file:

      22:51:31,629 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:133] Unable to execute background task
      com.liferay.portal.kernel.lar.PortletDataException: com.liferay.portal.kernel.exception.SystemException: org.jets3t.service.S3ServiceException: S3 Error Message. -- ResponseCode: 404, ResponseStatus: Not Found, XML Error Message: <?xml version="1.0" encoding="UTF-8"?><Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>10159/86279/6606/1.0</Key><RequestId>0B8B19F68BC18601</RequestId><HostId>eHNobB/BmRsrqNva+CHqKM+yxqMSrM8oiVB/WEPAjyk1ODpzF8ETdjizloof8T6nOij/g/0vMJQ=</HostId></Error>
      	at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:81)
      	at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.exportStagedModel(StagedModelDataHandlerUtil.java:173)
      	at com.liferay.portlet.documentlibrary.lar.DLPortletDataHandler$3.performAction(DLPortletDataHandler.java:444)
      	at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery.performActionsInSingleInterval(BaseActionableDynamicQuery.java:317)
      	at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery.performActions(BaseActionableDynamicQuery.java:46)
      	at com.liferay.portlet.documentlibrary.lar.DLPortletDataHandler.doExportData(DLPortletDataHandler.java:153)
      	at com.liferay.portal.kernel.lar.BasePortletDataHandler.exportData(BasePortletDataHandler.java:108)
      	at com.liferay.portal.lar.PortletExporter.exportPortletData(PortletExporter.java:205)
      	at com.liferay.portal.lar.PortletExporter.exportPortlet(PortletExporter.java:1015)
      	at com.liferay.portal.lar.LayoutExporter.doExportLayoutsAsFile(LayoutExporter.java:689)
      	at com.liferay.portal.lar.LayoutExporter.exportLayoutsAsFile(LayoutExporter.java:345)
      	at com.liferay.portal.service.impl.LayoutLocalServiceImpl.exportLayoutsAsFile(LayoutLocalServiceImpl.java:875)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
      	at com.liferay.portal.service.impl.LayoutLocalServiceVirtualLayoutsAdvice.invoke(LayoutLocalServiceVirtualLayoutsAdvice.java:183)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
      	at com.liferay.portal.service.impl.LayoutLocalServiceStagingAdvice.invoke(LayoutLocalServiceStagingAdvice.java:141)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
      	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
      	at com.sun.proxy.$Proxy33.exportLayoutsAsFile(Unknown Source)
      	at com.liferay.portal.service.LayoutLocalServiceUtil.exportLayoutsAsFile(LayoutLocalServiceUtil.java:706)
      	at com.liferay.portal.lar.backgroundtask.LayoutExportBackgroundTaskExecutor.execute(LayoutExportBackgroundTaskExecutor.java:67)
      	at com.liferay.portal.kernel.backgroundtask.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:56)
      	at com.liferay.portal.backgroundtask.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:108)
      	at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
      	at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:69)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: com.liferay.portal.kernel.exception.SystemException: org.jets3t.service.S3ServiceException: S3 Error Message. -- ResponseCode: 404, ResponseStatus: Not Found, XML Error Message: <?xml version="1.0" encoding="UTF-8"?><Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>10159/86279/6606/1.0</Key><RequestId>0B8B19F68BC18601</RequestId><HostId>eHNobB/BmRsrqNva+CHqKM+yxqMSrM8oiVB/WEPAjyk1ODpzF8ETdjizloof8T6nOij/g/0vMJQ=</HostId></Error>
      	at com.liferay.portlet.documentlibrary.store.S3Store.getFileAsStream(S3Store.java:212)
      	at com.liferay.portlet.documentlibrary.store.StoreProxyImpl.getFileAsStream(StoreProxyImpl.java:178)
      	at com.liferay.portlet.documentlibrary.store.SafeFileNameStoreWrapper.getFileAsStream(SafeFileNameStoreWrapper.java:264)
      	at com.liferay.portlet.documentlibrary.store.DLStoreImpl.getFileAsStream(DLStoreImpl.java:300)
      	at com.liferay.portlet.documentlibrary.store.DLStoreUtil.getFileAsStream(DLStoreUtil.java:452)
      	at com.liferay.portlet.documentlibrary.lar.FileEntryUtil.getContentStream(FileEntryUtil.java:105)
      	at com.liferay.portlet.documentlibrary.lar.FileEntryStagedModelDataHandler.doExportStagedModel(FileEntryStagedModelDataHandler.java:175)
      	at com.liferay.portlet.documentlibrary.lar.FileEntryStagedModelDataHandler.doExportStagedModel(FileEntryStagedModelDataHandler.java:1)
      	at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:68)
      	... 35 more
      Caused by: org.jets3t.service.S3ServiceException: S3 Error Message. -- ResponseCode: 404, ResponseStatus: Not Found, XML Error Message: <?xml version="1.0" encoding="UTF-8"?><Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>10159/86279/6606/1.0</Key><RequestId>0B8B19F68BC18601</RequestId><HostId>eHNobB/BmRsrqNva+CHqKM+yxqMSrM8oiVB/WEPAjyk1ODpzF8ETdjizloof8T6nOij/g/0vMJQ=</HostId></Error>
      	at org.jets3t.service.S3Service.getObject(S3Service.java:1379)
      	at com.liferay.portlet.documentlibrary.store.S3Store.getFileAsStream(S3Store.java:205)
      	... 43 more

      Note
      This can also be reproduced with other stores by deleting files from them directly. For example deleting the row in DLContent when using the DBStore results in the following exception:

      00:45:41,009 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:133] Unable to execute background task
      com.liferay.portal.kernel.lar.PortletDataException: com.liferay.portlet.documentlibrary.NoSuchContentException: No DLContent exists with the key {companyId=10155, repositoryId=10182, path=1, version=1.0}
              at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:81)
              at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.exportStagedModel(StagedModelDataHandlerUtil.java:173)
              at com.liferay.portlet.documentlibrary.lar.DLPortletDataHandler$3.performAction(DLPortletDataHandler.java:444)
              at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery.performActionsInSingleInterval(BaseActionableDynamicQuery.java:317)
              at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery.performActions(BaseActionableDynamicQuery.java:46)
              at com.liferay.portlet.documentlibrary.lar.DLPortletDataHandler.doExportData(DLPortletDataHandler.java:153)
              at com.liferay.portal.kernel.lar.BasePortletDataHandler.exportData(BasePortletDataHandler.java:108)
              at com.liferay.portal.lar.PortletExporter.exportPortletData(PortletExporter.java:205)
              at com.liferay.portal.lar.PortletExporter.exportPortlet(PortletExporter.java:1015)
              at com.liferay.portal.lar.PortletExporter.doExportPortletInfoAsFile(PortletExporter.java:423)
              at com.liferay.portal.lar.PortletExporter.exportPortletInfoAsFile(PortletExporter.java:275)
              at com.liferay.portal.service.impl.LayoutLocalServiceImpl.exportPortletInfoAsFile(LayoutLocalServiceImpl.java:996)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
              at com.liferay.portal.service.impl.LayoutLocalServiceVirtualLayoutsAdvice.invoke(LayoutLocalServiceVirtualLayoutsAdvice.java:183)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.service.impl.LayoutLocalServiceStagingAdvice.invoke(LayoutLocalServiceStagingAdvice.java:141)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
              at com.sun.proxy.$Proxy33.exportPortletInfoAsFile(Unknown Source)
              at com.liferay.portal.service.LayoutLocalServiceUtil.exportPortletInfoAsFile(LayoutLocalServiceUtil.java:788)
              at com.liferay.portal.lar.backgroundtask.PortletExportBackgroundTaskExecutor.execute(PortletExportBackgroundTaskExecutor.java:63)
              at com.liferay.portal.kernel.backgroundtask.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:56)
              at com.liferay.portal.backgroundtask.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:108)
              at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
              at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
              at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:69)
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: com.liferay.portlet.documentlibrary.NoSuchContentException: No DLContent exists with the key {companyId=10155, repositoryId=10182, path=1, version=1.0}
              at com.liferay.portlet.documentlibrary.service.persistence.DLContentPersistenceImpl.findByC_R_P_V(DLContentPersistenceImpl.java:1888)
              at com.liferay.portlet.documentlibrary.service.impl.DLContentLocalServiceImpl.getContent(DLContentLocalServiceImpl.java:152)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
              at com.sun.proxy.$Proxy198.getContent(Unknown Source)
              at com.liferay.portlet.documentlibrary.service.DLContentLocalServiceUtil.getContent(DLContentLocalServiceUtil.java:328)
              at com.liferay.portlet.documentlibrary.store.DBStore.getFileAsStream(DBStore.java:171)
              at com.liferay.portlet.documentlibrary.store.StoreProxyImpl.getFileAsStream(StoreProxyImpl.java:178)
              at com.liferay.portlet.documentlibrary.store.SafeFileNameStoreWrapper.getFileAsStream(SafeFileNameStoreWrapper.java:264)
              at com.liferay.portlet.documentlibrary.store.DLStoreImpl.getFileAsStream(DLStoreImpl.java:300)
              at com.liferay.portlet.documentlibrary.store.DLStoreUtil.getFileAsStream(DLStoreUtil.java:452)
              at com.liferay.portlet.documentlibrary.lar.FileEntryUtil.getContentStream(FileEntryUtil.java:105)
              at com.liferay.portlet.documentlibrary.lar.FileEntryStagedModelDataHandler.doExportStagedModel(FileEntryStagedModelDataHandler.java:175)
              at com.liferay.portlet.documentlibrary.lar.FileEntryStagedModelDataHandler.doExportStagedModel(FileEntryStagedModelDataHandler.java:1)
              at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:68)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              lu.liu Lu Liu
              Reporter:
              preston.crary Preston Crary
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                5 years, 34 weeks, 2 days ago

                  Packages

                  Version Package
                  6.2.3 CE GA4
                  6.2.X EE
                  7.0.0 M4