Unable to access Plesk: Internal error: Domain Service Web not exists

Created:

2016-11-16 13:20:00 UTC

Modified:

2017-08-08 13:09:43 UTC

1

Was this article helpful?


Have more questions?

Anfrage einreichen

Unable to access Plesk: Internal error: Domain Service Web not exists

Applicable to:

  • Plesk for Linux/Unix
  • 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 thrown 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] 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
[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

  1. The domain mentioned in the error messages has been deleted, but PSA database still contains an entry for this domain.
  2. Plesk database was not properly upgraded. The ' psa.DomainServices ' table has no records of the "web" type.

Resolution

There are several possible solutions:

Solution #1

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).

  1. Create backups of the Plesk databases .

  2. 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)
    
  3. 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.\nfile: /usr/local/psa/admin/plib/Template/Processor.php\nline: 28\ncode: 0\nPrevious error: Template_Variable_Exception: No data.\nfile: /usr/local/psa/admin/plib/Template/Variable/AbstractCachedData.php\nline: 67\ncode: 0','');
      INSERT INTO `dns_zone` (`id`, `name`, `displayName`, `status`, `syncSoa`, `syncRecords`, `email`, `type`, `ttl`, `ttl_unit`, `refresh`, `refresh_unit`, `retry`, `retry_unit`, `expire`, `expire_unit`, `minimum`, `minimum_unit`, `serial_format`, `serial`, `external_id`) VALUES (272,'example.com','example.com',0,'skip','skip','','master',86400,86400,10800,3600,3600,3600,604800,86400,10800,3600,'UNIXTIMESTAMP','1448313832','');
      INSERT INTO `hosting` (`dom_id`, `sys_user_id`, `www_root`, `real_traffic`, `fp`, `fp_ssl`, `fp_enable`, `fp_adm`, `fp_pass`, `ssi`, `php`, `cgi`, `perl`, `python`, `fastcgi`, `miva`, `coldfusion`, `asp`, `asp_dot_net`, `ssl`, `same_ssl`, `webstat`, `traffic_bandwidth`, `max_connection`, `php_handler_id`, `maintenance_mode`, `certificate_id`, `fp_no_index`, `ssi_html`, `php_isapi`, `managed_runtime_version`, `at_domains`, `write_modify`, `webdeploy`) VALUES (270,201,'/var/www/vhosts/example.com/httpdocs',0,'false','false','false','','','false','true','false','false','false','false','false','false','false','false','true','true','awstats',-1,-1,'plesk-php55-fastcgi','false',0,'false','false','false','1.1','false','','false');
      
  4. 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"
    

Solution #2

If domain does not physically exist:

  1. Create backups of the Plesk databases .

  2. Change htype of incorrectly removed domain to none :

    mysql> update domains set htype='none' where id=41;
    
  3. Domain will become visible in Plesk interface with "No hosting".

  4. Remove the domain through Plesk interface.

Solution #3

  1. Add the missing entries to the PSA database:

    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;
    
Haben Sie Fragen? Anfrage einreichen
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.