Plesk

Cannot change hosting type for a Plesk domain: Unable to load object of type SysUser with id

Symptoms

Cause

Database inconsistency: The psa.hosting table contains an orphaned record from dom_id.

Resolution

Automated solution

  1. Connect to the server via SSH/RDP.

  2. Backup Plesk database.

  3. Run Plesk repair utility (for Windows, run Command Prompt first):

    # plesk repair db

    Confirm fix for all errors that begin with:

    Inconsistency in the table 'web_users'
    Inconsistency in the table 'smb_users'

  4. Create the domain or set the necessary hosting type for the domain in the Plesk interface.

Manual solution

  1. Connect to the server via SSH/RDP.

  2. Backup Plesk database.

  3. Enter Plesk database (for Windows, run Command Prompt first):

    # plesk db

  4. Make sure that there is no system user with ID from error message in Plesk database:

    mysql> select * from sys_users where id=1;
    Empty set (0.00 sec)

  5. Find domain ID and make sure that hosting type for the domain is set to none :

    mysql> select id, name, htype from domains where name like '%example.com%';
    +----+-------------+-------+
    | id | name | htype |
    +----+-------------+-------+
    | 76 | example.com | none |
    +----+-------------+-------+
    1 row in set (0.00 sec)

  6. Find the inconsistent record in the hosting table:

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

  7. Remove the inconsistent record using dom_id from previous step:

    mysql> delete from hosting where dom_id=2;

  8. Create the domain or set the necessary hosting type for the domain in the Plesk interface.

Exit mobile version