Internal error: /var/www/vhosts/example.com/httpdocs is out of webspace

Created:

2016-11-16 12:46:21 UTC

Modified:

2017-04-24 11:13:56 UTC

1

Was this article helpful?


Have more questions?

Submit a request

Internal error: /var/www/vhosts/example.com/httpdocs is out of webspace

Applicable to:

  • Plesk

Symptoms

An error is displayed while accessing a domain option in Plesk or logging in to Plesk under user credentials:

Internal error: /var/www/vhosts/example.com/httpdocs is out of webspace
Message /var/www/vhosts/example.com/httpdocs is out of webspace
File Webspace.php
Line 378
Type PleskFatalException

Go To Previous Page

Search for related Knowledge Base articles

Cause

Inconsistency in the Plesk database.

Resolution

  1. Before aplying the solution below create a backup of Plesk database using the article How to backup/restore a Plesk database dump .
  2. Select all FTP users (including the default one) for the affected domain:

    mysql>  select distinct d.id,d.webspace_id as webspace_id,d.name as domain,su.login,su.home,h.www_root from domains d join hosting h on h.dom_id=d.id left join ftp_users fu on fu.dom_id=d.id join sys_users su on (fu.sys_user_id=su.id or h.sys_user_id=su.id)  where d.name='example.com' order by d.name\\G;
    *************************** 1. row ***************************
    id: 259
    webspace_id: 0
    domain: example.com
    login: user_login
    home: /var/www/vhosts/example.com
    www_root: /var/www/vhosts/example.com/httpdocs
    1 row in set (0.00 sec)
  3. Find the default sys_user by following the entries in the 'hosting' and 'sys_users' tables:

    mysql>  select dom_id,sys_user_id,www_root from hosting where dom_id=259;
    +--------+-------------+-------------------------------------------+
    | dom_id | sys_user_id | www_root |
    +--------+-------------+-------------------------------------------+
    | 259 | 261 | /var/www/vhosts/example.com/httpdocs |
    +--------+-------------+-------------------------------------------+
    1 row in set (0.00 sec)

    mysql> select id,login,home from sys_users where id=261;
    +-----+---------------+----------------------------------+
    | id | login | home |
    +-----+---------------+----------------------------------+
    | 261 | user_login | /var/www/vhosts/example.com |
    +-----+---------------+----------------------------------+
    1 row in set (0.00 sec)
  4. There are several typical inconsistencies:

  5. www_root in the 'hosting' table does not match the default system user home:

        mysql>  select dom_id,sys_user_id,www_root from hosting where dom_id=259;
    +--------+-------------+-------------------------------------------+
    | dom_id | sys_user_id | www_root |
    +--------+-------------+-------------------------------------------+
    | 259 | 261 | /var/www/vhosts/example12345.com/httpdocs |
    +--------+-------------+-------------------------------------------+
    1 row in set (0.00 sec)

    mysql> select id,login,home from sys_users where id=261;
    +-----+---------------+----------------------------------+
    | id | login | home |
    +-----+---------------+----------------------------------+
    | 261 | user_login | /var/www/vhosts/example.com |
    +-----+---------------+----------------------------------+
    1 row in set (0.00 sec)

    It can be fixed by updating the `www_root`:

    mysql> update hosting set www_root='/var/www/vhosts/example.com' where dom_id=259;
  6. An additional FTP user home directory is out of the main system user home directory. In this case, the query from step #1 above will return more than one result and home will be different for two system users:

        mysql>  select distinct d.id,d.webspace_id as webspace_id,d.name as domain,su.login,su.home,h.www_root from domains d join hosting h on h.dom_id=d.id left join ftp_users fu on fu.dom_id=d.id join sys_users su on (fu.sys_user_id=su.id or h.sys_user_id=su.id)  where d.name='example.com' order by d.name;

    +-----+-------------+------------+--------------+-----------------------------+--------------------------------------+
    | id | webspace_id | domain | login | home | www_root |
    +-----+-------------+------------+--------------+-----------------------------+--------------------------------------+
    | 259 | 0 | example.com | user_login | /var/www/vhosts/example.com | /var/www/vhosts/example.com/httpdocs |
    | 260 | 0 | example.com | user2_login | /var/www/vhosts/example2.com | /var/www/vhosts/example2.com/httpdocs |
    +-----+-------------+------------+--------------+------------------------------+--------------------------------------+

    It can be fixed for the problematic system user:

    mysql> update sys_users set home='/var/www/vhosts/example.com/user_folder' where login='user2_login';

    Please note that `'/var/www/vhosts/example.com/user_folder'` should exist on the file system.
  7. A domain in the webspace has its www_root directory outside of webspace's www_root directory:

        mysql>  select distinct d.id,d.webspace_id as webspace_id,d.name as domain,su.login,su.home,h.www_root from domains d join hosting h on h.dom_id=d.id left join ftp_users fu on fu.dom_id=d.id join sys_users su on (fu.sys_user_id=su.id or h.sys_user_id=su.id)  where d.name='example.com' order by d.name;

    +-----+-------------+------------+-------------+-----------------------------+--------------------------------------+
    | id | webspace_id | domain | login | home | www_root |
    +-----+-------------+------------+-------------+-----------------------------+--------------------------------------+
    | 259 | 0 | example.com | user_login | /var/www/vhosts/example.com | /var/www/vhosts/example.com/httpdocs |
    | 260 | 259 | example.com | user2_login | /var/www/vhosts/example2.com | /var/www/vhosts/example2.com/httpdocs |
    +-----+-------------+------------+-------------+-----------------------------+--------------------------------------+

    Here, the entry with `'webspace_id=0'` is the main domain of a webspace. All child domains have `'webspace_id=259'` and should be inside the `'/var/www/vhosts/example.com'` folder. This situation can be corrected by setting `'webspace_id=0'` for example2.com:

    mysql> update domains set webspace_id=0 where id=260;

    Alternatively, correct `www_root` in `hosting` table:

    mysql> update hosting set www_root='/var/www/vhosts/example.com/example2_folder' where dom_id=260;

    When using the above method, ensure that `'/var/www/vhosts/example.com/example2_folder'` exists on the file system.

Note: In some cases it is also required to reconfigure the domain to point to the correct www-root in Apache configuration:

# plesk sbin httpdmng  --reconfigure-domain example.com
Have more questions? Submit a request
Please sign in to leave a comment.