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:
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
- Log into the server via SSH.
- Create a backup for psa database:
# plesk db dump psa > psa.sql
- Check the current home and document root directories in
sys_users
andhosting
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 |
+--------------------------------------+ - 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;" - Set the proper permissions:
# plesk repair fs example.com
-
Connect to the server via RDP
- Back up the Plesk database:
# plesk db dump > C:\backup.sql
- Log in to Plesk database:
# plesk db
-
Check that
www_root
andhome
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 |
+----------------------------------------+ -
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; -
Update the permissions:
C:\> "%plesk_cli%\repair.exe" --repair-webspace-security -webspace-name example.com
Bonus - how to replace the paths for entire database:
- Create Plesk database dump:
C:\> plesk db dump psa > C:\psa_original.sql
- Create another Plesk dump for changes:
C:\> plesk db dump psa > C:\psa_modified.sql
- Open psa_modified.sql in a text editor with "find and replace" function, for example Notepad++.
- Find and replace all paths with "C:\\inetpub\\vhosts\\" to "D:\\WebSites\\":
- 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.
Comments
0 comments
Please sign in to leave a comment.