Applicable to:
- Plesk for Linux
- Plesk for Windows
Symptoms
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 bar, or login to Plesk:
PLESK_INFO: Internal error: Unable to load object of type BsDomain with id=3: 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 of a psa database points to a non-existing domain ID.
Resolution
The inconsistency can be fixed in the automatic mode:
# plesk repair db
Note: Refer to the documentation for details.
-
Check the links to
<id from error>
in thepsa.domains
table:# plesk db "SELECT * FROM domains WHERE webspace_id=<id from error>"
Note: 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:
Linux:
# for table in domain_aliases hosting dom_param DomainServices subdomains;do echo TABLE: $table; plesk db "select * from $table where dom_id=<id from error>";done
Windows:
C:\> for %T in (domain_aliases,hosting,dom_param,DomainServices,subdomains) do echo %T && plesk db "select * from %T where dom_id=13"
Note: 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. -
If the
hosting
andDomainServices
tables returned a non-empty result on step 3, check whether the actual domain content folder exists (www_root
value fromhosting
table):Linux:
# ls -la /var/www/vhosts/example.com/httpdocs
Windows:
C:\> if exist C:\Inetpub\vhosts\example.com\httpdocs echo EXISTS
-
If it does, the domain entry in the database should be recreated. Fetch it from Plesk database dumps using the below command:
Linux:
# export dom_id=<dom_id that you got from hosting table>
# find /var/lib/psa/dumps/ -name mysql.daily.dump.*|sort -n |while read dump_file;do zcat $dump_file|grep '^INSERT INTO `domains'|sed 's/INSERT INTO `domains` VALUES //g'|sed 's/),(/)\n(/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 entryThe above command will return the domain entry from Plesk database dumps if it exists there. Re-insert the entry into the domains table:
# plesk db "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 havewebspace_id
pointing to the missing domain. Also, remove entries from the following tables:# plesk db "DELETE FROM hosting WHERE dom_id = <id from error>"
# plesk db "DELETE FROM dom_param WHERE dom_id = <id from error>"
# plesk db "DELETE FROM DomainServices WHERE dom_id = <id from error>"
# plesk db "DELETE FROM domain_aliases WHERE dom_id = <id from error>"
# plesk db "DELETE FROM subdomains WHERE dom_id = <id from error>"
# plesk db "DELETE FROM Subscriptions WHERE object_type = 'domain' AND object_id = <id from error>"
-
Note: If the content folder is in place but the domain entry is missing in dumps, create a support request in order to resolve the issue
Comments
1 comment
Automatic mode didn't work for me. Note that step 4 covers all tables *except* Subscriptions, which is the only table included in the deletions at the very end that is separate from what it shows in step 4. Removing the extraneous entry from the Subscriptions table is what fixed the issue.
Please sign in to leave a comment.