Plesk

Cannot create server backup in Plesk: Unable to check the amount of free disk space: Argument 2 passed to PleskOsUnix::relativePath() must be of the type string

Symptoms

Cause

Database inconsistency - there are no records for the example.com domain in the psa.hosting table:

# mysql > select * from hosting where dom_id in (select id from domains where name ="example.com");
Empty set (0.000 sec)

Resolution

Apply one of the following solutions:

Remove the domain from Plesk

If the domain is no longer necessary it can be removed.

1. Log into Plesk
2. Navigate to the Domains list
3. Select the example.com domain and click Remove

Recreate the database record manually

1. Connect to the Plesk server via SSH
2. Back up the Plesk database:

# plesk db dump > backup.sql

3. Access the Plesk database:

# plesk db

4. Identify the domain's ID from the domains table:

# MariaDB [psa]> select id from domains where name="example.com";
+------+
| id |
+------+
| 11 |
+------+
1 row in set (0.12 sec)

5. Identify the domain's system user ID from the sys_users table:

# MariaDB [psa]> select id from sys_users where login="example-user";
+------+
| id |
+------+
| 22 |
+------+
1 row in set (0.12 sec)

6. Recreate the record in the hosting table using the data collected earlier:

# MariaDB [psa]> insert into hosting(dom_id,sys_user_id,www_root) values(11,22,"/var/www/vhosts/example.com/httpdocs");

Note: /var/www/vhosts/example.com/httpdocs is the default document root path in Plesk. It can be changed to a custom one if necessary

7. Run the following command to repair the document root structure:

# plesk bin repair --update-vhosts-structure

8. Navigate to Domains > example.com > Hosting Settings and set all the required options in order not to leave them empty