Issue
While updating:
ERROR: failed to register Plesk hook /usr/share/cloudlinux/hooks/plesk/plan_updated: Wrong syntax for command's '-event' parameter. Event 'template_domain_update' does not exist.. Please, contact CloudLinux support if you need help with resolving this issue.
Environment
- Plesk
- Cloudlinux OS
Solution
I'm sorry about that. The issue usually happens when the entry for the hook "/usr/share/cloudlinux/hooks/plesk/plan_updated" is missing from Plesk's database. To correct the issue, please run the following query:
plesk db
INSERT INTO `event_handlers` VALUES (7,50,'root','/usr/share/cloudlinux/hooks/plesk/plan_updated','template_domain_update');
The first command would be to access the database server, and then the second line is the actual query. After that, you can run the following command to test:
/opt/alt/python37/lib/python3.7/site-packages/clcommon/public_hooks/bundle/hooks.py install
If there's no output, that means it executed successfully.
However, you may face this issue while executing the above command:
MariaDB [psa]> INSERT INTO `event_handlers` VALUES (7,50,'root','/usr/share/cloudlinux/hooks/plesk/plan_updated','template_domain_update');
ERROR 1062 (23000): Duplicate entry '7' for key 'PRIMARY'
Run this command:
SELECT * FROM event_handlers\G
For example:
MariaDB [psa]> SELECT * FROM event_handlers\G
*************************** 1. row ***************************
id: 5
priority: 50
user: root
command: /usr/share/cloudlinux/hooks/plesk/physical_hosting_created
action_name: phys_hosting_create
*************************** 2. row ***************************
id: 6
priority: 50
user: root
command: /usr/share/cloudlinux/hooks/plesk/physical_hosting_updated
action_name: phys_hosting_update
*************************** 3. row ***************************
id: 7
priority: 50
user: root
command: /usr/share/cloudlinux/hooks/plesk/physical_hosting_deleted
action_name: phys_hosting_delete
*************************** 4. row ***************************
id: 8
priority: 50
user: root
command: /usr/share/cloudlinux/hooks/plesk/domain_updated
action_name: domain_update
*************************** 5. row ***************************
id: 9
priority: 50
user: root
command: /usr/share/cloudlinux/hooks/plesk/plan_updated
action_name: template_admin_update
5 rows in set (0.00 sec)
Select the next available id for the INSERT and try again (hint: id: 10 will do for the output above, the logic is to increment by 1 the last id):
INSERT INTO `event_handlers` VALUES (10,50,'root','/usr/share/cloudlinux/hooks/plesk/plan_updated','template_domain_update');
Comments
0 comments
Please sign in to leave a comment.