- Plesk for Linux
The following error occurs during statistic recalculation:
# /usr/local/psa/admin/sbin/statistics --calculate-one --domain-name=example.com
WARNING during statistics_collector execution: : statistics_collector: Relinking of virtual host logs `/opt/psa/admin/sbin/relink-vhost-logs --domain-name example.com --sys-user-login user' failed with code 3.
Stderr:'./example.com/logs' already exists, but has wrong access rights. Specify --force to override.
ERROR: Cannot relink logs. Target directory '/var/www/vhosts/example.com/logs' is in invalid state.
drwxr--r-- 4 user user 4096 Sep 6 10:43 /var/www/vhosts/example.com/logs/
The following error can be found in
CONFIG_TEXT: statistics_collector: Relinking of virtual host logs `/usr/local/psa/admin/sbin/relink-vhost-logs --domain-name example.com --sys-user-login user' failed with code 3.#012Stdout:#012Stderr:'./example.com/logs' doesn't exist. Specify --create to create.#012ERROR: Cannot relink logs. Target directory '/var/www/vhosts/example.com/logs' is in invalid state.#012
There is different information between the one found in Plesk > Statistics > Logs section than the one stored in vhosts directory
/var/www/vhosts/example.com/logs/ does not exist or has incorrect permissions and ownership.
- Login to the server over SSH.
- Create the missing directory using the command from the error message with
--forceoptions added, replace jdoe with system user's name and example.com with actual domain's name:
# plesk sbin relink-vhost-logs --domain-name example.com --sys-user-login jdoe --force --create
- Check the directory. It should have the following permissions/ownership:
# ls -ld /var/www/vhosts/example.com/logs/
drwx------ 4 jdoe root 4096 Sep 6 10:43 /var/www/vhosts/example.com/logs/