SuiteCRM loses connection to the database

When I try to add a new field or delete certain types of fields, this error happens both in version 7 and after upgrade to version 8.2 beta.

request.CRITICAL: Uncaught PHP Exception Exception: “Could not connect to the database. Please refer to suitecrm.log for details (0).” at /var/www/CRM8/public/legacy/include/utils.php line 2080 {“exception”:"[object] (Exception(code: 1): Could not connect to the database. Please refer to suitecrm.log for details (0). at /var/www/CRM8/public/legacy/include/utils.php:2080)"} []

Is there any way to fix this or am I looking at a full reinstall?

Hi @Hopeless

Can you please share the message showing in the SuiteCRM.log file when you perform one of the actions you mentioned like adding a new field, etc.

Thank you…

Here you go. I tried to delete a relate field.

Tue Sep 20 11:47:23 2022 [6677][98f76a3d-73d8-bd37-8ec5-60d19ca12424][FATAL] Mysqli_query failed.
Tue Sep 20 11:47:23 2022 [6677][98f76a3d-73d8-bd37-8ec5-60d19ca12424][FATAL] Query Failed: SELECT * FROM fields_meta_data WHERE custom_module=‘ACLRoles’ AND deleted = 0: MySQL error 2006: MySQL server has gone away
Tue Sep 20 11:47:23 2022 [6677][98f76a3d-73d8-bd37-8ec5-60d19ca12424][FATAL] Mysqli_query failed.
Tue Sep 20 11:47:23 2022 [6677][98f76a3d-73d8-bd37-8ec5-60d19ca12424][FATAL] Query Failed: SELECT * FROM fields_meta_data WHERE custom_module=‘Relationships’ AND deleted = 0: MySQL error 2006: MySQL server has gone away
Tue Sep 20 11:47:23 2022 [6677][98f76a3d-73d8-bd37-8ec5-60d19ca12424][FATAL] Mysqli_query failed.
Tue Sep 20 11:47:23 2022 [6677][98f76a3d-73d8-bd37-8ec5-60d19ca12424][FATAL] Query Failed: SELECT * FROM fields_meta_data WHERE custom_module=‘Leads’ AND deleted = 0: MySQL error 2006: MySQL server has gone away
Tue Sep 20 11:47:23 2022 [6677][98f76a3d-73d8-bd37-8ec5-60d19ca12424][FATAL] Mysqli_query failed.
Tue Sep 20 11:47:23 2022 [6677][98f76a3d-73d8-bd37-8ec5-60d19ca12424][FATAL] Error searching relationships table… Query Failed: SELECT relationship_name FROM relationships WHERE deleted=0 AND relationship_name = ‘leads_modified_user’: MySQL error 2006: MySQL server has gone away
Tue Sep 20 11:47:23 2022 [6677][98f76a3d-73d8-bd37-8ec5-60d19ca12424][FATAL] Exception handling in /var/www/CRM8/public/legacy/include/MVC/Controller/SugarController.php:397
Tue Sep 20 11:47:23 2022 [6677][98f76a3d-73d8-bd37-8ec5-60d19ca12424][FATAL] Exception in Controller: Database failure. Please refer to suitecrm.log for details.

After digging through mysql error logs, I found this:

2022-09-20T13:32:04.434767Z 12 [ERROR] [MY-012153] [InnoDB] Trying to access page number 959471926 in space 503, space name suitecrm/accounts_cstm, which is outside the
tablespace bounds. Byte offset 0, len 16384, i/o type read. If you get this error at mysqld startup, please check that your my.cnf matches the ibdata files that you have
in the MySQL server.

SuiteCRM kills the server permanently by trying to access something that doesn’t exist. After this, MySQL keeps restarting and never recovers.

I think you have an unhealthy database. I wouldn’t be surprised if your database files were corrupt, or your disk is faulty…

I think this can be closed. I was able to do a database dump and restore on a working backup and it appears that dropping tables no longer kills the database.

For reference:

mysqldump --all-databases --add-drop-database --add-drop-table > dump.sql
mysql -u root -p
mysql>tee import_database.log
mysql> source dump.sql

1 Like