Can't apply config after power fail

One of our FreePBX Distro servers ( had a hard reboot yesterday during a power fail. Now I can’t Apply Config, we get the following error:

exit: 1
Unable to continue. SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘asterisk.kvstore_FreePBX_Media’ already exists in >/var/www/html/admin/libraries/BMO/Database.class.php on line 212
#0 [internal function]: PDO->query(‘CREATE TABLE IF…’)
#1 /var/www/html/admin/libraries/BMO/Database.class.php(212): call_user_func_array(‘parent::query’, Array)
#2 /var/www/html/admin/libraries/BMO/DB_Helper.class.php(128): FreePBX\Database->query(‘CREATE TABLE IF…’)
#3 /var/www/html/admin/libraries/BMO/DB_Helper.class.php(55): FreePBX\DB_Helper::createTable(‘kvstore_FreePBX…’)
#4 /var/www/html/admin/libraries/BMO/DB_Helper.class.php(155): FreePBX\DB_Helper::checkDatabase(Object(FreePBX\Media))
#5 /var/www/html/admin/libraries/BMO/Media.class.php(80): FreePBX\DB_Helper->getConfig(‘mediamissingmes…’)
#6 /var/lib/asterisk/bin/retrieve_conf(77): FreePBX\Media->getSupportedHTML5Formats()
#7 {main}

I have tried a reboot and this hasn’t solved the problem.

Do I need to somehow repair the database?

Did you try repairing and restarting mysql?

If I run mysqlcheck -r asterisk I get:

note : The storage engine for the table doesn’t support repair

Tried restarting mysql, same issue.


OK, managed to sort this (I think).

Had to delete the database entirely and restore from a backup… thankfully I have daily backups configured!

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