Warning when subdomain is created: File exists ERROR: Cannot relink logs

Created:

2016-11-16 13:13:13 UTC

Modified:

2017-08-16 16:35:03 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Warning when subdomain is created: File exists ERROR: Cannot relink logs

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 11.x for Linux
  • Plesk 12.0 for Linux

Symptoms

Logs directory is not created at the creation of the subdomain. The following error is shown:

System error 2: No such file or directoryWarning: mkdir: cannot create directory `./example.com/logs': File exists ERROR: Cannot relink logs. Target directory '/var/www/vhosts/example.com/logs' is in invalid state.

The following command returns an error:

# /opt/psa/admin/sbin/relink-vhost-logs --domain-name example.com --sys-user-login ftpuser
WARNING during statistics_collector execution: : statistics_collector[3108]: Relinking of virtual host logs `/opt/psa/admin/sbin/relink-vhost-logs --domain-name example.com --sys-user-login ftpuser' 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.

Cause

The directory '/var/www/vhosts/example.com/logs/' has incorrect permissions and ownership.

Resolution

Fix the permissions and ownership, as follows:

# chmod 700 /var/www/vhosts/example.com/logs/
# chown .root /var/www/vhosts/example.com/logs/
Have more questions? Submit a request
Please sign in to leave a comment.