Database failure. Please refer to suitecrm.log for details

Suite CRM 7.10.22
Sugar Version 6.5.25 (Build 344)
PHP 7.1. EDIT: PHP version is 7.2.27. MySQL version is 5.7.29

On Friday, I attempted to install an update to the latest version of SuiteCRM. I used the install wizard from an admin account. The install failed and left me unable to log into SuiteCRM.

I then restored the entire SuiteCRM directory and database from the previous day’s backup. Everything worked again.

However, when I entered 2-3 meeting events, the app crashed. Attempting to login showed a screen with the message:

“Database failure. Please refer to suitecrm.log for details.”

I had to restore the backup again to get everything working. I decided to not enter any new information and leave everything alone. Things were fine on Friday. Nothing was touched over the weekend.

This morning, attempting to login again shows the “Database failure. Please refer to suitecrm.log for details.” message. I restored from last Thursday’s backup to get things working again.

Obviously, continuing to load an old backup is not a plan to move forward.

My log file is over 5MB. There are hundreds of errors with a similar message to this:

Mon Mar 16 10:37:02 2020 [523217][2df326f7-975b-9472-2aca-5bef32bbff21][FATAL] Job b930e2d3-00dd-e5ff-e57b-5e6f8f2dd676 (Run Email Reminder Notifications) failed in CRON run

The above shows up multiple times every day for the past month. Odd that they should be causing a major error now.

Today’s log entry ends with these lines:

Mon Mar 16 14:37:18 2020 [523840][-none-][FATAL] Mysqli_query failed.
Mon Mar 16 14:37:18 2020 [523840][-none-][FATAL] Query Failed: SELECT id FROM outbound_email WHERE type = ‘system’: MySQL error 1146: Table ‘familyme_suite75.outbound_email’ doesn’t exist
Mon Mar 16 14:37:18 2020 [523840][-none-][FATAL] Mysqli_query failed.
Mon Mar 16 14:37:18 2020 [523840][-none-][FATAL] Query Failed: INSERT INTO outbound_email (id,name,type,user_id,mail_sendtype,mail_smtptype,mail_smtpserver,mail_smtpport,mail_smtpuser,mail_smtppass,mail_smtpauth_req,mail_smtpssl) VALUES (‘5ab00290-8716-2b24-b9a8-5e6f8f422cdf’,‘system’,‘system’,‘1’,‘SMTP’,‘other’,’’,25,’’,’’,1,0): MySQL error 1146: Table ‘familyme_suite75.outbound_email’ doesn’t exist
Mon Mar 16 14:37:23 2020 [523894][-none-][FATAL] Mysqli_query failed.
Mon Mar 16 14:37:23 2020 [523894][-none-][FATAL] Query Failed: SELECT id FROM outbound_email WHERE type = ‘system’: MySQL error 1146: Table ‘familyme_suite75.outbound_email’ doesn’t exist
Mon Mar 16 14:37:23 2020 [523894][-none-][FATAL] Mysqli_query failed.
Mon Mar 16 14:37:23 2020 [523894][-none-][FATAL] Query Failed: INSERT INTO outbound_email (id,name,type,user_id,mail_sendtype,mail_smtptype,mail_smtpserver,mail_smtpport,mail_smtpuser,mail_smtppass,mail_smtpauth_req,mail_smtpssl) VALUES (‘6af61ceb-2818-a684-177f-5e6f8f81df41’,‘system’,‘system’,‘1’,‘SMTP’,‘other’,’’,25,’’,’’,1,0): MySQL error 1146: Table ‘familyme_suite75.outbound_email’ doesn’t exist

Any ideas what is going wrong? It all talks about “outbound email” but I’m not sure exactly where the problem lies or how to correct it.

Update…

With a restore from backup of both entire SuiteCRM directory and database, things started working.

Within an hour, no one is able to login. Message received is:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@familymedia.info to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

The suiteCRM log has no new entries in it.

