Power Failure

I have distro 5.211.65-14 with freepbx 12.0.1rc20 and suffered a power failure. The system came back but I now get this error when I access freepbx:

FATAL ERROR
FreePBX is Unable to Continue

SQLSTATE[HY000]: General error: 145 Table ‘./asterisk/kvstore’ is marked as crashed and should be repaired
Trace Back
/var/www/html/admin/config.php:302 die_freepbx()
[0]: FreePBX is Unable to Continue
[1]: SQLSTATE[HY000]: General error: 145 Table ‘./asterisk/kvstore’ is marked as crashed and should be repaired

Can anyone help me on how to proceed with the repair.

mysqlcheck --repair --all-databases
1 Like

That was service with a smile!

Very many thanks James, everything now looks normal.

Thanks again.

This is exactly what happened to my office last week and the same error i have now.

But when i run that command i am getting:

mysqlcheck: Got error: 1045: Access denied for user ‘root’@‘localhost’ (using password: NO) when trying to connect

but ive never set a password on it unless it uses the same root and password?

What distro are you using?

CentOS 6.4
FreePBX 12.0.1rc20

If this is a hand install then you set a mysql root password. Only you would know that.

I should have known better.
Found some notes from the guy who originally set this up under the server its self saying he did it with PBIAF…

I was able to get in and fix the mysql tables now using the above solution and it seems to be working great.
Thanks for your help!

Now to setup a fresh FreePBX install.

1 Like

Did not work for me.

I got this …

error : Not enough memory for blob at 2170384 (need 1944068709)
status : Operation failed

Maybe I should the attempt to repair in MySQL

