Ok, I think I found the source of the bug attached to
http://www.isp-control.net/ispcp/ticket/1976
When you
delete a domain account, many managers are executed one after the other. The execution order of these managers is established by the dispatcher (
ispcp-rqst-mngr ). The problem, as explained in my ticket, is that the records concerning the
htusers and
htgroup data are not removed and remains in a status '
delete'. This is explained by the fact that when the managers of these data is performed, the data of domain to which they are linked have been already deleted in the database.
Example for deleting a record in the table htaccess_users:
The subroutines
htusers_mngr_engine() of
ispcp-htusers-mngr script executes the following query:
Code:
my $sql = "
SELECT
`t1`.`uname`, `t1`.`upass`, `t1`.`dmn_id`, `t1`.`status`, `t1`.`id`, `t2`.`domain_name`
FROM
`htaccess_users` as `t1`, `domain` as `t2`
WHERE
`t1`.`id` = '".$main::htusers_task_id."'
AND
`t1`.`status` != 'ok'
AND
`t1`.`dmn_id` = `t2`.`domain_id`
";
The purpose of this request is to select records in the
htaccess_users and
domain tables. In PSEUDO CODE (
made in Laurent), this gives:
Code:
SELECT
SEVERAL DATA FROM HTACCESS_USERS AND DOMAIN
WHERE
HTACCESS_USERS_ID EQUAL HTUSERS_TASK_ID
AND
HTACCESS_USERS_STATUS NOT_EQUAL OK
AND
HTACCESS_USERS_DMN_ID EQUAL DOMAIN_DOMAIN_ID
The problem here is that
DOMAIN_DOMAIN_ID match
HTACCESS_USERS_DMN_ID has already been deleted from the domain table when the query is executed. Indeed, if this query works for queries like "
toadd" or "
change", it can not find results for queries like "
delete".
Indeed, the dispatcher (
ispcp-rqst-mngr ), place the running of managers in charge of processing
htusers and
htgroup data
after the manager who manages the data related to the domain. Thus the sql query attached below, in the case of a query '
delete', will always return empty result because when it is executed, the domain record
DOMAIN_DOMAIN_ID has already been deleted. Uh, I repeat myself here ...
In short, I do not know if you understand me but hey, I did do my best. I suppose this problem is valid for alias domains and subdomains (
todo check ).
This is a heresy as fact, as it stands, all the routines for deleting
htusers and
htgroup data are used strictly for nothing. It is also noted here that the existence of XXX delete operations on the FilesSystem concerning
htusers and
htgroup did not arise since the file
/var/www/virtual/{DOMAIN} has already been deleted .
Besides, my ispcp-htusers-mngr.stdout file proves that I am right:
Code:
DEBUG: push_el() sub_name: htusers_mngr_start_up(), msg: Starting...
DEBUG: push_el() sub_name: check_master(), msg: Starting...
DEBUG: push_el() sub_name: sys_command(), msg: Starting...
DEBUG: push_el() sub_name: sys_command('export COLUMNS=120;/bin/ps auxww | awk '$0 ~ /ispcp-rqst-mngr/ && $0 !~ /awk/ { print $2 ;}' 1>/tmp/ispcp-cc.stdout 2>/tmp/ispcp-cc.stderr'), msg: Ending...
DEBUG: push_el() sub_name: del_file(), msg: Starting...
DEBUG: push_el() sub_name: del_file(), msg: Ending...
DEBUG: push_el() sub_name: del_file(), msg: Starting...
DEBUG: push_el() sub_name: del_file(), msg: Ending...
DEBUG: push_el() sub_name: check_master(), msg: Ending...
DEBUG: push_el() sub_name: get_conf(), msg: Starting...
DEBUG: push_el() sub_name: get_file(), msg: Starting...
DEBUG: push_el() sub_name: get_file(), msg: Ending...
DEBUG: push_el() sub_name: setup_main_vars(), msg: Starting...
DEBUG: push_el() sub_name: decrypt_db_password(), msg: Starting...
DEBUG: push_el() sub_name: decrypt_db_password(), msg: Ending...
DEBUG: push_el() sub_name: setup_main_vars(), msg: Ending...
DEBUG: push_el() sub_name: get_conf(), msg: Ending...
DEBUG: push_el() sub_name: doSQL(), msg: Starting...
DEBUG: push_el() sub_name: doSQL(), msg: Ending...
DEBUG: push_el() sub_name: htusers_mngr_start_up(), msg: Ending...
DEBUG: push_el() sub_name: htusers_mngr_engine(), msg: Starting...
DEBUG: push_el() sub_name: doSQL(), msg: Starting...
DEBUG: push_el() sub_name: doSQL(), msg: Ending...
DEBUG: push_el() sub_name: htusers_mngr_engine(), msg: Ending...
DEBUG: push_el() sub_name: htusers_mngr_shut_down(), msg: Starting...
DEBUG: push_el() sub_name: htusers_mngr_shut_down(), msg: Ending...
As one can easily see, after the SQL query, no treatment is performed. This is normal since the query can not find record.
The direct consequence of this bug and the debugger (via frontend) indicate that it still remains to perform queries, and it is surely because of this bug full user continue to report this behavior.
Something crazy huh. Go, bring me the guilty that I can blame publicly.
FIXED in r1977