The previous situation you had seemed like a mismatch between the SuiteCRM version, and the version that corresponded with what was in the database.

The current situation, you seem to have a PHP Fatal. Check the web server log instead, maybe called php_errors.log (or whatever it is defined as in your php.ini).

Another suggestion I can give you right away (because of the way you’re getting situations that work, followed by stoppage) is to check for exhausted disk space.

Delete the contents of directory cache/upgrades/temp in any case - it’s a temp directory and there is a bug that may cause it to fill up in some cases.

Thank you for the response and suggestions.

I definitely thought the failed upgrade had something to do with the problems. We experienced no trouble before then. I also thought the situation was resolved by restoring from a backup. I replaced the entire SuiteCRM directory and database with the backup from a full day prior to the attempted update. Seems something didn’t work properly with the restores.

My install is on a hosted site. I used cPanel to look for something like a PHP Error log. The only files I can find are the suitecrm.log and a file named “error.log” - both in the SuiteCRM directory. The "error.log’ file has multiple entries that look like this:

Stack trace:
#0 /home/familyme/public_html/suitecrm2018/modules/Reminders/Reminder.php(213): EmailReminder->sendReminders(Object(Meeting), Object(Administration), Array)
#1 /home/familyme/public_html/suitecrm2018/modules/Activities/EmailReminder.php(97): Reminder::sendEmailReminders(Object(EmailReminder), Object(Administration))
#2 /home/familyme/public_html/suitecrm2018/modules/Schedulers/_AddJobsHere.php(434): EmailReminder->process()
#3 /home/familyme/public_html/suitecrm2018/modules/SchedulersJobs/SchedulersJob.php(539): sendEmailReminders(Object(SchedulersJob))
#4 /home/familyme/public_html/suitecrm2018/include/SugarQueue/SugarCronJobs.php(191): SchedulersJob->runJob()
#5 /home/familyme/public_html/suitecrm2018/include/SugarQueue/SugarCronJobs.php(231): SugarCronJobs->executeJob(Object(SchedulersJob))
#6 /home/familyme/public_html/suitecrm2018/cron.php( in /home/familyme/public_html/suitecrm2018/modules/Activities/EmailReminder.php on line 155

I deleted the contents of the cache/upgrades/temp directory as suggested. There were only a few files in there. I don’t believe space is an issue. My cPanel is showing 9.35% disk usage and 1.96% MySQL disk usage. Well under the host quotas…

Regarding the mismatch between versions… how can I correct that? The logs continue to record the same errors, so I am guessing the problem still exists.

The mismatch between versions, if in fact there is one, is a critical issue, because I don’t know how to recover from it. It would only occur if your backups took the database at a different time than the files, and there was an upgrade between those two moments. Do you think it is possible that happened?

Have you gone into the Admin / Repairs / Quick Repair and Rebuild? Scroll down to the bottom and check if there is a button to sync database with vardefs. If there is, press it.

The error.log is the correct one. But those messages you show start before the #0 mark. This is the structure of one of those errors, as an example:

PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/html/data/SugarBean.php on line 2551
PHP Stack trace:
#1 {main}() /var/www/html/index.php:0
#2 require_once() /var/www/html/index.php:47alent to "break". 

So when you paste the errors here, make sure you include that first part which is actually the error message (the numbers are the stack trace to see which function was calling which - also interesting, but secondary)

I just did the quick rebuild. That seemed to work without any issue.

It does look like I missed one line in the error log. The error log seems to be repeating this over and over:

