Article ID: 112733, created on Nov 17, 2014, last review on Nov 17, 2014

  • Applies to:
  • Plesk for Linux/Unix

Kennzeichen

Nach einem Upgrade werden folgende Arten von Meldungen in Parallels Plesk angezeigt:

============================
Error: New web server configuration for some domains within the marked subscriptions was not built due to errors in configuration templates
============================

============================
List of applications is not loaded
============================

In den Plesk Protokollen werden folgende Fehlermeldungen angezeigt:

============================
APS Catalog error: Unable to parse metadata
============================

============================
ERR (3): The service instance was not found.
============================

Ursache

Nach dem Upgrade ist die APS-Datenbank (APSC) inkonsistent geworden und die Verbindungen zwischen der PSA- und der APSC-Datenbank wurden beschädigt.

Lösung

I. Um die Applikation aus der Datenbank zu entfernen:

EIN MUSS:

0 - Erstellen Sie ein Backup der Datenbanken 'psa' und 'apsc'.

# mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` psa > ~/psa.`date +%F_%H:%M`.sql
# mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` apsc > ~/apsc.`date +%F_%H:%M`.sql

1 - Finden Sie die Domains mit der Inkonsistenz heraus.

# mysql -uadmin -p`cat /etc/psa/.psa.shadow ` psa -Nse"select d.name as DOMAIN,c.status from Configurations c left join domains d on c.objectId=d.id where c.status='error'"

2 - Finden Sie die UID für die Applikation mit den fehlenden Daten heraus.

The required data can be found in **panel.log**, _sw-cp-server/error.log_, when going to the "Applications" tab of the domain in question:

======================
2011-10-07T11:21:01-06:00 ERR (3): Problem retrieving application's 0b2ff3e6-0585-4f17-ac10-ded4cb5c73b1 information: resource of type aps.database with id 518e38c8-6e05-4926-a271-b157be43d472 not found by brokers
======================

3 - Sammeln Sie alle erforderlichen Informationen aus der Datenbank.

mysql> select reg.id as REGISTRY_OBJECT_ID,reg.uid as APPLICATION_UID,reg.type as TYPE,ap.id as APPLICATION_ID from apsc.aps_registry_object reg left join apsc.aps_application ap on reg.id=ap.registry_object_id where reg.uid='89d578dc-9669-4629-a3fa-6f9ea9210e8d';
+--------------------+--------------------------------------+-----------------+----------------+
| REGISTRY_OBJECT_ID |            APPLICATION_UID           |       TYPE      | APPLICATION_ID |
+--------------------+--------------------------------------+-----------------+----------------+
|         666        | 89d578dc-9669-4629-a3fa-6f9ea9210e8d | aps.application |        12      |
+--------------------+--------------------------------------+-----------------+----------------+

4 - Entfernen Sie die übrigen Daten.

mysql> delete from apsc.aps_application_resource where app_id=12;
mysql> delete from apsc.aps_application where id=12;
mysql> delete from apsc.aps_registry_object where id=666;
mysql> delete from psa.apsContextsApplications WHERE (apsContextId IN ('12'));

mysql> select psa.d.id as pleskId, psa.s.object_id as subscriptionId from psa.domains d left join psa.Subscriptions s on psa.d.id=psa.s.object_id where psa.d.name = 'domain.tld';
+---------+----------------+
| pleskId | subscriptionId |
+---------+----------------+
|   229   |       221      |
+---------+----------------+

mysql> delete from psa.apsContexts where (pleskType = "hosting" AND pleskId IN (229)) OR (pleskType = "subscription" AND subscriptionId IN ('221'));

5 - Konfigurieren Sie die Domain neu.

# /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=domain.tld

II. Wenn Sie nur die Ressourcen-ID haben:

EIN MUSS:

0 - Erstellen Sie ein Backup der Datenbanken 'psa' und 'apsc'.

# mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` psa > ~/psa.`date +%F_%H:%M`.sql
# mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` apsc > ~/apsc.`date +%F_%H:%M`.sql

1 - Die nötigen Daten finden Sie in der Registerkarte "Applikation" der betreffenden Domain:

    https://domain.tld:8443/smb/service/index/resourceId/e7928006-33c9-4575-8ab8-b9a485468313

2 - Rufen Sie die Ressourcen-ID ab.

