File permissions error after upgrading the stack

Note: please note that Liferay has renamed its Liferay Experience Could offerings to Liferay SaaS (formerly LXC) and Liferay PaaS (formerly LXC-SM).

Issue

  • After updating from a stack to a major version there are errors accessing the images and documents.
  • There are permissions errors in the startup with the following trace: 
    java.io.FileNotFoundException: /opt/liferay/logs/liferay.current.log (Permission denied)

Environment

  • Liferay PaaS

Resolution

  • Ensuring the volume has the correct permissions is the only way for the Liferay service to come back to a healthy state.

  • The fact that the Backup service performs a chown can both cause this issue, but also resolve it.
  • Starting from a bad state where the Backup service did not complete the full ownership change:

    1. update the liveness probe for the Backup service to a sufficiently long time (enough time for the entire chown to succeed). Increasing the failureThreshold or the initDelay to a very large value will suffice. This is only needed on the Liveness probe since the Readiness probe will not cause the Backup service to restart.

    2. after deploying (1) for the Backup service: set the UID:GID to a known incorrect value like 1001:1001. This will cause the root folder to be owned incorrectly, which is necessary to trigger the correct change on the next step.

    3. Set the UID:GID for the backup service to the correct target of 1000:1000. If the root folder of the volume does not match this value, then it will trigger a recursive chown

    4. After the changed of ownership is complete, Restart the Liferay service and monitor the startup.

 

 

¿Fue útil este artículo?
Usuarios a los que les pareció útil: 0 de 0