Articles in this section

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

Plesk for Windows Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux
  • Plesk for Windows

Symptoms

  • The following error is shown when browsing domain in Plesk at Domains > example.com or at Domains > example.com > FTP Access:

    PLESK_ERROR: C:\Inetpub\vhosts\example.com\httpdocs is out of webspace


    PLESK_ERROR: 500 TypeError
    Cannot destructure property 'isSecondaryCollapsible' of 'e' as it is undefined.

  • The following error is shown when trying to repair Plesk database:

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

CONFIG_TEXT: /var/www/vhosts/example.com/

The document root (www_root) is:

CONFIG_TEXT: /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/httpdocs' where sys_user_id=2;"

  5. Set the proper permissions:

    # plesk repair fs example.com

Plesk for Windows
  1. Connect to the server via RDP

  2. Back up the Plesk database:

    # plesk db dump > C:\backup.sql

  3. Log in to Plesk database:

    # plesk db

  4. Check that www_root and home paths are set correctly in Plesk database:

    MYSQL_WIN: select id,home from sys_users where home like "%example.com%";
    +----+--------------------------------+
    | id | home                           |
    +----+--------------------------------+
    | 15 | C:\inetpub\vhosts\example.com  |
    +----+--------------------------------+

    select www_root from hosting where sys_user_id=15;
    +----------------------------------------+
    | www_root                               |
    +----------------------------------------+
    | C:\inetpub\vhosts\example.com\httpdocs |
    +----------------------------------------+

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

    MYSQL_WIN: update hosting set www_root='C:\\inetpub\\vhosts\\example.com\\httpdocs' where sys_user_id=15;
    update sys_users set home='C:\\inetpub\\vhosts\\example.com' where id=15;

  6. Update the permissions:

    C:\> "%plesk_cli%\repair.exe" --repair-webspace-security -webspace-name example.com

Bonus - how to replace the paths for entire database:

  1. Create Plesk database dump:

    C:\> plesk db dump psa > C:\psa_original.sql

  2. Create another Plesk dump for changes:

    C:\> plesk db dump psa > C:\psa_modified.sql

  3. Open psa_modified.sql in a text editor with "find and replace" function, for example Notepad++.
  4. Find and replace all paths with "C:\\inetpub\\vhosts\\" to "D:\\WebSites\\":​
  5. Import the modified database to Plesk:

    C:\> plesk db < C:\psa_modified.sql

If any issues appeared, roll back the C:\psa_original.sql database.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.