Applicable to:
- Plesk for Linux
- Plesk for Windows
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 shown in the
/var/log/plesk/panel.log
file:[2015-11-23 22:23:48] ERR [panel] Failed to search for WordPress instances on subscription example.com: Domain with id=270 was not found
[2015-11-23 22:23:52] ERR [panel] Attempt to change status of non-configured mail service. [domain_id = 270]
[2015-11-23 22:23:52] 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
[2015-11-23 22:23:52] ERR [panel] Some of the subscriptions selected were not suspended.<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
[2015-11-23 22:23:59] ERR [panel] No data.
[2015-11-23 22:24:09] 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 the Plesk database ( psa
) still contains orphaned entries for this domain.
Alternatively, the Plesk database was not properly upgraded, due to which the DomainServices
table has no records of the web
type.
Resolution
Note: This article may require additional administrative knowledge to apply. If any help required, contact server’s administrator or hosting support.
Warning: 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:
-
Connect to the server via SSH (Plesk for Linux) or RDP (Plesk for Windows)
-
Remove the domain with ID in
psa.domains
mentioned in the first error message from the PSA database (the command is the same for both Windows and Linux):plesk db "DELETE FROM domains WHERE id='41'"
-
Find orphaned records in the databases as follows:
Click on a section to expand
For Plesk on Linux-
Create
psa
andapsc
database backups:# plesk db dump psa > /root/psa_dump_$(date +'%Y-%m-%d').sql
# plesk db dump apsc > /root/apsc_dump_$(date +'%Y-%m-%d').sql
-
Find orphaned records in table
psa.domains
using the values mentioned in the error messages:# grep 'bd314c87-865a-46e6-b694-342e71899445' /root/apsc_dump_$(date +'%Y-%m-%d').sql
# grep 'bd314c87-865a-46e6-b694-342e71899445' /root/psa_dump_$(date +'%Y-%m-%d').sql
# grep 'example' /root/apsc_dump_$(date +'%Y-%m-%d').sql
# grep 'example' /root/psa_dump_$(date +'%Y-%m-%d').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,'');
For Plesk on Windows-
Open an elevated powershell window to execute the following commands
-
Create
psa
andapsc
database backups:plesk db dump psa > psa_dump_$(get-date -f yyyy-MM-dd).sql
plesk db dump apsc > apsc_dump_$(get-date -f yyyy-MM-dd).sql
-
Find orphaned records in table psa.domains using the values mentioned in the error messages:
(Select-String -Path apsc_dump_$(get-date -f yyyy-MM-dd).sql -Pattern "INSERT INTO ``.*bd314c87-865a-46e6-b694-342e71899445"|Select-String -Pattern "log_components|exp_event" -NotMatch ).Line -split "(?=,()" -split "(?= ()" | Select-String -Pattern "INSERT INTO|bd314c87-865a-46e6-b694-342e71899445"
(Select-String -Path psa_dump_$(get-date -f yyyy-MM-dd).sql -Pattern "INSERT INTO ``.*bd314c87-865a-46e6-b694-342e71899445"|Select-String -Pattern "log_components|exp_event" -NotMatch ).Line -split "(?=,()" -split "(?= ()" | Select-String -Pattern "INSERT INTO|bd314c87-865a-46e6-b694-342e71899445"
(Select-String -Path apsc_dump_$(get-date -f yyyy-MM-dd).sql -Pattern "INSERT INTO ``.*example"|Select-String -Pattern "log_components|exp_event" -NotMatch ).Line -split "(?=,()" -split "(?= ()" | Select-String -Pattern "INSERT INTO|example"
(Select-String -Path psa_dump_$(get-date -f yyyy-MM-dd).sql -Pattern "INSERT INTO ``.*example"|Select-String -Pattern "log_components|exp_event" -NotMatch ).Line -split "(?=,()" -split "(?= ()" | Select-String -Pattern "INSERT INTO|example"
INSERT INTO `hosting` VALUES
,(41,'false','false','true','false','fastcgi-7.4','false','false','false','false','true','4.0','true','awstats','false','hosting_write_template.xml','C:\Inetpub\vhosts\example.com\httpdocs','false',0,-1,-1,'true')
-
-
Remove orphaned records from prior step by executing SQL
DELETE
statements onpsa
database (these commands are the same for both Linux and Windows):plesk db "DELETE FROM Configurations WHERE id=115"
plesk db "DELETE FROM dns_zone WHERE id=270"
plesk db "DELETE FROM hosting WHERE dom_id=41"
-
Connect to the server via SSH (Plesk for Linux) or RDP (Plesk for Windows)
-
Change
htype
of incorrectly removed domain tonone
:mysql> update domains set htype='none' where id=41;
-
Domain will become visible in the Plesk GUI with the No hosting attribute.
-
Remove the domain by going to Plesk > Domains > select example.com > Press Remove
1. Connect to the server via SSH (Plesk for Linux) or RDP (Plesk for Windows)
2. Create Plesk database backup
4. Add the missing entries to the psa
database by executing the following database queries:
4.1. 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)
4.2. Add a similar web
type entry, and add related records to the IpAddressesCollections
table as follows:
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.