Make a quick vote 🗳 ️How do you refer to SuiteCRM extensions: add-ons or plug-ins? Click here to have your say 👈

Database failure when I try Quick Repair and Rebuild

Hello

I try to do quick repair and rebuild I see the message that I need sync database, but when I try executed code I got an error: “Database failure. Please refer to suitecrm.log for details.”

This is inside log file:
Sat May 30 16:34:55 2020 [643][1][FATAL] Mysqli_query failed.
Sat May 30 16:34:55 2020 [643][1][FATAL] Executing repair query: Query Failed: ALTER TABLE users_feeds modify COLUMN rank int(11) NULL: MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘rank int(11) NULL’ at line 1
Sat May 30 16:34:55 2020 [643][1][FATAL] Exception handling in /var/www/html/crm/include/MVC/Controller/SugarController.php:400
Sat May 30 16:34:55 2020 [643][1][FATAL] Exception in Controller: Database failure. Please refer to suitecrm.log for details.
Sat May 30 16:34:55 2020 [643][1][FATAL] backtrace:
#0 /var/www/html/crm/include/database/DBManager.php(353): sugar_die()
#1 /var/www/html/crm/include/database/DBManager.php(328): DBManager->registerError()
#2 /var/www/html/crm/include/database/MysqliManager.php(179): DBManager->checkError()
#3 /var/www/html/crm/modules/Administration/repairDatabase.php(95): MysqliManager->query()
#4 /var/www/html/crm/include/MVC/View/SugarView.php(834): include_once(’/var/www/html/c…’)
#5 /var/www/html/crm/include/MVC/View/views/view.classic.php(72): SugarView->includeClassicFile()
#6 /var/www/html/crm/include/MVC/View/SugarView.php(226): ViewClassic->display()
#7 /var/www/html/crm/include/MVC/Controller/SugarController.php(435): SugarView->process()
#8 /var/www/html/crm/include/MVC/Controller/SugarController.php(375): SugarController->processView()
#9 /var/www/html/crm/include/MVC/SugarApplication.php(113): SugarController->execute()
#10 /var/www/html/crm/index.php(52): SugarApplication->execute()
#11 {main}

What should I do?
I have ubuntu 20.04 Where I install PHP: 7.4.3 / Apache /
Also I do 777 and chown www-data:www-data /suitecrm directory

You’re using MySQL 8 which isn’t supported yet

There’s a PR fixing that already

I did this fix https://github.com/salesagility/SuiteCRM/commit/6de245701e6471f7a7bda42651e624aa2ca8dfea

So now repair and rebuild ended successful
But right now if I try to repair and rebuild again it every time need sync the database structure
It will sync every time even if I run repair and rebuild 10 times in a row
Also I try to do directly SQL query into mysql but it’s nothing change

Hi
Have you encountered such a problem above?

Hhmm not that one specifically (with CASES table). But I do remember seeing some people here on the Forums with this issue of not being able to get the database repairs done… :thinking:

thanks for your reply
may i ask you something?
Right now I got an error (in log: MySQL error 1059: Identifier name is too long)
Full log error:
Mysqli_query failed.
Mon Jun 8 05:07:45 2020 [1272716][1][FATAL] Error creating table: lprof_licenseeprofile_ppt_professional_postgraduate_training_1_c Query Failed: CREATE TABLE lprof_licenseeprofile_ppt_professional_postgraduate_training_1_c (id varchar(36) NOT NULL ,date_modified datetime NULL ,deleted bool DEFAULT ‘0’ NULL ,lprof_licedf44profile_ida varchar(36) NULL ,lprof_lice47beraining_idb varchar(36) NULL , PRIMARY KEY (id), KEY lprof_licenseeprofile_ppt_professional_postgraduate_training_1_ida1 (lprof_licedf44profile_ida), KEY lprof_licenseeprofile_ppt_professional_postgraduate_training_1_alt (lprof_lice47beraining_idb)) CHARACTER SET utf8 COLLATE utf8_general_ci: MySQL error 1059: Identifier name ‘lprof_licenseeprofile_ppt_professional_postgraduate_training_1_ida1’ is too long

I try to add a new one-to-many relationship and got this…
I understand that this field is too long in the database.
Any idea how it could be fixed?

I use MariaDB latest version

This is made up from the table names. If your table names were shorter, you wouldn’t go over the limit.

If that is not something you can change, then you can go in the custom directory and change the names that Studio/Module Builder gives to the relationships to make them shorter.

This might help:

Thanks
I will try to do it later
but did I understand correctly that this is the only way out?
and I can’t increase the size of the name in the database?

I think it’s a MySql limitation - 64 chars max

Hi
Could you tell me how to correctly change the name of the whole module?
I changed everything that was /custom(application, extenstion…) using search and replace
but now i have problems in editview and quickedit


also I can’t see my custom field

but I can see my custom file in layouts

how can this be fixed?

I don’t know. It’s likely that there isn’t an option to change module name.

I would try it from the files and from the database, search everything in custom and change the name of the relationship, and then also in the database form phpMyAdmin. The article I linked above will help you with this. But beware, you need to be serious about proper backups before attemtping this. It’s easy to completely mess up your system.

If you don’t want to risk doing that, all you can do is create a new module and new relationships using smaller names.

I have the same issue, after migration of Mysql Mariadb. I nned to syncronize after repair.
Two year age thi serror was reproted and still is happening. I wonder if there is any solution.

@ariajf00 which is your version of SuiteCRM, MySQL, and PHP?

Database * Server version: 8.0.29-cll-lve - MySQL Community Server - GPL
Suitecrm: Version 7.11.15
PHP 7.4 (ea-php74)

You have to stay inside the Matrix, Neo.

Your version of SuiteCRM doesn’t support your MySQL, and it doesn’t support your PHP. No wonder you’re getting random errors.

Thanks prg.
What is the next version compatible with my database, I needed to migrate thr host due to the performance issues but I didnot realize that theh database was mariadb. There still some issues, overall in workflows scheduled. This imlemetation was customied for a transportation company to lead with loads and there are a lot of new modules and webhooks developed. I would like a smooth migration.

Why don’t you just start from the Compatibility Matrix and install a server that matches the SuiteCRM version you will be using? That’s really the only sensible option…

The hosting is shared I only have access to change PHP version. I will migrate the crm to 7-12-x version.