±-----------------±-------±---------±----------------------------------------------------------------------------+
| Table | Op | Msg_type | Msg_text |
±-----------------±-------±---------±----------------------------------------------------------------------------+
| asterisk.kvstore | repair | info | Found block with too small length at 267276; Skipped |
| asterisk.kvstore | repair | info | Found block that points outside data file at 268152 |
| asterisk.kvstore | repair | info | Found block with too small length at 365016; Skipped |
| asterisk.kvstore | repair | info | Found block that points outside data file at 385100 |
| asterisk.kvstore | repair | info | Found block that points outside data file at 390212 |
| asterisk.kvstore | repair | info | Found block that points outside data file at 391552 |
| asterisk.kvstore | repair | info | Found block that points outside data file at 392232 |
| asterisk.kvstore | repair | info | Found block with too small length at 424604; Skipped |
| asterisk.kvstore | repair | info | Found link that points at 7163097731800834145 (outside data file) at 702824 |
| asterisk.kvstore | repair | info | Found block that points outside data file at 717196 |
| asterisk.kvstore | repair | info | Found block that points outside data file at 798876 |
| asterisk.kvstore | repair | info | Found block that points outside data file at 801652 |
| asterisk.kvstore | repair | info | Found block with too small length at 910056; Skipped |
| asterisk.kvstore | repair | info | Found block with too small length at 910480; Skipped |
| asterisk.kvstore | repair | info | Found block that points outside data file at 1120168 |
| asterisk.kvstore | repair | info | Found block with too small length at 1125908; Skipped |
| asterisk.kvstore | repair | info | Found block with too small length at 1349880; Skipped |
| asterisk.kvstore | repair | info | Found block with too small length at 1508928; Skipped |
| asterisk.kvstore | repair | info | Found block that points outside data file at 1510056 |
| asterisk.kvstore | repair | info | Found block with too small length at 1744600; Skipped |
| asterisk.kvstore | repair | info | Found block with too small length at 1746632; Skipped |
| asterisk.kvstore | repair | info | Found block with too small length at 1850608; Skipped |
| asterisk.kvstore | repair | info | Found block with too small length at 1851256; Skipped |
| asterisk.kvstore | repair | info | Found block that points outside data file at 1858844 |
| asterisk.kvstore | repair | info | Found block that points outside data file at 1859104 |
| asterisk.kvstore | repair | info | Found block with too small length at 1886176; Skipped |
| asterisk.kvstore | repair | info | Found block with too small length at 2070384; Skipped |
| asterisk.kvstore | repair | info | Found block that points outside data file at 2089444 |
| asterisk.kvstore | repair | info | Found block that points outside data file at 2093444 |
| asterisk.kvstore | repair | info | Found block with too small length at 2093756; Skipped |
| asterisk.kvstore | repair | info | Found block with too small length at 2105028; Skipped |
| asterisk.kvstore | repair | info | Found block with too small length at 2156604; Skipped |
| asterisk.kvstore | repair | info | Found block that points outside data file at 2158328 |
| asterisk.kvstore | repair | info | Found block that points outside data file at 2158776 |
| asterisk.kvstore | repair | info | Found block that points outside data file at 2159320 |
| asterisk.kvstore | repair | error | Not enough memory for blob at 2170384 (need 1944068709) |
| asterisk.kvstore | repair | info | Found block with too small length at 267276; Skipped |
| asterisk.kvstore | repair | info | Found block that points outside data file at 268152 |
| asterisk.kvstore | repair | info | Found block with too small length at 365016; Skipped |
| asterisk.kvstore | repair | info | Found block that points outside data file at 385100 |
| asterisk.kvstore | repair | info | Found block that points outside data file at 390212 |
| asterisk.kvstore | repair | info | Found block that points outside data file at 391552 |
| asterisk.kvstore | repair | info | Found block that points outside data file at 392232 |
| asterisk.kvstore | repair | info | Found block with too small length at 424604; Skipped |
| asterisk.kvstore | repair | info | Found link that points at 7163097731800834145 (outside data file) at 702824 |
| asterisk.kvstore | repair | info | Found block that points outside data file at 717196 |
| asterisk.kvstore | repair | info | Found block that points outside data file at 798876 |
| asterisk.kvstore | repair | info | Found block that points outside data file at 801652 |
| asterisk.kvstore | repair | info | Found block with too small length at 910056; Skipped |
| asterisk.kvstore | repair | info | Found block with too small length at 910480; Skipped |
| asterisk.kvstore | repair | info | Found block that points outside data file at 1120168 |
| asterisk.kvstore | repair | info | Found block with too small length at 1125908; Skipped |
| asterisk.kvstore | repair | info | Found block with too small length at 1349880; Skipped |
| asterisk.kvstore | repair | info | Found block with too small length at 1508928; Skipped |
| asterisk.kvstore | repair | info | Found block that points outside data file at 1510056 |
| asterisk.kvstore | repair | info | Found block with too small length at 1744600; Skipped |
| asterisk.kvstore | repair | info | Found block with too small length at 1746632; Skipped |
| asterisk.kvstore | repair | info | Found block with too small length at 1850608; Skipped |
| asterisk.kvstore | repair | info | Found block with too small length at 1851256; Skipped |
| asterisk.kvstore | repair | info | Found block that points outside data file at 1858844 |
| asterisk.kvstore | repair | info | Found block that points outside data file at 1859104 |
| asterisk.kvstore | repair | info | Found block with too small length at 1886176; Skipped |
| asterisk.kvstore | repair | info | Found block with too small length at 2070384; Skipped |
| asterisk.kvstore | repair | info | Found block that points outside data file at 2089444 |
| asterisk.kvstore | repair | info | Found block that points outside data file at 2093444 |
| asterisk.kvstore | repair | info | Found block with too small length at 2093756; Skipped |
| asterisk.kvstore | repair | info | Found block with too small length at 2105028; Skipped |
| asterisk.kvstore | repair | info | Found block with too small length at 2156604; Skipped |
| asterisk.kvstore | repair | info | Found block that points outside data file at 2158328 |
| asterisk.kvstore | repair | info | Found block that points outside data file at 2158776 |
| asterisk.kvstore | repair | info | Found block that points outside data file at 2159320 |
| asterisk.kvstore | repair | error | Not enough memory for blob at 2170384 (need 1944068709) |
| asterisk.kvstore | repair | status | Operation failed |
±-----------------±-------±---------±----------------------------------------------------------------------------+
73 rows in set (0.03 sec)

Solved for me…

Just in case others have same issue in future

Was able to recover it using the following command

myisamchk --max-record-length=1048576 -r -f /var/lib/mysql/asterisk/kvstore

1 Like