Unable to load object of type BsDomain with id=: Domain does not exist.

Refers to:

  • Plesk 10.4 for Windows
  • Plesk 12.5 for Linux
  • Plesk 10.4 for Linux
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Windows
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Windows
  • Plesk 12.0 for Linux
  • Plesk 12.5 for Windows
  • MT:2dafbf2cbe6f82883222f5f2926ee11c
  • MG:c18c563147e4126261926d63866c0a77
  • MT:fc6dfb994669ec7594fae691e80e6393
  • MG:f3ef6f69eba03b4b1e4e411cfa9c86c6
  • MT:0e9c0e3b0a611d4826a44f8b620c6d0f
  • MG:9a824e337480135f2f8fbd04679d0dd2
  • MT:99f84eb324ef582491d23a38ab088f06
  • MT:c33a0d9832f4fe16f180bc9cfeda4eec
  • MG:3dea7b3ad4e4f6ea360d07a2d452e2c6
  • MT:d1ab5926340770993a5800d2a14b2ece
  • MT:f18bec58447769ce153396413b401e37
  • MG:621dbb10865c5b68849bf11fab66b4dd

Created:

2016-11-16 13:02:01 UTC

Modified:

2017-02-13 19:48:33 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Unable to load object of type BsDomain with id=: Domain does not exist.

Symptoms

The following error occurs during an attempt to open a domain control panel in Plesk or open the Home > Domains link in the left navigation frame:

Unable to load object of type BsDomain with id=: Domain does not exist.

Cause

The issue is caused by a psa database inconsistency. It occurs if a record in the 'domains.webspace_id' or 'domain_aliases.dom_id' columns points to a non-existing domain ID.

Resolution

For Plesk 12.5 or higher try "plesk repair db" utility first. Please refer to the documentation

If it did not help use the solution below:

  1. Create a database backup:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin psa > psa`date +%F_%H.%M`.sql
  2. Check the links to '<id from error>' in the 'psa.domains' table:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e"select * from domains where webspace_id='< id from error >'"

    The above query will return a list of domains that belong to a broken webspace, if there are any.

  3. Check the domain-related tables and domain aliases:

    # for table in domain_aliases hosting dom_param DomainServices subdomains;do echo TABLE: $table; MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e"select * from $table where dom_id=<id from error>";done

    This query will return domain aliases that belong to the missing 'dom_id' and also entries in related tables that contain information about the domain.

  4. If the 'hosting\\DomainServices' tables returned a non-empty result on step 2, check whether the actual domain content folder exists (the 'www_root' value from the 'hosting' table) :

        ls -la /var/www/vhosts/example.com/httpdocs

    If it does, the domain entry in the database should be recreated. YFetch it from Plesk database dumps using the below command:

    # export dom_id=<dom_id that you got from hosting table>

    # find /var/lib/psa/dumps/ -name mysql.daily.dump.*|sort -n -r|while read dump_file;do zcat $dump_file|sed -n '/^INSERT INTO `domains/,/\\;/p'|grep -v ALTER|sed 's/INSERT INTO `domains` VALUES //g'|sed 's/),(/)\

    (/g'|grep '"("$dom_id'; if [ $? == 0 ];then echo;echo Dump file $dump_file contains the entry;exit 0;fi;done

    (2,'2013-11-21','domain.com','domain.com',3,0,'vrt_hst',760319296,1,0,NULL,NULL,'53238f70-4818-49a3-8d7e-1a5220e0e06e','','false','on',1,0,0,0,0)

    Dump file /var/lib/psa/dumps/mysql.daily.dump.8.gz contains the entry

    The above command will return the domain entry from Plesk database dumps if it exists there. Re-insert the entry into the domains table:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e"INSERT INTO domains VALUES(2,'2013-11-21','domain.com','domain.com',3,0,'vrt_hst',760319296,1,0,NULL,NULL,'53238f70-4818-49a3-8d7e-1a5220e0e06e','','false','on',1,0,0,0,0);"
  5. If the domain entry is missing in the dumps and the content folder does not exist, set the 'dom_id' to 0 for all the domains that have 'webspace_id' pointing to the missing domain. Also, remove entries from the following tables:

    mysql> begin;
    mysql> DELETE FROM hosting WHERE dom_id = <id from error>;
    mysql> DELETE FROM dom_param WHERE dom_id = <id from error>;
    mysql> DELETE FROM domainServices WHERE dom_id = <id from error>;
    mysql> DELETE FROM domain_aliases WHERE dom_id = <id from error>;
    mysql> DELETE FROM subdomains WHERE dom_id = <id from error>;
    mysql> commit;
  6. If the content folder is in place but the domain entry is missing, please create a support request in order to resolve the issue.

Have more questions? Submit a request
Please sign in to leave a comment.