• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Can't Delete Service Plan - Plesk Panel thinks it has a Subscription attached to it

EricRB

Basic Pleskian
---------------------------------------------------------------
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE
Plesk Panel 10.3.1
CENTOS 5 Linux 2.6.18-194.el5

PROBLEM DESCRIPTION AND STEPS TO REPRODUCE
Had previous problems with deleting a Reseller causing Subscription display and Customers display to disappear. Had to get technician on the box to fix it. Being scared to do it again,

we first removed all domains, etc belonging to the reseller
then deleted the reseller, except there is a service plan left over that says there is 1 subscription on it. But you click on it, and there isn't any subscription on it. You can't delete the Service Plan because it thinks there is a Subscription attacted to it.

How do we fix this?
 
when I try from the shell /usr/local/psa/bin/service_plan -r DSDOMAIN1
Unable to remove domain template:plan is used
 
Looks like there is database inconsistency for some reason. Try to find this subscription with following SQL query:

mysql> select * from PlansSubscriptions where plan_id=XXX;

Then find domain name of this subscription with

mysql> select object_id, object_type from Subscriptions where id=XXX;

and if object_type is domain:

mysql> select displayName from domains where id=XXX;

where id=object_id from previous query.

Contact Support team if you can't fix it by yourself.
 
Thanks Igor for your help,

With your help, I was able to narrow it down to one offending record.

mysql> select object_id, object_type from Subscriptions where id=82;
+-----------+-------------+
| object_id | object_type |
+-----------+-------------+
| 50 | client |
+-----------+-------------+

And also of course, I can see in the Subscriptions table, there is one that is client, not domain and the object_id 50 is duplicated. There is a legitimate object_id=50 with a proper domain associated with it.

So my question, is it safe then to delect the record where object_id=50 and object_type='client' from this table without messing anything else up? We have had so much trouble with database inconsistencies in Plesk 10. It's past the point of being just slightly annoying. So I want to make sure before I do anything.

Thanks Igor.
 
There can be client with ID 50 and domain with ID 50 - it is correct. Now you can go to clients table and check record for ID 50. Then try to delete it via Plesk interface.
 
Igor ... I have already tried to delete the Service Plan. That's why I posted this problem here. It says Error: Plan is used.

That's what the problem is ... it is NOT USED ... but Plesk thinks it is. My question was this:

There is the type client there for that record.
But there should be no object there because it is not in use.

I looked in the clients table and there is an id=50 and it has type=reseller
There is only one reseller on the panel, and it is not associated with that Service Plan and never was.

For some reason Plesk thinks the Service Plan is in use, and I think it's because that entry is in the Subscriptions table that says id=50 type=client shouldn't be there. Plesk is looking at these tables with an id=50 and confusing them because somehow we have database inconsistency. This is a bug. The Plesk Panel let us delete the Reseller but wouldn't delete the Reseller's Service Plan that he had created. So it remains. It's just going to add more database inconsistency to the mix to continue without fixing this first.

I just want to know what will happen if I delete that record from the Subscriptions table. It has the plan_id in the PlansSubscriptions table that corresponds to the offending Service Plan that can't be deleted.

Then in the clients table there is the id=50 corresponding to a reseller, the only one in the clients table, which is correct because there is only one Reseller left on the panel.

mysql> select object_id, object_type from Subscriptions where id=82;
+-----------+-------------+
| object_id | object_type |
+-----------+-------------+
| 50 | client |
+-----------+-------------+
1 row in set (0.00 sec)

mysql> select object_id, object_type from Subscriptions where id=50;
+-----------+-------------+
| object_id | object_type |
+-----------+-------------+
| 50 | domain |
+-----------+-------------+
1 row in set (0.00 sec)

There is the problem, I think. There are two identical object_id -- one says client, one says domain. The client one is the offending Plan. They shouldn't have the same object_id I don't think. Am I wrong?

I really do think this is a bug. I mean, we did nothing except run the panel like normal, and we end up with this garbage. Before this, we had the customers display and subscriptions dispaly disappear and tech support had to come in and fix the database inconsistency. Something is wrong with the programming and relationships between the tables with the id numbers, etc. It needs to be fixed in the software.

So pass this on to the developers please, so they at least know that it's an issue. I can supply you with a support ticket number to your private messages if you like, from the job they had to do to fix the big inconsistencies that we had all relating to the deleting of Resellers from the panel -- to go along with this thread to the developers.

thanks
 
Yes, please send me Support Ticket ID. I will check it and ask supporters to submit request to developers from this ticket.
 
Back
Top