Symptoms
-
Full server backup in Plesk is created with the following warning:
Warning: Application "WordPress"
Unable to back up database #25. Error: Unable to find row with id in data_bases table. -
The following fragment can be found in
/var/log/plesk/PMM/backup-<timestamp>/backup.log
:[2022-03-02 16:38:52.252|22889] DEBUG [panel] Finish: Domain: example.com
[2022-03-02 16:38:52.269|22889] DEBUG [panel] Start: Application: WordPress
...
[2022-03-02 16:38:52.300|22889] DEBUG [panel] Requested existing resource, ID: ebf59913-084f-4321-b816-279307946427
Cause
Database inconsistency. An application has been removed from a subscription, but records related to this application were left over in the apsc
and/or psa
database.
select * from apsResources where pleskId=25;
+----+--------------------------------------+------------+---------+
| id | registryId | pleskType | pleskId |
+----+--------------------------------------+------------+---------+
| 11 | ebf59913-084f-4321-b816-279307946427 | db | 25 |
| 12 | ebf59913-084f-4321-b816-279307946427 | db-user | 25 |
MariaDB [apsc]> select aps_registry_object.uid from aps_registry_object join aps_application on aps_application.registry_object_id=aps_registry_object.id where aps_application.id=(select aps_resource.app_id from aps_resource join aps_resource_adjacency_list on aps_resource.id=aps_resource_adjacency_list.dependent_resource_id where aps_resource_adjacency_list.base_resource_id=(select aps_resource_adjacency_list.base_resource_id from aps_resource_adjacency_list join aps_resource on aps_resource.id=aps_resource_adjacency_list.base_resource_id join aps_registry_object on aps_resource.registry_object_id=aps_registry_object.id where aps_registry_object.uid='ebf59913-084f-4321-b816-279307946427'));
+--------------------------------------+
| uid |
+--------------------------------------+
| 7c05f8de-a84a-44f9-b616-2efca1143908 |
+--------------------------------------+
1 row in set (0.003 sec)
MariaDB [psa]> select * from apsResources where registryId='7c05f8de-a84a-44f9-b616-2efca1143908';
Empty set (0.001 sec)
Note: there can be empty output in the query above or some records with this registryId may be present in the psa
database.
Resolution
-
Connect to the server via SSH.
-
Execute the command below to fix inconsistencies:
# plesk repair db