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

Hi, I have configured suitecrm for my business application and i was able to access all my records until yesterday. When i try to access my data which is present in the modules i am getting an error “Database failure. Please refer to suitecrm.log for details.” The records are present in my phpmyadmin DB but i am unable to retreive and view them on the suitecrm application. Is there a fix avaiable for the Database failure issue ? I am using Suite CRM Version 7.10.20 which i installed recently. Can any one provide a solution/fix for this issue ?

Thanks,
Martin

As the error message says, can you have a look at your logs? This will bring more precise information.

When exactly do you get the error? Do you get a chance to login? Do you see some screens with data? Or no screen works?

@pgr - I am unable to login nor able to see any screens during this issue. During this DB Failure instance when i check my database one of my table is getting automatically deleted ( database_name.table_name.cstm ). This table was part of my custom module that i created from scratch. I am not sure what is the cause that is leading to DB failure issue and loss of my table that gets automatically deleted. This is the third time i am getting this similar issue and this is causing me a huge obstacle in creating my application. During these failures i would need to install SuiteCRM from scratch which is a huge blocker for me.


I came across a fix that was recommended by you and when double checked for the code in data/Link2.php the braces is already present in the code. Attaching the copy of code that i fetched from my SuiteCRM App

public function getSide()
    {
        //First try the relationship

        $focusModuleName = null;
        if (isset($this->focus->module_name)) {
            $focusModuleName = $this->focus->module_name;
        } else {
            LoggerManager::getLogger()->error('Focus Module Name is not set for Link2 get side.');
        }

        if ($this->relationship->getLHSLink() == $this->name &&
            ($this->relationship->getLHSModule() == (isset($this->focus->module_name) ? $this->focus->module_name : null))
        ) {
            return REL_LHS;
        }

The ablove mentioned code has already the braces added. But still no luck on this :frowning:


SuiteCRM Version - 7.10.20
PHP Version - 7.1.32

Is there a fix for this ?

Thanks in Advance !

Frankly, I don’t remember that issue with the braces. :unsure:

Can you please check your logs? We need to know exactly what the problem is.

The problem of automatic changes in the database I can only see as coming from some discrepancy with the vardefs. Maybe you have something in custom directory that is causing the changes. This would only happen during a Quick Repair and Rebuild, and only if you pressed the button to sync the database with vardefs…

@pgr Unfortunately i am unable to check the logs. Because of this DB failure i am unable to login via the index home page :frowning:

Is there any work around for this DB Failure or a Fix ?

You can check the logs by accessing your server via CPanel, or FTP, or (better) SSH, if you have those sorts of accesses.

It is a file in the SuiteCRM root directory.

Hello @Marty42

This is precisely the same issue and the fix is the same.

This issue impacts subpanels in every module as all the subpanels use SugarBean.php when pulling data. Where the user first encounters the error depends on what part of the CRM they use after the MySQL environment on their server is updated.

To fix:
In SuiteCRM/data/SugarBean.php

Replace

$final_query = ‘(’ . $tmp_final_query . ‘)’;

With

$final_query =  $tmp_final_query ;

AND on line number 930

comment out:

$query = '(' . $query . ')';

Both changes are required to fix this issue.

The $final_query variable is used further in the code.

I hope this is helpful.

Thanks.

1 Like

@chirag_biz309 You shouldn’t assume that every “Database failure” error is that particular bug. There are tons of various situations.

And that bug only started appearing 2 or 3 months ago, so I really doubt it has any relevance for these old threads…