Fwconsole reload returns error: General error: 130 Incorrect file format 'music'

[root@freepbx-b ~]# fwconsole reload
Reloading FreePBX
Error(s) have occured, the following is the retrieve_conf output:
exit: 1
PDOException: SQLSTATE[HY000]: General error: 130 Incorrect file format ‘music’ in file /drbd/httpd/www/html/admin/modules/music/Music.class.php on line 379
Stack trace:

  1. PDOException->() /drbd/httpd/www/html/admin/modules/music/Music.class.php:379
  2. PDOStatement->execute() /drbd/httpd/www/html/admin/modules/music/Music.class.php:379
  3. FreePBX\modules\Music->getCategories() /drbd/httpd/www/html/admin/modules/music/Music.class.php:176
  4. FreePBX\modules\Music->genConfig() /drbd/httpd/www/html/admin/libraries/BMO/FileHooks.class.php:97
  5. FreePBX\FileHooks->processNewHooks() /drbd/httpd/www/html/admin/libraries/BMO/FileHooks.class.php:26
  6. FreePBX\FileHooks->processFileHooks() /drbd/asterisk/lib/bin/retrieve_conf:894

Your mysql database is corrupt. Repair it.

How would I do that?

 mysqlcheck --repair --all-databases

No luck, same error still.

[root@freepbx-b ~]# fwconsole reload
Reloading FreePBX
Error(s) have occured, the following is the retrieve_conf output:
exit: 1
PDOException: SQLSTATE[HY000]: General error: 130 Incorrect file format ‘music’ in file /drbd/httpd/www/html/admin/modules/music/Music.class.php on line 379
Stack trace:

  1. PDOException->() /drbd/httpd/www/html/admin/modules/music/Music.class.php:379
  2. PDOStatement->execute() /drbd/httpd/www/html/admin/modules/music/Music.class.php:379
  3. FreePBX\modules\Music->getCategories() /drbd/httpd/www/html/admin/modules/music/Music.class.php:176
  4. FreePBX\modules\Music->genConfig() /drbd/httpd/www/html/admin/libraries/BMO/FileHooks.class.php:97
  5. FreePBX\FileHooks->processNewHooks() /drbd/httpd/www/html/admin/libraries/BMO/FileHooks.class.php:26
  6. FreePBX\FileHooks->processFileHooks() /drbd/asterisk/lib/bin/retrieve_conf:894

Whatever problem is there is there for good it seems…

Could you do a

mysql
use asterisk;
select * from music;

and post the result of that select?

Good luck and have a nice day!

Nick

ERROR 130 (HY000): Incorrect file format ‘music’

Can you try:

mysql;
use asterisk;
repair table music use_frm;

And post the results here?

(and after that try the select…)

Good luck and have a nice day!

Nick

1 Like

mysql> select * from music;
Empty set (0.00 sec)

Error gone.
Thank you

The table is no longer corrupted but is empty…

Was it empty to begin with?

Good luck and have a nice day!

Nick

I don’t know.

Did you have any music on hold categories?

(That’s essentially what is stored in there…)

Good luck and have a nice day!

Nick

Yes I did.
The default ones and others.
They are gone now, not a big deal, I think I can fix that.

1 Like

Sorry, if there was a way to avoid that, I don’t know what it is…

I am more used to playing with Oracle databases than MySQL/MariaDB…

(Ok, MySQL is now owned by Oracle but I mean their flagship product, not MySQL…)

Assuming you have the distro I believe all the music on hold categories you added are folders in /var/lib/asterisk/moh …

You won’t be able to recreate the default one though, the system reserves its name… If you absolutely need it I guess you could create one with a similar name and then update the database (if you want to do that, please let me know…) to call it default…

(The other solution would be to deinstall and reinstall the module since the “default” entry is added when you install but I don’t know if the music on hold files or anything else important are/is removed when you remove the module so I would not do that unless a FreePBX dev confirm it is safe…)

Good luck and have a nice day!

Nick