[16-Mar-2020 18:02:01 America/New_York] PHP Fatal error: Uncaught Error: Call to a member function getReplyToAddress() on null in /home/familyme/public_html/suitecrm2018/modules/Activities/EmailReminder.php:155
Stack trace:
#0 /home/familyme/public_html/suitecrm2018/modules/Reminders/Reminder.php(213): EmailReminder->sendReminders(Object(Meeting), Object(Administration), Array)
#1 /home/familyme/public_html/suitecrm2018/modules/Activities/EmailReminder.php(97): Reminder::sendEmailReminders(Object(EmailReminder), Object(Administration))
#2 /home/familyme/public_html/suitecrm2018/modules/Schedulers/_AddJobsHere.php(434): EmailReminder->process()
#3 /home/familyme/public_html/suitecrm2018/modules/SchedulersJobs/SchedulersJob.php(539): sendEmailReminders(Object(SchedulersJob))
#4 /home/familyme/public_html/suitecrm2018/include/SugarQueue/SugarCronJobs.php(191): SchedulersJob->runJob()
#5 /home/familyme/public_html/suitecrm2018/include/SugarQueue/SugarCronJobs.php(231): SugarCronJobs->executeJob(Object(SchedulersJob))
#6 /home/familyme/public_html/suitecrm2018/cron.php( in /home/familyme/public_html/suitecrm2018/modules/Activities/EmailReminder.php on line 155

Prior to several dozen of the above, there is also:

[16-Mar-2020 17:19:44 Europe/London] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ACLAction has a deprecated constructor in /home/familyme/public_html/suitecrm2018/modules/ACLActions/ACLAction.php on line 54

and

[16-Mar-2020 14:43:23 Europe/London] PHP Notice: Only variables should be passed by reference in /home/familyme/public_html/suitecrm2018/modules/iCals/iCal.php on line 281

The above two are also repeated numerous times.

There is no line in the error.log with “PHP Warning” or “PHP Stack trace.”

I am getting really worried about your installation, it’s looking very critical… :frowning:

Please confirm that you did the second part of this instruction:

Have you gone into the Admin / Repairs / Quick Repair and Rebuild? Scroll down to the bottom and check if there is a button to sync database with vardefs . If there is, press it.

Did that button appear, did you run the queries? I need to know.

About the suitecrm.log and error.log messages, focus on the FATALs and ERRORs, ignore the DEPRECATEDs and NOTICEs.

Are you still getting this one?

[FATAL] Query Failed: SELECT id FROM outbound_email WHERE type = ‘system’: MySQL error 1146: Table ‘familyme_suite75.outbound_email’ doesn’t exist

What does your database look like as seen from mysql or phpMyAdmin? Is it really called familyme_suite75? Does the table outbound_email exist there?

Maybe your backup got loaded into a different database name…

I clicked on the “Quick Repair and Rebuild” item. It read through a list and at the end of the list was:

Database tables are synced with vardefs

There was no button to “sync database with vardefs”

The error log continues to throw a single PHP fatal error every one minute:

[17-Mar-2020 09:58:02 America/New_York] PHP Fatal error: Uncaught Error: Call to a member function getReplyToAddress() on null in /home/familyme/public_html/suitecrm2018/modules/Activities/EmailReminder.php:155
Stack trace:
#0 /home/familyme/public_html/suitecrm2018/modules/Reminders/Reminder.php(213): EmailReminder->sendReminders(Object(Meeting), Object(Administration), Array)
#1 /home/familyme/public_html/suitecrm2018/modules/Activities/EmailReminder.php(97): Reminder::sendEmailReminders(Object(EmailReminder), Object(Administration))
#2 /home/familyme/public_html/suitecrm2018/modules/Schedulers/_AddJobsHere.php(434): EmailReminder->process()
#3 /home/familyme/public_html/suitecrm2018/modules/SchedulersJobs/SchedulersJob.php(539): sendEmailReminders(Object(SchedulersJob))
#4 /home/familyme/public_html/suitecrm2018/include/SugarQueue/SugarCronJobs.php(191): SchedulersJob->runJob()
#5 /home/familyme/public_html/suitecrm2018/include/SugarQueue/SugarCronJobs.php(231): SugarCronJobs->executeJob(Object(SchedulersJob))
#6 /home/familyme/public_html/suitecrm2018/cron.php( in /home/familyme/public_html/suitecrm2018/modules/Activities/EmailReminder.php on line 155

