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

Race condition: IllegalStateException: Store is not available error on startup after upgrade

    Description

    Steps to Reproduce:

    1. Import attached 720 database dump of MySQL.
    2. Upgrade to master.
    3. Start portal.

    Expected Result:
    Portal startup without error.

    Actual Result:
    Below error thrown during startup:

    [parallel] 2021-05-06 04:05:05.378 ERROR [SCR Component Actor][DefaultGuestGroupLogoSwapper:93] bundle com.liferay.portal.properties.swapper:5.0.2 (238)[com.liferay.portal.properties.swapper.internal.DefaultGuestGroupLogoSwapper(9593)] : The activate method has thrown an exception 
     [parallel] java.lang.IllegalStateException: Store is not available
     [parallel] 	at com.liferay.portlet.documentlibrary.store.StoreFactory.getStore(StoreFactory.java:119) ~[portal-impl.jar:?]
     [parallel] 	at com.liferay.portlet.documentlibrary.store.DLStoreImpl.hasFile(DLStoreImpl.java:338) ~[portal-impl.jar:?]
     [parallel] 	at com.liferay.document.library.kernel.store.DLStoreUtil.hasFile(DLStoreUtil.java:378) ~[portal-kernel.jar:?]
     [parallel] 	at com.liferay.portal.image.DLHook.updateImage(DLHook.java:80) ~[portal-impl.jar:?]
     [parallel] 	at com.liferay.portal.service.impl.ImageLocalServiceImpl.updateImage(ImageLocalServiceImpl.java:189) ~[portal-impl.jar:?]
     [parallel] 	at com.liferay.portal.service.impl.ImageLocalServiceImpl.updateImage(ImageLocalServiceImpl.java:162) ~[portal-impl.jar:?]
     [parallel] 	at com.liferay.portal.service.impl.ImageLocalServiceImpl.moveImage(ImageLocalServiceImpl.java:140) ~[portal-impl.jar:?]
     [parallel] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
     [parallel] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]
     [parallel] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
     [parallel] 	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
     [parallel] 	at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50) ~[portal-impl.jar:?]
     [parallel] 	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:69) ~[portal-impl.jar:?]
     [parallel] 	at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57) ~[portal-impl.jar:?]
     [parallel] 	at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49) ~[portal-impl.jar:?]
     [parallel] 	at com.sun.proxy.$Proxy123.moveImage(Unknown Source) ~[?:?]
     [parallel] 	at com.liferay.portal.kernel.service.ImageLocalServiceUtil.moveImage(ImageLocalServiceUtil.java:292) ~[portal-kernel.jar:?]
     [parallel] 	at com.liferay.portal.util.PortalImpl.updateImageId(PortalImpl.java:7025) ~[portal-impl.jar:?]
     [parallel] 	at com.liferay.portal.kernel.util.PortalUtil.updateImageId(PortalUtil.java:2118) ~[portal-kernel.jar:?]
     [parallel] 	at com.liferay.portal.service.impl.LayoutSetLocalServiceImpl.updateLogo(LayoutSetLocalServiceImpl.java:304) ~[portal-impl.jar:?]
     [parallel] 	at com.liferay.portal.service.impl.LayoutSetLocalServiceImpl.updateLogo(LayoutSetLocalServiceImpl.java:361) ~[portal-impl.jar:?]
     [parallel] 	at com.liferay.portal.service.impl.LayoutSetLocalServiceImpl.updateLogo(LayoutSetLocalServiceImpl.java:343) ~[portal-impl.jar:?]
     [parallel] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
     [parallel] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]
     [parallel] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
     [parallel] 	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
     [parallel] 	at com.liferay.portal.service.impl.LayoutSetLocalServiceStagingAdvice$LayoutSetLocalServiceStagingInvocationHandler.invoke(LayoutSetLocalServiceStagingAdvice.java:124) ~[portal-impl.jar:?]
     [parallel] 	at com.sun.proxy.$Proxy182.updateLogo(Unknown Source) ~[?:?]
     [parallel] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
     [parallel] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]
     [parallel] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
     [parallel] 	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
     [parallel] 	at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50) ~[portal-impl.jar:?]
     [parallel] 	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:69) ~[portal-impl.jar:?]
     [parallel] 	at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57) ~[portal-impl.jar:?]
     [parallel] 	at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49) ~[portal-impl.jar:?]
     [parallel] 	at com.sun.proxy.$Proxy182.updateLogo(Unknown Source) ~[?:?]
     [parallel] 	at com.liferay.portal.properties.swapper.internal.DefaultGuestGroupLogoSwapper.activate(DefaultGuestGroupLogoSwapper.java:86) ~[?:?]
     [parallel] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
     [parallel] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]
     [parallel] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
     [parallel] 	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
     [parallel] 	at org.apache.felix.scr.impl.inject.methods.BaseMethod.invokeMethod(BaseMethod.java:228) ~[bundleFile:?]
     [parallel] 	at org.apache.felix.scr.impl.inject.methods.BaseMethod.access$500(BaseMethod.java:41) ~[bundleFile:?]
     [parallel] 	at org.apache.felix.scr.impl.inject.methods.BaseMethod$Resolved.invoke(BaseMethod.java:664) ~[bundleFile:?]
     [parallel] 	at org.apache.felix.scr.impl.inject.methods.BaseMethod.invoke(BaseMethod.java:510) [bundleFile:?]
     [parallel] 	at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:310) [bundleFile:?]
     [parallel] 	at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:300) [bundleFile:?]
     [parallel] 	at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:341) [bundleFile:?]
     [parallel] 	at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:114) [bundleFile:?]
     [parallel] 	at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:983) [bundleFile:?]
     [parallel] 	at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:956) [bundleFile:?]
     [parallel] 	at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:765) [bundleFile:?]
     [parallel] 	at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:666) [bundleFile:?]
     [parallel] 	at org.apache.felix.scr.impl.manager.AbstractComponentManager$1.run(AbstractComponentManager.java:456) [bundleFile:?]
     [parallel] 	at org.apache.felix.scr.impl.ComponentActorThread.run(ComponentActorThread.java:113) [bundleFile:?]
     [parallel] 	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]
    

    The failure rate is pretty low for an individual test (5%). But because we run multiple upgrade test executions regularly on CI (and on different database dumps), this issue can be seen every day in automation.

    Examples from CI:
    https://testray.liferay.com/home/-/testray/case_results/1530714798
    https://testray.liferay.com/home/-/testray/case_results/1530717415
    https://testray.liferay.com/home/-/testray/case_results/1530717763
    https://testray.liferay.com/home/-/testray/case_results/1530717679

      Attachments

        Issue Links

          Activity

            People

            Assignee:
            victor.ware Victor Ware
            Reporter:
            summer.zhang Summer Zhang
            Participants of an Issue:
            Recent user:
            Victor Ware
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

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

                Packages

                Version Package