Symptoms
-
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[12160]: Relinking of virtual host logs `/opt/psa/admin/sbin/relink-vhost-logs --domain-name example.com --sys-user-login user' failed with code 3.
Stdout:
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
/var/log/plesk/panel.log
:statistics_collector[3644]: 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
Cause
The directory /var/www/vhosts/example.com/logs/
does not exist or has incorrect permissions and ownership.
Resolution
- Login to the server over SSH.
- Create the missing directory using the command from the error message with
--create
and--force
options 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/