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

Occasional "Store is not available" error during UpgradeImageTypeContent

    Details

      Description

      Description
      This issue is similar to LPS-128852. During the UpgradeImageTypeContent process, a "Store is not available" error can occur occasionally. This is due to a race condition.

      The solution of LPS-128852 was to add a dependency from UpgradeBlogsImages (and other upgrade processes that had this issue) onto an activated StoreFactory. The UpgradeImageTypeContent process does not have this dependency, however. Since it is possible for UpgradeImageTypeContent to call StoreFactory.getStore, this means that the upgrade process could fail if UpgradeImageTypeContent starts running before the StoreFactory is activated.

      We should add a dependency from UpgradeImageTypeContent onto the activated StoreFactory so that this error cannot occur.

      Here is an example stack trace from when the error occurs:

      2021-07-16 23:50:21.539 ERROR [ForkJoinPool-2-worker-4][ImageImpl:69] Error reading image 4729563
      java.lang.IllegalStateException: Store is not available
      	at com.liferay.portlet.documentlibrary.store.StoreFactory.getStore(StoreFactory.java:115)
      	at com.liferay.portlet.documentlibrary.store.DLStoreImpl.getFileAsStream(DLStoreImpl.java:285)
      	at com.liferay.document.library.kernel.store.DLStoreUtil.getFileAsStream(DLStoreUtil.java:294)
      	at com.liferay.portal.model.impl.ImageImpl.getTextObj(ImageImpl.java:60)
      	at com.liferay.journal.internal.upgrade.v1_1_0.UpgradeImageTypeContent$SaveImageFileEntryCallable.call(UpgradeImageTypeContent.java:179)
      	at com.liferay.journal.internal.upgrade.v1_1_0.UpgradeImageTypeContent$SaveImageFileEntryCallable.call(UpgradeImageTypeContent.java:142)
      	at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(Unknown Source)
      	at java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
      	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source)
      	at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
      	at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
      

      Steps to Reproduce
      Unfortunately, this issue cannot be reproduced consistently. It can happen randomly when upgrading from 7.0 to 7.3+, if you have at least one web content article with an image associated with it.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jeremy.chen Jeremy Chen
              Reporter:
              michael.bowerman Michael Bowerman
              Participants of an Issue:
              Recent user:
              Enterprise Release HU
              Engineering Assignee:
              Michael Bowerman
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                12 weeks, 1 day ago

                  Packages

                  Version Package
                  7.3.X
                  7.4.2 CE GA3 DXP 7,4
                  Master