- Plesk for Linux
- Plesk for Windows
The following error appears in Plesk UI during an attempt to open a domain control panel in Plesk or open the Home > Domains link in the left navigation frame or login to Plesk:
Unable to load object of type BsDomain with id=3: Domain does not exist.
The issue is caused by a psa database inconsistency. It occurs if a record in the
columns points to a non-existing domain ID.
For Plesk 12.5 or higher try "plesk repair db" utility first. Please refer to the documentation.
If Solution 1 did not help use the solution below, login to the server via SSH and do the following:
Create a database backup:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin psa > psa`date +%F_%H.%M`.sql
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.
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.
'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
# ls -la /var/www/vhosts/example.com/httpdocs
If it does, the domain entry in the database should be recreated. Fetch 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
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);"
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_LIN: 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>;
If the content folder is in place but the domain entry is missing, create a support request in order to resolve the issue.