Plesk

Unable to access domain in Plesk: httpdocs is out of webspace

Symptoms

# plesk repair db -verbose
The home directory of the domain example.com does not
match the system user's default home directory .................... [ERROR]
Replace "/var/www/vhosts/example.com/httpdocs" with "/var/www/vhosts/example2.com/httpdocs"?

Cause

Database inconsistency: domain's document root directory in sys_users and/or hosting table differs from the actual one.

Resolution

Repair the Plesk database:

1. Connect to the server via SSH (Linux) or via RDP (Windows)

2. Repair the database with the following command:

# plesk repair db -y

Note: if the issue persists after applying the steps above, proceed with the manual solution:

Plesk for Linux

In the example below the home directory is:

/var/www/vhosts/example.com/

The document root (www_root) is:

/var/www/vhosts/example.com/httpdocs

  1. Log into the server via SSH.
  2. Create a backup for psa database:

    # plesk db dump psa > psa.sql

  3. Check the current home and document root directories in sys_users and hosting tables - one or both records may be incorrect:

    # plesk db "select id,home from sys_users where home like '%example.com%';"
    +----+-----------------------------+
    | id | home |
    +----+-----------------------------+
    | 2 | /var/www/vhosts/example.com/custom_path |
    +----+-----------------------------+

    # plesk db "select www_root from hosting where sys_user_id=2;"
    +--------------------------------------+
    | www_root |
    +--------------------------------------+
    | /var/www/vhosts/example.com/httpdocs/custom_path |
    +--------------------------------------+

  4. Execute the commands below to set a correct path - use the ID from the previous command's output::

    # plesk db "update sys_users set home='/var/www/vhosts/example.com' where id=2;"
    # plesk db "update hosting set www_root='/var/www/vhosts/example.com…