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

Fail to preview image after upgrading from 6.2/7.0 to master

    Description

    Steps to reproduce:

    In 6.2 or 7.0

    1. Add structure with an image field and a template to it
    2. Add a web content with created structure , in the image field, add an image

    In master

    1. Copy the data file to master
    2. Upgrade to master using upgrade tool
    3. Check the image field

    Actual result:
    The image is missing after the upgrade is concluded and the following stacktrace is thrown in the server console during upgrade tool's execution:

    2021-08-03 17:36:42.245 INFO  [Portal Dependency Manager Component Executor--1][UpgradeProcess:111] Upgrading com.liferay.journal.internal.upgrade.v1_1_0.ImageTypeContentUpgradeProcess
    2021-08-03 17:36:42.246 INFO  [Portal Dependency Manager Component Executor--1][LoggingTimer:83] Starting com.liferay.journal.internal.upgrade.v1_1_0.ImageTypeContentUpgradeProcess#copyJournalArticleImagesToJournalRepository
    2021-08-03 17:36:42.405 ERROR [ForkJoinPool-3-worker-9][ImageImpl:73] Error reading image 20565
    com.liferay.document.library.kernel.exception.NoSuchFileException: {companyId=20155, repositoryId=0, fileName=20565.jpg, cause=java.io.FileNotFoundException: /Users/rodrigo/Liferay/builds/liferay-portal-master/data/document_library/20155/0/20565.jpg/1.0 (No such file or directory)}
    	at com.liferay.portal.store.file.system.FileSystemStore.getFileAsStream(FileSystemStore.java:140) ~[?:?]
    	at com.liferay.portal.store.file.system.safe.file.name.SafeFileNameStore.getFileAsStream(SafeFileNameStore.java:93) ~[?:?]
    	at com.liferay.change.tracking.store.internal.CTStore.getFileAsStream(CTStore.java:139) ~[?:?]
    	at com.liferay.portlet.documentlibrary.store.DLStoreImpl.getFileAsStream(DLStoreImpl.java:288) ~[portal-impl.jar:?]
    	at com.liferay.document.library.kernel.store.DLStoreUtil.getFileAsStream(DLStoreUtil.java:294) ~[portal-kernel.jar:?]
    	at com.liferay.portal.model.impl.ImageImpl.getTextObj(ImageImpl.java:64) [portal-impl.jar:?]
    	at com.liferay.journal.internal.upgrade.v1_1_0.ImageTypeContentUpgradeProcess$SaveImageFileEntryUpgradeCallable.doCall(ImageTypeContentUpgradeProcess.java:182) [bundleFile:?]
    	at com.liferay.journal.internal.upgrade.v1_1_0.ImageTypeContentUpgradeProcess$SaveImageFileEntryUpgradeCallable.doCall(ImageTypeContentUpgradeProcess.java:144) [bundleFile:?]
    	at com.liferay.portal.kernel.upgrade.BaseUpgradeCallable.call(BaseUpgradeCallable.java:36) [portal-kernel.jar:?]
    	at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424) [?:1.8.0_221]
    	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_221]
    	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_221]
    	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_221]
    	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) [?:1.8.0_221]
    Caused by: java.io.FileNotFoundException: /Users/rodrigo/Liferay/builds/liferay-portal-master/data/document_library/20155/0/20565.jpg/1.0 (No such file or directory)
    	at java.io.FileInputStream.open0(Native Method) ~[?:1.8.0_221]
    	at java.io.FileInputStream.open(FileInputStream.java:195) ~[?:1.8.0_221]
    	at java.io.FileInputStream.<init>(FileInputStream.java:138) ~[?:1.8.0_221]
    	at com.liferay.portal.store.file.system.FileSystemStore.getFileAsStream(FileSystemStore.java:137) ~[?:?]
    	... 13 more
    2021-08-03 17:36:42.431 INFO  [Portal Dependency Manager Component Executor--1][LoggingTimer:44] Completed com.liferay.journal.internal.upgrade.v1_1_0.ImageTypeContentUpgradeProcess#copyJournalArticleImagesToJournalRepository in 184 ms
    2021-08-03 17:36:42.434 INFO  [Portal Dependency Manager Component Executor--1][UpgradeProcess:126] Completed upgrade process com.liferay.journal.internal.upgrade.v1_1_0.ImageTypeContentUpgradeProcess in 189 ms
    

    Expected result:
    Image field preview works.

      Attachments

      1. 62dump.zip
        1.91 MB
      2. 7.0.10.14-sp14dump.zip
        18.78 MB
      3. expected.PNG
        expected.PNG
        104 kB
      4. reproduce.jpg
        reproduce.jpg
        80 kB
      5. Screen Shot 2021-07-19 at 18.19.24.png
        Screen Shot 2021-07-19 at 18.19.24.png
        1.08 MB

        Activity

          People

          Assignee:
          support-lep@liferay.com SE Support
          Reporter:
          lu.liu Lu Liu
          Participants of an Issue:
          Recent user:
          Oziel Souza
          Engineering Assignee:
          J├╝rgen Kappler
          Votes:
          0 Vote for this issue
          Watchers:
          1 Start watching this issue

            Dates

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

              Packages

              Version Package