Issue
When starting one Liferay node, the following error is written to the log file:
Store is not available. Caller service needs to wait for store factory with "dl.store.impl.enabled=true".
The Liferay server is using the "Advanced File System Store", adding this property to the portal-ext.properties
:
dl.store.impl=com.liferay.portal.store.file.system.AdvancedFileSystemStore
Here is the full stack trace:
2022-12-21 11:04:49.938 ERROR [ajp-nio-0.0.0.0-8009-exec-53][PDFProcessorImpl:172] java.lang.IllegalStateException: Store is not available. Caller service needs to wait for store factory with "dl.store.impl.enabled=true".
java.lang.IllegalStateException: Store is not available. Caller service needs to wait for store factory with "dl.store.impl.enabled=true".
at com.liferay.portlet.documentlibrary.store.StoreFactory.getStore(StoreFactory.java:118)
at com.liferay.portlet.documentlibrary.store.DLStoreImpl.hasFile(DLStoreImpl.java:338)
at com.liferay.document.library.kernel.store.DLStoreUtil.hasFile(DLStoreUtil.java:379)
Any Liferay component that tries to access the document library fails due to this error.
How can I fix this error?
New error message as of DXP 7.4 U55
If you are using DXP 7.4 U55 or newer the message error is different, you will get:
Service "com.liferay.document.library.kernel.store.Store{(default=true)}" is unavailable in 60000 milliseconds while setting field "_store" for class "com.liferay.portlet.documentlibrary.store.StoreFactory", will retry...
The error message was changed due to some code refactor applied on LPS-170540. For more information, see commit 90fd6eca8f50c9340065ba6a3f4b65584ab103e4
Environment
- DXP 7.3
- DXP 7.4
Resolution
This error is caused when there is no system setting configurations of the "Advanced File System Store".
With no configurations, the osgi module of the advanced file system store is not loaded, causing the Store is not available.
error.
To solve it, you have to create in LIFERAY_HOME/osgi/configs a file called com.liferay.portal.store.file.system.configuration.AdvancedFileSystemStoreConfiguration.config
The content of this file points to the document_library folder where the store is created.
Its default value is:
rootDir="data/document_library"
Alternative solution
If you have tried creating the com.liferay.portal.store.file.system.configuration.AdvancedFileSystemStoreConfiguration.config
file but the problem is not solved, you can try this alternative solution:
- Remove the
dl.store.impl=com.liferay.portal.store.file.system.AdvancedFileSystemStore
line from yourportal-ext.properties
file, in order to use the out-of-the-box FileSystemStore. That will avoid all the Store errors during startup. - Restart your Liferay, all the errors related to the Store during startup time should be solved, but you won't be able to access to any stored files.
- Go to Control Panel => System Settings => File Storage => Advanced File System Store and configure the correct path to the document_library folder.
- Set again the
dl.store.impl=com.liferay.portal.store.file.system.AdvancedFileSystemStore
line in yourportal-ext.properties
file. - Restart your Liferay server.