• 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 remove a subscription from a subscriber

Nonapeptide

New Pleskian
I'm running Plesk 10.3 on CentOS 5.8. I have a subscriber that has three subscriptions associated with their account. Each subscription has one domain associated with it. The subscriber wants to remove one of the domains from their account, so I tried to remove the subscription from their account in Plesk Panel. I simply went to Hosting Services >> Subscriptions and selected the subscription's check box. From there, I clicked "remove" and waited. After a while, I see "Internal error." in red above the list of subscriptions.

I logged into the server as root via SSH and ran /usr/local/psa/bin/subscription --remove-subscription domain.com and receieved the error: "There is no such a service plan"

How can I remove this subscription? How can I remove the domain and its associated files? Ultimately, my goal is to remove the domain and its files from the server.
 
Last edited:
It should be noted that /usr/local/psa/bin/subscription --info domain.com will return all of the info for the domain / subscription. So it appears to be "there." All the files are on the file system. It's just that the remove command doesn't seem to be working.
 
Okay, first, it should be noted that the switches --remove-subscription and -r (aka --remove) do different things. That was part of my confusion. Here is the documentation for both commands. Notice the subtle differences:

--remove or -r <domain_name> Removes an existing subscription. If
specified name is the name of default
subscription domain, then removes
WHOLE subscription.

--remove-subscription <domain_name>
Removes the subscription association
with the specified hosting plan
add-on.

Really, --remove is what I wanted. However, now when running that command, I encounter this error:

mailmng failed: Some errors occured. See log for details

The log entries written when I perform a --remove operation are:

Jun 5 12:22:08 server mailmng[18077]: No such parameter 'handler-type' for handler '10-spam-ha1klu'
Jun 5 12:22:08 server mailmng[18077]: Unable to get type of handler: 10-spam-ha1klu
Jun 5 12:22:08 server mailmng[18077]: Some errors was occured in mass hook operation. errors: 1
Jun 5 12:22:08 server mailmng[18077]: Unable to delete some handlers for this mailname: [email protected]

So now the problem is that there is no handler type for "10-spam-ha1klu" and/or the handler for a mailname associated with the domain can't be deleted. Not sure how to proceed with this. Any tips?
 
I tried to remove the mail address specifically with /usr/local/psa/admin/plib/api-cli/mail.php --remove [email protected] and I got this error:

object ID is invalid

PHP Warning: Releasing semaphore 21 in request cleanup; File: Unknown, Line: 0

I checked /var/log/sw-cp-server/error_log:

2012-06-05T13:00:30-06:00 CRIT (2): Smb_Exception: mailmng failed: Some errors occured. See log for details
file: /usr/local/psa/admin/smb/application/library/Smb/Plesk/Bridge/Mail/Name.php
line: 281
code: 0

and I also saw this:

mailmng: Unable to open file /usr/local/psa/handlers/info/10-spam-ha1klu/hook: No such file or directory

I'm getting the haunted feeling that mail handlers are borked. I looked at this KB article and searched for corrupted handlers. None were found, however I disabled the mail service, ran /usr/local/psa/admin/sbin/mchk --with-spam and restarted mail.

I see the same handler errors in /var/log/messages and I still get the same error when I try to remove the domain with /usr/local/psa/bin/subscription -r domain.com:

mailmng failed: Some errors occured. See log for details

Seemingly running out of options.
 
It appears that I've managed to get things to work. Part of the problem was my own over-cautious nature. When I ran the command to find corrupt headers nothing came back. However, as we all know now, the error logs were complaining about the 10-spam-ha1klu handler.

I merely moved the 10-spam-ha1klu folder, turned off the mail service, used mchk --with-spam, turned the service back on and then gave the domain removal one last try.

/usr/local/psa/bin/subscription -r domain.com

...and waited. It took a few minutes, but finally the domain was removed! So far, no errors or quirks seem to exist.
 
Excellent detective work. Thanks for posting the solution. It should come in handy for others at some point.
 
How do you remove the subscription from 11.x if it is a failed subscription. I tried all of the suggestions in this thread, but it says that domain name does not exist or does not belong to any customer.
 
Back
Top