mysql> SELECT `apsc`.`id`, `apsc`.`uid`, `apsc`.`type`, `apsc`.`creation_time`, `apsc`.`enabled` from `aps_registry_object` `apsc` WHERE (`apsc`.`uid`) = ('e7928006-33c9-4575-8ab8-b9a485468313');
+----+--------------------------------------+--------------+---------------------+---------+
| id |                 uid                  |      type    |     creation_time   | enabled |
+----+--------------------------------------+--------------+---------------------+---------+
| 16 | e7928006-33c9-4575-8ab8-b9a485468313 | aps.resource | 2011-10-11 07:35:33 |    y    |
+----+--------------------------------------+--------------+---------------------+---------+

3 - Rufen Sie die Applikations-UID ab.

mysql> SELECT `1`.`id`, `1`.`resource_type`, `1`.`parent_resource_id`, `2`.`uid`, `1`.`service_id` from (((`aps_application_resource` `3` RIGHT JOIN `aps_resource` `1` ON (`1`.`id`) = (`3`.`resource_id`)) LEFT JOIN `aps_application` `4` ON (`3`.`app_id`) = (`4`.`id`)) LEFT JOIN `aps_registry_object` `2` ON (`4`.`registry_object_id`) = (`2`.`id`)) WHERE (`1`.`registry_object_id`) = (16);
+----+----------------------------------------------+--------------------+--------------------------------------+------------+
| id |                 resource_type                | parent_resource_id |                 uid                  | service_id |
+----+----------------------------------------------+--------------------+--------------------------------------+------------+
|  6 | aps::aps12::http://wordpress.org/::wordpress |        NULL        | a0fe2a37-1b57-4588-9571-20e2d639ea82 |  wordpress |
+----+----------------------------------------------+--------------------+--------------------------------------+------------+

4 - Sammeln Sie die erforderlichen Informationen.

mysql> select reg.id as REGISTRY_OBJECT_ID,reg.uid as APPLICATION_UID,reg.type as TYPE,ap.id as APPLICATION_ID from apsc.aps_registry_object reg left join apsc.aps_application ap on reg.id=ap.registry_object_id where reg.uid='a0fe2a37-1b57-4588-9571-20e2d639ea82';
+--------------------+--------------------------------------+-----------------+----------------+
| REGISTRY_OBJECT_ID |            APPLICATION_UID           |       TYPE      | APPLICATION_ID |
+--------------------+--------------------------------------+-----------------+----------------+
|         15         | a0fe2a37-1b57-4588-9571-20e2d639ea82 | aps.application |       6        |
+--------------------+--------------------------------------+-----------------+----------------+

5 - Entfernen Sie die übrigen Daten.

mysql> delete from apsc.aps_application_resource where app_id=6;
mysql> delete from apsc.aps_application where id=6;
mysql> delete from apsc.aps_registry_object where id=15;
mysql> delete from psa.apsContextsApplications WHERE (apsContextId IN ('6'));

mysql> select psa.d.id as pleskId, psa.s.object_id as subscriptionId from psa.domains d left join psa.Subscriptions s on psa.d.id=psa.s.object_id where psa.d.name = 'domain.tld';
+---------+----------------+
| pleskId | subscriptionId |
+---------+----------------+
|    1    |        1       |
+---------+----------------+

mysql> delete from psa.apsContexts where (pleskType = "hosting" AND pleskId IN (1)) OR (pleskType = "subscription" AND subscriptionId IN ('1'));

6 - Konfigurieren Sie die Domain neu.

# /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=domain.tld

III Wenn Sie alle vorhandenen APS-Pakete entfernen müssen, kann Folgendes hilfreich sein:

# vi aps_remove.sh
--~>8---
echo "STARTED";
date;
mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` psa > ~/psa.`date +%F_%H:%M`.sql;
mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` apsc > ~/apsc.`date +%F_%H:%M`.sql;

mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` apsc --no-data > apsc.schema.sql;
mysql -uadmin -p`cat /etc/psa/.psa.shadow` apsc < apsc.schema.sql;

mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` psa apsContexts apsContextsApplications apsResources apsResourcesParameters aps_application aps_package aps_registry_object aps_resource aps_resource_requirement smb_apsCategories smb_apsContexts smb_apsInstanceErrors smb_apsInstances smb_apsMetas smb_apsPackageUpdates smb_apsPackages smb_apsPackagesCategories --no-data > psa.tables.schema.sql;
mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa < psa.tables.schema.sql;

mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -e"delete from smb_userServicePermissions where servicePermissionId in (select id from smb_servicePermissions where serviceProviderId in (select id from smb_serviceProviders where classname='Smb_Service_Provider_Aps'))";

mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -e"delete from smb_serviceEntryPoints where servicePermissionId in (select id from smb_servicePermissions where serviceProviderId in (select id from smb_serviceProviders where classname='Smb_Service_Provider_Aps'))";

mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -e"delete from smb_servicePermissions where serviceProviderId in (select id from smb_serviceProviders where classname='Smb_Service_Provider_Aps')";

mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -e"delete from smb_serviceInstances where serviceProviderId in (select id from smb_serviceProviders where classname='Smb_Service_Provider_Aps')";

echo "DONE"
---8<~--

# chmod +x aps_remove.sh

#./aps_remove.sh

IV. Wenn ein Client die Applikation direkt vom Server entfernt hat, ohne sie aus den Datenbanken zu entfernen:

EIN MUSS:

0 - Erstellen Sie ein Backup der Datenbanken 'psa' und 'apsc'.

# mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` psa > ~/psa.`date +%F_%H:%M`.sql
# mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` apsc > ~/apsc.`date +%F_%H:%M`.sql

1 - Rufen Sie die Applikations-UID ab

mysql> select psa.d.id as pleskId, psa.s.object_id as subscriptionId from psa.domains d left join psa.Subscriptions s on psa.d.id=psa.s.object_id where psa.d.name = 'domain.tld';
+---------+----------------+
| pleskId | subscriptionId |
+---------+----------------+
|     180 |            141 |
+---------+----------------+

mysql> select * from psa.apsContexts where (pleskType = "hosting" AND pleskId IN (180)) OR (pleskType = "subscription" AND subscriptionId IN ('141'));
+----+-----------+---------+-------+----------------+
| id | pleskType | pleskId | ssl   | subscriptionId |
+----+-----------+---------+-------+----------------+
| 45 | hosting   |     180 | false |            141 |
+----+-----------+---------+-------+----------------+

mysql> select * from psa.apsContextsApplications where apsContextId = 45;
+----+--------------+--------------------------------------+
| id | apsContextId | registryApplicationId                |
+----+--------------+--------------------------------------+
| 52 |           45 | b2e46a1d-342e-472a-88c0-21b0e494207d |
+----+--------------+--------------------------------------+

mysql> select reg.id as REGISTRY_OBJECT_ID,reg.uid as APPLICATION_UID,reg.type as TYPE,ap.id as APPLICATION_ID from apsc.aps_registry_object reg left join apsc.aps_application ap on reg.id=ap.registry_object_id where reg.uid='b2e46a1d-342e-472a-88c0-21b0e494207d';
+--------------------+--------------------------------------+-----------------+----------------+
| REGISTRY_OBJECT_ID | APPLICATION_UID                      | TYPE            | APPLICATION_ID |
+--------------------+--------------------------------------+-----------------+----------------+
|                156 | b2e46a1d-342e-472a-88c0-21b0e494207d | aps.application |             52 |
+--------------------+--------------------------------------+-----------------+----------------+

2 - Entfernen Sie die übrigen Daten.

mysql> delete from apsc.aps_application_resource where app_id=52;
mysql> delete from apsc.aps_application where id=52;
mysql> delete from apsc.aps_registry_object where id=156;
mysql> delete from psa.apsContextsApplications WHERE (apsContextId IN ('52'));

mysql> select s.object_id as pleskId,s.id as subscriptionId from psa.Subscriptions s left join psa.domains d on s.object_id=d.id where name = 'domain.tld';
+---------+----------------+
| pleskId | subscriptionId |
+---------+----------------+
|     180 |            141 |
+---------+----------------+

mysql> delete from psa.apsContexts where (pleskType = "hosting" AND pleskId IN (180)) OR (pleskType = "subscription" AND subscriptionId IN ('141'));

3 - Konfigurieren Sie die Domain neu.

# /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=domain.tld 

a914db3fdc7a53ddcfd1b2db8f5a1b9c 29d1e90fd304f01e6420fbe60f66f838 56797cefb1efc9130f7c48a7d1db0f0c e0aff7830fa22f92062ee4db78133079 caea8340e2d186a540518d08602aa065

Email subscription for changes to this article
Save as PDF