Symptoms
- The following error is shown when browsing domain in Plesk at Domains > example.com or at Domains > example.com > FTP Access:
C:\Inetpub\vhosts\example.com\httpdocs is out of webspace
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"?
CauseDatabase 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/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:
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:
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