The error below prevents from removing the subscription:
Cannot unsubscribe 1 subscriptions. Reason: Resource #15737 does not exist.
The error appears when subscription in incompatible with service template it is based on. For example, when subscription contains webspace, however it's service template does not contain the proper resource type (Subscription).
That situation causes database inconsistency that can be solved by removing incompatible records from database.
The situation was caused by software issue #PPA-1683.
In case an udpate is not an option the following steps can be performed as workaround:
- Back up the database you are about to change.
Open PPA database and find the ID of the webspace of the subscription.
plesk=> select webspace_id from plesk_webspaces where domain = '<domain_name>'; webspace_id ------------- 318 (1 row)
Remove the inconsistent resources IDs.
plesk=> delete FROM plesk_webspace_resources WHERE webspace_id = 318; DELETE 2
Try to remove the subscription again. If the error happens again, it should be about another ID. (15738). That ID is absent in 'plesk_webspace_resources', so find it (and remove) in 'plesk_resource_usage', then removed:
plesk=> select * from plesk_resource_usage where webspace_id=318; webspace_id | resource_id | usage -------------+-------------+------- 318 | 15738 | 1 (1 row) plesk=> delete from plesk_resource_usage where webspace_id=318; DELETE 1
Remove the subscription from PPA control panel.
Update PA to the latest version to avoid the issue in future: