Issue
- There has been a documented case where Commerce modules fail to deploy following license expiration and redeployment
WARN [fileinstall-directory-watcher][PortalLicenseEnterpriseAppGateKeeper:333]
Unable to install bundle com.liferay.commerce.account.admin.web-3.0.8.jar?
lpkgPath=file:/opt/liferay/osgi/marketplace/Liferay%20Commerce%20-%20Liferay
%20Commerce%20-%20Impl.lpkg
Environment
- Liferay PaaS
- Liferay Commerce
Resolution
-
This may be caused by a race condition during the deployment process where the Commerce module is deployed prior to the updated license's deployment. As a workaround, instead of copying the updated Commerce license XML into the service's deploy folder, you can obtain the
.lifile in/data/licenseafter you deploy thelicense.xmlinto a local Liferay instance. Once the.lifile is generated you can then copy that into your service build folder. -
For example when using Liferay Experience Cloud-SM, an admin can:
1. Deploy
license.xmlin a local instance so that the.lifile is generated (the.lifile will be in the{$liferay.home}/data/licensedirectory)
2. Put that in your/liferay/configsfolder and make note of its location (ENV being the target environment, e.g. dev, prd, uat)
3. Write a.shscript that will copy the.lifile into the Liferay service's/data/licensedirectory from the directory specified in step 2.
Additional Information
- More information on custom script execution can be found here.
- If there is an XML license in the environment's
configs/{env}/deploydirectory, it can interfere with the.shscript and contribute to the race condition. In this case, remove the XML license from the build prior to deployment.