Articles in this section

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

Plesk for Linux kb: technical ABT: Group A

Applicable to:

  • Plesk for Linux

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:

    CONFIG_TEXT: 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

  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/

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.