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

When you move a document between DLFolders in DL and publishing to Live, in case of having a folder with same name in disk, an exception is thrown

    Details

      Description

      When you move a document between DLFolders in DL and publishing to Live, in case of having a folder with same name in disk, an exception is thrown

      Root cause: The colliding folder in disk was created due to previous errors with a database only rollback

      Solution: Problematic folder should be ignored and overwrited without throwing any exception

      Steps to reproduce

      1. Create a new site
      2. In DL create two folders: A and B
      3. In Folder A upload document AA
      4. In Folder B upload document BB
      5. Query database and get folderId of folder A and B (select * from DLFolder)
      6. Go to (liferay_home)/data/document_library/(companyId)/(A_folderId) and copy all its content to (liferay_home)/data/document_library/(companyId)/(B_folderId)
      7. Go to (liferay_home)/data/document_library/(companyId)/(B_folderId) and copy all its content to (liferay_home)/data/document_library/(companyId)/(A_folderId)
      8. Activate Local Staging
      9. Go to DL and move document AA from folder A to folder B
      10. Go to DL and move document BB from folder B to folder A
      11. Publish changes from staging to live:
        • Expected behavior: publish operation is executed sucessfully
        • Wrong behavior: publish operation fails and a exception is thrown in log file

      7.0.x exception

      13:07:30,604 WARN  [liferay/background_task-1][PortletStagingBackgroundTaskExecutor:117] Unable to publish portlet: com.liferay.document.library.kernel.exception.NoSuchFileException: {companyId=20116, repositoryId=45156, fileName=504}
      13:07:30,611 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:164] Unable to execute background task
      com.liferay.exportimport.kernel.lar.PortletDataException: com.liferay.document.library.kernel.exception.NoSuchFileException: {companyId=20116, repositoryId=45156, fileName=504}
      	at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:385)
      	at com.liferay.document.library.lar.FileEntryStagedModelDataHandler.importStagedModel(FileEntryStagedModelDataHandler.java:169)
      	at com.liferay.document.library.lar.FileEntryStagedModelDataHandler.importStagedModel(FileEntryStagedModelDataHandler.java:84)
      [...]
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:756)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:667)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: com.liferay.document.library.kernel.exception.NoSuchFileException: {companyId=20116, repositoryId=45156, fileName=504}
      	at com.liferay.portal.store.file.system.FileSystemStore.updateFile(FileSystemStore.java:373)
      	at com.liferay.document.library.store.IgnoreDuplicatesStore$5.execute(IgnoreDuplicatesStore.java:260)
      	at com.liferay.document.library.store.IgnoreDuplicatesStore.recoverAndRetryOnFailure(IgnoreDuplicatesStore.java:412)
      	at com.liferay.document.library.store.IgnoreDuplicatesStore.updateFile(IgnoreDuplicatesStore.java:254)
      	at com.liferay.portal.store.safe.file.name.wrapper.SafeFileNameStoreWrapper$SafeFileNameStore.updateFile(SafeFileNameStoreWrapper.java:406)
      	at com.liferay.portlet.documentlibrary.store.DLStoreImpl.updateFile(DLStoreImpl.java:395)
      	at com.liferay.document.library.kernel.store.DLStoreUtil.updateFile(DLStoreUtil.java:542)
      	at com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.moveFileEntryImpl(DLFileEntryLocalServiceImpl.java:2464)
      	at com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.moveFileEntry(DLFileEntryLocalServiceImpl.java:1642)
      [...]
      	at com.liferay.document.library.lar.FileEntryStagedModelDataHandler.doImportStagedModel(FileEntryStagedModelDataHandler.java:508)
      	at com.liferay.document.library.lar.FileEntryStagedModelDataHandler.doImportStagedModel(FileEntryStagedModelDataHandler.java:84)
      	at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:364)
      	... 41 more
      

      6.2.x exception

      $ 09:03:35,872 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:133] Unable to execute background task
      com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.lar.PortletDataException: com.liferay.portlet.documentlibrary.DuplicateFileException: 16702
              at com.liferay.portal.lar.backgroundtask.PortletStagingBackgroundTaskExecutor.execute(PortletStagingBackgroundTaskExecutor.java:70)
              at com.liferay.portal.kernel.backgroundtask.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:57)
              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:71)
              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.lar.PortletDataException: com.liferay.portlet.documentlibrary.DuplicateFileException: 16702
              at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:175)
              at com.liferay.portlet.documentlibrary.lar.FileEntryStagedModelDataHandler.importStagedModel(FileEntryStagedModelDataHandler.java:119)
              at com.liferay.portlet.documentlibrary.lar.FileEntryStagedModelDataHandler.importStagedModel(FileEntryStagedModelDataHandler.java:1)
              at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:340)
              at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:330)
      [...]
              at com.liferay.portal.lar.backgroundtask.PortletStagingBackgroundTaskExecutor$PortletStagingCallable.call(PortletStagingBackgroundTaskExecutor.java:127)
              at com.liferay.portal.lar.backgroundtask.PortletStagingBackgroundTaskExecutor$PortletStagingCallable.call(PortletStagingBackgroundTaskExecutor.java:1)
              at com.liferay.portal.spring.transaction.TransactionalCallableUtil$CallableMethodInvocation.proceed(TransactionalCallableUtil.java:84)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
              at com.liferay.portal.spring.transaction.TransactionalCallableUtil.call(TransactionalCallableUtil.java:36)
              at com.liferay.portal.lar.backgroundtask.PortletStagingBackgroundTaskExecutor.execute(PortletStagingBackgroundTaskExecutor.java:58)
              ... 8 more
      Caused by: com.liferay.portlet.documentlibrary.DuplicateFileException: 16702
              at com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.moveFileEntryImpl(DLFileEntryLocalServiceImpl.java:2393)
              at com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.moveFileEntry(DLFileEntryLocalServiceImpl.java:1503)
      [...]
              at com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil.moveFileEntry(DLAppLocalServiceUtil.java:550)
              at com.liferay.portlet.documentlibrary.lar.FileEntryStagedModelDataHandler.doImportStagedModel(FileEntryStagedModelDataHandler.java:473)
              at com.liferay.portlet.documentlibrary.lar.FileEntryStagedModelDataHandler.doImportStagedModel(FileEntryStagedModelDataHandler.java:1)
              at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:164)
              ... 71 more
      

        Attachments

        1. fixed.png
          fixed.png
          179 kB
        2. reproduced.png
          reproduced.png
          145 kB

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  3 years, 8 weeks, 3 days ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 DXP FP6
                  7.0.0 DXP SP1
                  7.0.3 CE GA4
                  7.1.X
                  Master