Applicable to:
- Plesk for Windows
- Plesk for Linux
Symptoms
Plesk shows the following error after login:
Internal error: Domain Service Web not exists: domain=sub.example.com, id=41
Domain Service Web not exists: domain=sub.example.com, id=41
File DSWeb.php
Line 76
Type PleskFatalException
The following errors may be thrown in the /var/log/plesk/panel.log
file:
ERR [panel] Failed to search for WordPress instances on subscription example.com: Domain with id=270 was not found
ERR [panel] Attempt to change status of non-configured mail service. [domain_id = 270]
ERR [panel] Unable to load object of type PhDomain with id=270: Turn off domain failed: Unable to find service node for web service on domain with id=270
ERR [panel] Algunas de las suscripciones seleccionadas no fueron suspendidas.<br>Unable to load object of type PhDomain with id=270: Turn off domain failed: Unable to find service node for web service on domain with id=270
ERR [panel] No data.
ERR [panel] Failed to search for WordPress instances on subscription example.com: Resource with UID 'bd314c87-865a-46e6-b694-342e71899445' not found.
Cause
The domain mentioned in the error messages has been deleted, but PSA database still contains an entry for this domain.
Plesk database was not properly upgraded. The '
psa.DomainServices
' table has no records of the "web" type.
Resolution
Note: This solution involves editing of MySQL database using MySQL queries.
Note: Please check that the domain physically exists before making changes. If it does, back up all the domain content from the corresponding directories
/var/www/vhosts/<domain>
and
/var/qmail/mailnames/<domain>
(in case of Linux) or from
C:\Inetpub\vhosts
and
%plesk_dir\MailEnable\postoffices%
(in case of Windows).
There are several possible scenarios:
Scenario 1. Domain physically exists
- Connect to the server over RDP (Plesk for Windows) or SSH (Plesk for Linux).
-
Create backups of the Plesk databases.
-
Access Plesk database. Run the following command in "cmd.exe command interpreter" (Plesk for Windows) or via "SSH command line" (Plesk for Linux):
plesk db
-
Delete a domain from the PSA database and recreate it from scratch, for example:
mysql> DELETE FROM domains WHERE id='41';
Query OK, 1 row affected (0.04 sec) -
Ensure that there are no orphaned records in the databases by the following way:
-
create databases backups as follows:
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump --skip-extended-insert --complete-insert -u admin psa > /root/psa`date +%F_%H-%M`.sql
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump --skip-extended-insert --complete-insert -u admin apsc > /root/apsc`date +%F_%H-%M`.sql
ls -lt /root/ | head -n3
total 31112
-rw-r--r-- 1 root root 224955 Nov 23 22:45 apsc2015-11-23_22-45.sql
-rw-r--r-- 1 root root 14023153 Nov 23 22:44 psa2015-11-23_22-44.sql -
search for the values mentioned in the error messages, for example:
grep 'bd314c87-865a-46e6-b694-342e71899445' /root/apsc2015-11-23_22-45.sql
grep 'bd314c87-865a-46e6-b694-342e71899445' /root/psa2015-11-23_22-44.sql
grep 'example' /root/apsc2015-11-23_22-45.sql
grep 'example' /root/psa2015-11-23_22-44.sql | grep -v -E 'log_components|exp_event'
INSERT INTO `Configurations` (`id`, `name`, `serviceNodeId`, `file`, `version`, `objectType`, `objectId`, `status`, `active`, `description`, `errorFile`) VALUES (115,'nginxDomainWebmail',1,'/etc/nginx/plesk.conf.d/webmails/example.com_webmail.conf','14240541100.61180300','nginxDomain',28,'ok','true',NULL,'');
INSERT INTO `Configurations` (`id`, `name`, `serviceNodeId`, `file`, `version`, `objectType`, `objectId`, `status`, `active`, `description`, `errorFile`) VALUES (117,'nginxDomainVhost',1,'/var/www/vhosts/system/example.com/conf/nginx.conf','14307435570.48796000','nginxDomain',28,'ok','true',NULL,'');
INSERT INTO `Configurations` (`id`, `name`, `serviceNodeId`, `file`, `version`, `objectType`, `objectId`, `status`, `active`, `description`, `errorFile`) VALUES (896,'domainVhost',1,'/var/www/vhosts/system/example.com/conf/httpd.conf','14483138520.02185500','domain',270,'error','true','Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = Template_Exception: No data.\
-
-
Remove found orphaned records. For example:
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e "DELETE FROM Configurations WHERE id IN (115,117,896)"
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e "DELETE FROM dns_zone WHERE id=272"
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e "DELETE FROM hosting WHERE dom_id=270"
Scenario 2. Domain does not physically exist
- Connect to the server over RDP (Plesk for Windows) or SSH (Plesk for Linux).
-
Access Plesk database. Run the following command in "cmd.exe command interpreter" (Plesk for Windows) or via "SSH command line" (Plesk for Linux):
plesk db
-
Change
htype
of incorrectly removed domain tonone
:mysql> update domains set htype='none' where id=41;
-
Domain will become visible in Plesk interface with "No hosting".
-
Remove the domain through Plesk interface.
Scenario 3. Applicable when domain exists or does not exists.
- Connect to the server over RDP (Plesk for Windows) or SSH (Plesk for Linux).
- Create backups of the Plesk databases.
-
Access Plesk database. Run the following command in "cmd.exe command interpreter" (Plesk for Windows) or via "SSH command line" (Plesk for Linux):
plesk db
-
Add the missing entries to the PSA database with MySQL query:
First, check that there is an entry in
'DomainServices'
for this domain:mysql> select * from DomainServices where dom_id = 41;
+-----+--------+------+--------+---------------+----------------+
| id | dom_id | type | status | parameters_id | ipCollectionId |
+-----+--------+------+--------+---------------+----------------+
| 322 | 41 | mail | 16 | 585 | 322 |
+-----+--------+------+--------+---------------+----------------+
1 row in set (0.00 sec)Then, add a similar "web"-type entry, and add related records to
'IpAddressesCollections'
:mysql> begin;
mysql> select @dom_id := <missing_domain_id>;
mysql> select @ip := (select dr.val from dns_recs dr, domains d where d.id = @dom_id and dr.dns_zone_id = d.dns_zone_id and dr.type = 'A' and dr.host = concat(d.name,'.'));
mysql> select @ip_id := (select id from IP_Addresses where ip_address = @ip);
mysql> INSERT INTO IpCollections VALUES (NULL);
mysql> SELECT @ip_collection_id := LAST_INSERT_ID();
mysql> insert into IpAddressesCollections (ipCollectionId, ipAddressId) values (@ip_collection_id, @ip_id);
mysql> insert into DomainServices (dom_id, type, status, parameters_id, ipCollectionId) values (@dom_id, 'web' , 0, 0, @ip_collection_id);
mysql> commit;
Comments
0 comments
Please sign in to leave a comment.