Plesk

Error during statistic recalculation on a Plesk server: Cannot relink logs. Target directory is in invalid state

Symptoms

Cause

The directory /var/www/vhosts/example.com/logs/ does not exist or has incorrect permissions and ownership.

Resolution

  1. Login to the server over SSH.
  2. 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

  3. 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/