Article ID: 121805, created on May 30, 2014, last review on Oct 8, 2014

  • Applies to:
  • Plesk Automation 11.5

Symptoms

Subscription removal fails with error:

    Resource #2129 does not exist 

Cause

Database inconsistency due to canceled task.

Resolution

  1. Check /var/log/poa.debug.log and find required request. When subscription is removed, system checks resource usage by subscription in two tables: plesk_webspace_resources and plesk_resource_usage.

    Example:

    Login to the PPA database:

    # psql  -U plesk -h`hostname` plesk
    

    Find which resources are used:

    plesk=> select * from plesk_webspaces where account_id=80;
    ----------------
    webspace_id | 100
    account_id  | 80
    sub_id      | 100
    domain      | domain.tld
    is_enabled  | y
    is_brand    | n
    
    plesk=> select * from plesk_webspace_resources where webspace_id =100;
     webspace_id |  resource_class   | resource_instance_id | is_provisioned
    -------------+-------------------+----------------------+----------------
             100 | plesk_integration |                 2106 | y
             100 | plesk_mail        |                 2130 | y
             100 | plesk_db_hosting  |                 2134 | y
    (3 rows)
    
    plesk=> SELECT * FROM plesk_resource_usage WHERE webspace_id = 100;
     webspace_id | resource_id | usage
    -------------+-------------+-------
             100 |        2129 |     1
             100 |        2118 |     1
             100 |        2112 |   565
             100 |        2109 | 21442
    (4 rows)
    
  2. Make sure that all resources (that are used by subscriptions) exists in subs_resources table:

    plesk=> select * from subs_resources where rt_instance_id in (2129,2118,2112,2109);
     rt_instance_id | sub_id | sub_limit | curr_usage | own_usage |  rt_id  |
    ----------------+--------+-----------+------------+-----------+---------+
               2112 |    101 |    512000 |        565 |       565 | 1000004 |
               2109 |    101 |  83886080 |      21442 |     21442 | 1000005 |
               2108 |    101 |        -1 |          1 |         1 | 1000085 |
    (3 rows)
    

    As you can see from example above, first resource is absent, so there is reference to not existed resource and resource with id 2129 is orphaned record.

  3. To correct the issue, create backup of plesk database using article #118890 and delete record as below:

    plesk=>begin; delete from plesk_resource_usage where resource_id=2129;
    DELETE 1
    
    plesk=> commit;
    COMMIT
    

Search Words

Resource #145735 does not exist.

Resource #2129 does not exist

Can not remove subscription. Resource does not exist.

migration error

I cannot remove subscription

33a70544d00d562bbc5b17762c4ed2b3 e0aff7830fa22f92062ee4db78133079 caea8340e2d186a540518d08602aa065

Email subscription for changes to this article
Save as PDF