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

Cannot update a DLFileEntry with a new content in case last version is inconsistent and points to a non-existing file in DLStore

    Details

      Description

      Cannot update a DLFileEntry with a new content in case last version is inconsistent and points to a non-existing file in DLStore, so final user cannot fix it from user interface and some admin work is necessary in filesystem.

      This is problematic for Staging because of LPS-53791, LPS-53819 and LPS-54520 / LPS-54357. In case of a error during Staging to Live publish operation, some DLFileEntries become inconsistent and future publish operation will fail.

      Steps to reproduce

      1. Go to Control Panel => Configuration => Server Administrator => Log Level => Add Category
      2. Add com.liferay.portal.kernel.portlet.LiferayPortlet with DEBUG level
      3. Go to a existing Site => Content => Document Library
      4. Import a new DLFileEntry in Document Library
      5. Go to LIFERAY_HOME/data/document_library and delete DLStore file. Note: filesystem path is:
        • In case of folderId=0: [companyId]/[groupId]/[name]
        • In case of folderId!=0: [companyId]/[folderId]/[name]
      6. Go to Liferay user interface => "Documents and media"
      7. Edit DLFileEntry and upload a new file:
        • Expected behavior: a new version is created for existing DLFileEntry with new file
        • Wrong behavior: a exception is thrown and new version is not created
      8. Check log file:
        • Expected behavior: no stacktrace is written to log file
        • Wrong behavior: following stacktrace is written to log file
          2019-01-02 11:07:43.435 DEBUG [http-nio-8080-exec-9][LiferayPortlet:597] com.liferay.document.library.kernel.exception.NoSuchFileException: {companyId=20099, repositoryId=20126, fileName=101, version=1.0}
          com.liferay.document.library.kernel.exception.NoSuchFileException: {companyId=20099, repositoryId=20126, fileName=101, version=1.0}
                  at com.liferay.portal.store.file.system.FileSystemStore.copyFileVersion(FileSystemStore.java:127)
                  at com.liferay.portal.store.ignore.duplicates.wrapper.internal.IgnoreDuplicatesStore.lambda$copyFileVersion$3(IgnoreDuplicatesStore.java:105)
                  at com.liferay.portal.store.ignore.duplicates.wrapper.internal.IgnoreDuplicatesStore.recoverAndRetryOnFailure(IgnoreDuplicatesStore.java:343)
                  at com.liferay.portal.store.ignore.duplicates.wrapper.internal.IgnoreDuplicatesStore.copyFileVersion(IgnoreDuplicatesStore.java:102)
                  at com.liferay.portal.store.safe.file.name.wrapper.internal.SafeFileNameStore.copyFileVersion(SafeFileNameStore.java:119)
                  at com.liferay.portlet.documentlibrary.store.DLStoreImpl.copyFileVersion(DLStoreImpl.java:205)
                  at com.liferay.document.library.kernel.store.DLStoreUtil.copyFileVersion(DLStoreUtil.java:213)
                  at com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.checkOutFileEntry(DLFileEntryLocalServiceImpl.java:467)
          

      Steps to reproduce with Staging

      1. Configure a new site with Local Staging enabled
      2. Create a new DLFileEntry in Document Library
      3. Publish to Live
      4. Go to LIFERAY_HOME/data/document_library and delete DLStore file only for Live site entry. Note: filesystem path is:
        • In case of folderId=0: [companyId]/[groupId]/[name]
        • In case of folderId!=0: [companyId]/[folderId]/[name]
      5. Go to Staging site => "Documents and media" and import a new version
      6. Publish new version from staging to live:
        • Expected behavior: publish operation is executed sucessfully
        • Wrong behavior: a exception is thrown and publish operation is not executed

        Attachments

          Activity

            People

            • Assignee:
              peyton.zhao Peyton Zhao (Inactive)
              Reporter:
              jorge.diaz Jorge Diaz
              Participants of an Issue:
              Recent user:
              Clarissa Velazquez
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

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

                Packages

                Version Package
                7.0.0 DXP FP71
                7.0.10.11 DXP SP11
                7.0.X
                7.1.10 DXP FP7
                7.1.10.2 SP2
                7.1.3 CE GA4
                7.1.X
                Master