The only other fatal error showing is:

[17-Mar-2020 02:00:02 America/New_York] PHP Fatal error: Uncaught Zend_Search_Lucene_Exception: File ‘modules/AOD_Index/Index/Index/segments_b231d’ is not readable. in /home/familyme/public_html/suitecrm2018/vendor/zf1/zend-search-lucene/library/Zend/Search/Lucene/Storage/File/Filesystem.php:56
Stack trace:
#0 /home/familyme/public_html/suitecrm2018/vendor/zf1/zend-search-lucene/library/Zend/Search/Lucene/Storage/Directory/Filesystem.php(361): Zend_Search_Lucene_Storage_File_Filesystem->__construct(‘modules/AOD_Ind…’)
#1 /home/familyme/public_html/suitecrm2018/vendor/zf1/zend-search-lucene/library/Zend/Search/Lucene.php(412): Zend_Search_Lucene_Storage_Directory_Filesystem->getFileObject(‘segments_b231d’)
#2 /home/familyme/public_html/suitecrm2018/vendor/zf1/zend-search-lucene/library/Zend/Search/Lucene.php(570): Zend_Search_Lucene->_readSegmentsFile()
#3 /home/familyme/public_html/suitecrm2018/modules/AOD_Index/AOD_Index.php(359): Zend_Search_Lucene->__construct(‘modules/AOD_Ind…’)
#4 /home/familyme/public_html/suitecrm2018/modules/AOD_Index/AOD_Index.php(90): in /home/familyme/public_html/suitecrm2018/vendor/zf1/zend-search-lucene/library/Zend/Search/Lucene/Storage/File/Filesystem.php on line 56

This second one seems to appear every few hours.

familyme_suite75 is the correct name for the database as shown in phpMyAdmin. “outbound_email” is listed as a table in that database. (Table is 16k and has four entries).

I don’t know if this is the same or a different error, but the “suitecrm.log” file is also showing these fatal errors. every minute:

Tue Mar 17 09:52:02 2020 [429142][2df326f7-975b-9472-2aca-5bef32bbff21][FATAL] *** FOLDERS: addBean() is trying to save to a non-saved or non-existent folder
Tue Mar 17 09:52:02 2020 [429142][2df326f7-975b-9472-2aca-5bef32bbff21][FATAL] Job 27289d0c-b206-ba1c-652d-5e70d62021b4 (Run Email Reminder Notifications) failed in CRON run

Of all the problems listed in your two logs, the ones I would start by trying to solve are the ones in your first post, do you still get them?

These are really weird. It’s saying a table doesn’t exist in the database, while you tell me it is there. You’ll have to check maybe the database access permissions; your database configuration in config.php, dbconfig entries.

I think if we can get this error to go away, maybe some of the others will also get fixed… :crossed_fingers:

Been putting out other fires and just got back to this.

I have the config.php. All I see in there regarding permissions is:

