Symptoms
-
The following warning is shown by the Plesk Pre-Upgrade Checker:
WARNING: Reference between several subscriptions and APS applications has been broken.
-
The following error is displayed while making changes to the configuration of Plesk objects that assume Apache web server reconfiguration:
Error: New files of configuration for Apache web server were not built due to errors in configuration templates. The detailed error message was e-mailed to you, so please check the e-mail, fix the errors, and click here to retry generating configuration.
-
Backup creation fails with an error:
Unable to get APS instances on webspace id 123 (ErrorCode: 255, STDOUT:).
Cause
Plesk database inconsistency.
Resolution
- Connect to the server via SSH:
Note: If direct SSH access to the server is not possible, contact server administrator for further assistance.
-
Create a
database dump:
psa
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin psa > /var/lib/psa/dumps/psadump.kb112815.`date "+%Y-%m-%d_%H:%M"`.sql
-
Log in to the Plesk database:
# plesk db
-
List configuration errors in Plesk database:
mysql> select id,objectId,status,description from Configurations where status="error";
+-----+----------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | objectId | status | description |
+-----+----------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 5 | 1 | error | Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = SQLSTATE[HY093]: Invalid parameter number: no parameters were bound |
| 195 | 96 | error | Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = SQLSTATE[HY093]: Invalid parameter number: no parameters were bound |
| 205 | 101 | error | Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = SQLSTATE[HY093]: Invalid parameter number: no parameters were bound |
| 835 | 434 | error | Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = SQLSTATE[HY093]: Invalid parameter number: no parameters were bound |
| 837 | 435 | error | Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = SQLSTATE[HY093]: Invalid parameter number: no parameters were bound |
+-----+----------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -
List broken contexts of APS applications (
should be the same as
subscriptionId
or
MainSubscriptionId
):
AdditionalSubscriptionId
mysql> select aps.id, pleskId, subscriptionId, s.id as MainSubscriptionId, su.id as AddSubscriptionId from apsContexts aps left join domains d on d.id=aps.pleskId left join domains w on w.id = d.webspace_id left join Subscriptions s on s.object_id=d.id left join Subscriptions su on su.object_id = w.id where (subscriptionId!=s.id and su.id is null) or (subscriptionId!=su.id and s.id is null) or aps.subscriptionId is null;
+----+---------+----------------+--------------------+-------------------+
| id | pleskId | subscriptionId | MainSubscriptionId | AddSubscriptionId |
+----+---------+----------------+--------------------+-------------------+
| 2 | 1 | 0 | 1 | NULL |
| 3 | 96 | 96 | 75 | NULL |
| 4 | 101 | 101 | 79 | NULL |
| 5 | 434 | 0 | NULL | 75 |
| 6 | 435 | NULL | NULL | 75 |
+----+---------+----------------+--------------------+-------------------+
5 rows in set (0.00 sec) -
Modify the broken contexts:
mysql> update apsContexts set subscriptionId=1 where pleskId=1;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0mysql> update apsContexts set subscriptionId=75 where pleskId=96;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0mysql…