Solved: After upgrade freepbx 11 to 12 get sqlstate error

exit: 255
PHP Fatal error: Uncaught exception ‘PDOException’ with message ‘SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes’ in /var/www/html/admin/libraries/BMO/DB_Helper.class.php:83
Stack trace:
#0 /var/www/html/admin/libraries/BMO/DB_Helper.class.php(83): PDO->query(‘ALTER TABLE kvs…’)
#1 /var/www/html/admin/libraries/BMO/DB_Helper.class.php(189): DB_Helper::checkDatabase()
#2 /var/www/html/admin/libraries/BMO/Hooks.class.php(102): DB_Helper->setConfig(‘hooks’, Array)
#3 /var/lib/asterisk/bin/retrieve_conf(23): Hooks->updateBMOHooks()
#4 {main}
thrown in /var/www/html/admin/libraries/BMO/DB_Helper.class.php on line 83

i changed the kvstore table to innodb from myism

I don’t know how you managed to hit that one.

The longest index is index4, which is module(char 64)+key(char 255)+id(char 255) – 574 bytes… Hmm. Unless there’s some strange unicode stuff jumping in? What’s your default character set?

Edit: Yup, that’s the problem. UTF tables can cause it to overflow. I’m adding a simple patch to DB_Helper to avoid this in the future. Thanks!

yup its utf8

thanks for all