‘default_permissions’ =>
array (
‘dir_mode’ => 493,
‘file_mode’ => 420,
‘user’ => ‘’,
‘group’ => ‘’,

Is there something else I should be looking for?

That doesn’t seem very good to me, but that part wasn’t what I mentioned above: I mentioned the dbconfig array entry in your php.ini config.php

Sorry, I apparently misunderstood your last instructions.

I have looked through my SuiteCRM directory and the “home” directory that contains it. Cannot find a “php.ini” file anywhere. Any suggestions on where to find it?

Sorry, my bad, I just edited my post above to fix the correct name of the file. It’s the same file you were looking at before, only a different part of it.

Anyway you should know where your php.ini file is. Go to Admin / Diagnostics and download your phpinfo from there. This should tell you the path, and a bunch of other important PHP settings.

Form the config.php file:

‘dbconfig’ =>
array (
‘db_host_name’ => ‘localhost’,
‘db_host_instance’ => ‘SQLEXPRESS’,
‘db_user_name’ => ‘familyme_suite75’,
‘db_password’ => ‘’,
‘db_name’ => ‘familyme_suite75’,
‘db_type’ => ‘mysql’,
‘db_port’ => ‘’,
‘db_manager’ => ‘MysqliManager’,

FYI - the password value is correct. I removed it from this post.

I’m looking at all my cPanel options and phpMyAdmin page. Can’t find anything for diagnostics od that would indicate the path for phoinfo.

The Admin / Diagnostics I mentioned is inside SuiteCRM.

I don’t understand how you can have a table in the database and then get FATAL errors saying it is not there. I don’t know how to debug this further from a distance, but I advise to get to the bottom of that, try to ask for assistance from some expert there, if possible.

We can have a look at improving your permissions scheme if you want. That might help with some of the other issues (like the file that cannot be read).

Please tell me what do you have in the crontab instructions at the bottom of SuiteCRM / Admin / Schedulers - this will tell me which user name your web server is running under.

Understood. I appreciate your help thus far.

Apologies if I’m misunderstanding, but here is a screenshot of the Admin->Schedulers page. Is this what you are asking for?

Yeah, that’s it. The username your web server is running under is familyme. I assume it is in a Linux user group also called familyme, but please check that before giving the commands below (type groups familyme to see a list of groups your user belongs to).

Your permissions could be set like this:

  sudo chown -R familyme:familyme .
  sudo chmod -R 755 .
  sudo chmod -R 775 cache custom modules themes data upload
  sudo chmod 775 config_override.php 2>/dev/null

And in config.php:

'default_permissions' =>
array (
'dir_mode' => 02770,
'file_mode' => 0750,
'user' => 'familyme',
'group' => 'familyme',

Run a Quick Repair and Rebuild.

Try the operations again and see if any of those errors was resolved.

Thank for the info. I hope you are doing well - things are crazy right now. Been coordinating other activities and am just able to get back to this now.

The command “groups familyme” returns “familyme : familyme”
Any of the sudo commands returns “bash: sudo: command not found” - so I’m not able to set those permissions.

I changed the permissions in the config.php file as directed. I also rand the Quick Repair and Rebuild, which seemed to go well - no notices or error messages.

The suitecrm.log and error_log file still show an error as follows:

suitecrm.log

10:57:02 America/New_York] PHP Fatal error: Uncaught Error: Call to a member function getReplyToAddress() on null in /home/familyme/public_html/suitecrm2018/modules/Activities/EmailReminder.php:155
Stack trace:
#0 /home/familyme/public_html/suitecrm2018/modules/Reminders/Reminder.php(213): EmailReminder->sendReminders(Object(Meeting), Object(Administration), Array)
#1 /home/familyme/public_html/suitecrm2018/modules/Activities/EmailReminder.php(97): Reminder::sendEmailReminders(Object(EmailReminder), Object(Administration))
#2 /home/familyme/public_html/suitecrm2018/modules/Schedulers/_AddJobsHere.php(434): EmailReminder->process()
#3 /home/familyme/public_html/suitecrm2018/modules/SchedulersJobs/SchedulersJob.php(539): sendEmailReminders(Object(SchedulersJob))
#4 /home/familyme/public_html/suitecrm2018/include/SugarQueue/SugarCronJobs.php(191): SchedulersJob->runJob()
#5 /home/familyme/public_html/suitecrm2018/include/SugarQueue/SugarCronJobs.php(231): SugarCronJobs->executeJob(Object(SchedulersJob))
#6 /home/familyme/public_html/suitecrm2018/cron.php( in /home/familyme/public_html/suitecrm2018/modules/Activities/EmailReminder.php on line 155

and error_log

Mon Mar 30 10:57:02 2020 [570377][2df326f7-975b-9472-2aca-5bef32bbff21][FATAL] Job b229bdd4-cb57-dbd9-2c46-5e8208a51756 (Run Email Reminder Notifications) failed in CRON run

(which repeats over and over)