Domains and subscriptions list is empty

Created:

2016-11-16 13:21:58 UTC

Modified:

2017-08-16 16:55:55 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Domains and subscriptions list is empty

Applicable to:

  • Plesk for Windows
  • Plesk for Linux

Symptoms

  • The Domains or Subscriptions list is empty in Plesk:

    Domains list

    The following error is shown in the Error Console ( Mozilla Firefox > Tools >Web Developer > Error Console ):

    TypeError: item.ownerName is null

    OR

    Error: item.ownerName is null
    Source File: https://PLESKHOST:8443/admin/domain/list?context=domains
    Line: 220
  • When trying to search for the domain in Search tab the same error appears in Plesk interface:

    TypeError: item.ownerName is null
  • Few subscriptions disappeared after upgrade.

    The data of subscriptions are present on the server.

Cause

Database inconsistency. At least one domain in Plesk is assigned to a non-existent customer.

Resolution

To fix the inconsistency the domain should be assigned to an existing customer. This example shows how to assign it to admin .

  1. Create a backup of the Plesk database .

  2. Access MySQL database

  3. Identify the IDs and names of the domains that are assigned to non-existent customers.
    mysql> SELECT d.id, d.cl_id, d.name FROM domains d LEFT JOIN clients c ON d.cl_id = c.id WHERE c.id IS NULL;

    +----+-------+----------+
    | id | cl_id | name |
    +----+-------+----------+
    | 4 | 0 | sub4.tld |
    | 5 | 0 | sub5.tld |
    +----+-------+----------+

Note that if there is other cl_id shown in the above output (not equal to 0), then the client is missing in clients table. For example, if cl_id =7 is shown, then client with id=7 is missing in clients table.

  1. Identify the ID of the user. In this case the ID is 1.

    mysql> SELECT id FROM clients WHERE type='admin';
    +----+
    | id |
    +----+
    | 1 |
    +----+
  2. To fix one domain, assign it to specified user (in this case "admin"), with a specific ID (in this case 4) use the following commands:

    mysql> UPDATE domains SET cl_id =1 WHERE id=4;
  3. To fix all domains with non-existent customers use the following instructions:

    6.1. Put the IDs of the domains into a file:

    For Linux

    #  MYSQL_PWD=`cat /etc/psa/.psa.shadow`  mysql -uadmin  -Dpsa -Ne"SELECT d.id FROM domains d LEFT JOIN clients c ON d.cl_id = c.id WHERE c.id IS NULL;" > ./domains_ids

    For Windows

    %plesk_dir%\\MySQL\\bin>mysql.exe -P8306 -uadmin -p<admin_password> psa -Ne "SELECT d.id FROM domains d LEFT JOIN clients c ON d.cl_id = c.id;" > ./domains_ids

    6.2. Verify that the IDs of the domains are the same as in paragraph 2:

    For Linux

    # cat ./domains_ids
    4
    5

    For Windows

    Open %plesk_dir%\\MySQL\\bin\\domains_ids file using a notepad.

    6.3. Assign those domains to admin using the following command:

    For Linux

    # cat domains_ids|while read i;do echo ==changing domain with id $i==;domain_id=$i; MYSQL_PWD=`cat /etc/psa/.psa.shadow`  mysql -uadmin -Dpsa -e"UPDATE domains SET cl_id =$admin_id WHERE id=$domain_id";done
    ==changing domain with id 4==
    ==changing domain with id 5==

    For Windows

    %plesk_dir%\\MySQL\\bin>for /F %i IN (domains_ids) do @mysql.exe -P8306 -uadmin -p<admin_password> psa -Ne "UPDATE domains SET cl_id =4 WHERE id=%i;"
Have more questions? Submit a request
Please sign in to leave a comment.