Apply Config Failing

I’m getting this error most times I make a change from the GUI.

“reload failed because retrieve_conf encountered an error 255
exit: 1
Unable to continue. SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘hooks-noid’ for key ‘uniqueindex’ in /var/www/html/admin/libraries/BMO/DB_Helper.class.php on line 268
#0 /var/www/html/admin/libraries/BMO/DB_Helper.class.php(268): PDOStatement->execute(Array)
#1 /var/www/html/admin/libraries/BMO/Hooks.class.php(117): FreePBX\DB_Helper->setConfig(‘hooks’, Array)
#2 /var/lib/asterisk/bin/retrieve_conf(81): FreePBX\Hooks->updateBMOHooks()
#3 {main}”

Running this fixes it: rm /var/lib/asterisk/bin/{licinfo,storage.php,register_serial,check_portal.php,activate_existing,register_new,update} && fwconsole reload

Any ideas why it is happening so often?

How does deleting a bunch of files in your Asterisk directory fix a problem in you MySQL database?

It sounds to me like you need to log into the database as ‘root’ and delete the existing ‘hooks-noid’ entry from one of the tables in there. I’m going to guess that one of the files you are deleting is trying to add that as a new entry, but it already exists in your table, so the update is failing.

It’s actually the “fwconsole reload” that is fixing it.
I saw that posted by someone here as a fix for the same warning and ran it without looking at what it actually does…

It places the files back that you deleted.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.