Database failure during update from 7.10.30 to 7.10.31

Gets to end of the update and errors with Database Failure. Database working fine, just cannot finish update. Think it is adjusting some fields.

Sat Jun 5 14:48:32 2021 [2816][1][FATAL] Slow Query (time:0.13921904563904
SELECT item_id, item_summary, module_name, id FROM tracker WHERE id = (SELECT MAX(id) as id FROM tracker WHERE user_id = β€˜1’ AND deleted = 0 AND visible = 1) LIMIT 0,10)
Sat Jun 5 14:48:33 2021 [2816][1][FATAL] Mysqli_query failed.
Sat Jun 5 14:48:33 2021 [2816][1][FATAL] Query Failed: ALTER TABLE users DROP INDEX idx_user_name, ADD INDEX idx_user_name (user_name,is_group,status,last_name,first_name,id): MySQL error 1071: Specified key was too long; max key length is 1000 bytes
Sat Jun 5 14:48:33 2021 [2816][1][FATAL] Exception handling in /var/www/html/highamcrm.co.uk/sugarcrm/include/MVC/Controller/SugarController.php:409
Sat Jun 5 14:48:33 2021 [2816][1][FATAL] Exception in Controller: Database failure. Please refer to suitecrm.log for details.

Cannot finish the update - any ideas?

I think that somebody has very long user_name.

use the fix below

1 Like

I had the same error when updating with https://suitecrm.com/files/162/SuiteCRM-7.11/549/SuiteCRM-Upgrade-7.11.x-to-7.11.20.zip
It seems it’s because using now utf8mb4_unicode_ci collation instead of utf8_unicode_ci makes error when a indexed or a primary field is CHAR or VARCHAR of 255 length, with myISAM database. When the length is smaller, it works (I don’t know how if the lenght is different with InnoDB and myISAM).
There are a lot of fields length to modify, a SQL script would be useful.

I have read through the fix but I cannot work out what I need to do to get it to work. I have reverted back to the old version for the moment as I think it is a DB compatibility issue. Thank you.

I got the same error today upgrading from 7.17 to 7.20.
Changing the engine on the tables to innodb fixed it.
This link has a script that will generate a list you can edit to run the coversion.

Finally got around to doing this and it worked for me too. Thank you.