SymptomsThe Apache reconfigurator script psoft.hsphere.tools.PostApacheConfigs fails with the following error:
Config republishing for domain.name [ OK ]
psoft.hsphere.UnknownResellerException: Unknown reseller Id
CauseThe issue is caused by the Parallels H-Sphere database partial inconsistency -- there are “orphaned" records in its “users” table that do not belong to any reseller and do not correspond to any real user account.
To get a list of them, please run the following query:
hsphere=# select * from users where reseller_id not in (select id from resellers) and reseller_id<>1;
You can also make sure that no user accounts correspond to those users records:
hsphere=# select * from user_account where user_id in (select id from users where reseller_id not in (select id from resellers) and reseller_id<>1);
user_id | account_id | type_id
Finally, none of those users can be found in the H-Sphere GUI.
ResolutionTo clear those orphaned records out of the database, please back the database with the pg_dump utility and run the following query:
hsphere=# delete from users where reseller_id not in (select id from resellers) and reseller_id<>1;
After that the script psoft.hsphere.tools.PostApacheConfigs should run fine.