Issue
Workbench may intermittently fall back to an expired trial license state and display an 'Invalid License' error, even when a valid license file is present. This occurs when the service user (rstudio-server) cannot traverse the parent directory to read the license file.
Description
Even when the license file itself has the correct ownership (rstudio-server:rstudio-server) and permissions (600), if the parent directory (/var/lib/rstudio-server) has overly restrictive permissions, the service cannot access the license file. This results in Workbench falling back to any expired trial license state.
Symptoms include:
- Intermittent 'Invalid Posit Workbench license — redirecting to license expired page' errors.
- License manager shows both an active license file and an expired trial license simultaneously.
- The command 'sudo -u rstudio-server cat /var/lib/rstudio-server/license-file.lic' returns 'Permission denied'.
Solution
1. Adjust the parent directory permissions to allow the rstudio-server user to traverse it. By default, the directory is owned by the rstudio-server user and the permissions are as follows on a new installation:
sudo chmod 755 /var/lib/rstudio-server2. Ensure the license file has correct ownership and permissions:
sudo chown rstudio-server:rstudio-server /var/lib/rstudio-server/license-file.lic
sudo chmod 600 /var/lib/rstudio-server/license-file.lic3. Restart the Workbench services:
sudo systemctl restart rstudio-server
sudo systemctl restart rstudio-launcher4. Verify the fix by checking if the service user can read the file:
sudo -u rstudio-server cat /var/lib/rstudio-server/license-file.lic5. Check the license status to confirm only the valid license is active:
sudo rstudio-server license-manager statusIf you're still having issues, you can reach out to Support by opening a ticket here.