From 7.10.7 to 7.10.9 Database failure at "Confirm Layouts"

Coming from 7.10.7 to 7.10.9 I’m getting “Database failure. Please refer to suitecrm.log for details.”
This is what I see in the LOG


Wed Oct 3 14:56:21 2018 [5812][1][FATAL] log call at: modules/Administration/index.tpl:53 - MY_FRAME is not set
Wed Oct 3 14:56:31 2018 [5812][1][FATAL] log call at: modules/Administration/index.tpl:53 - MY_FRAME is not set
Wed Oct 3 14:56:34 2018 [5812][1][ERROR] Pop error level. Try to remove the error_reporting() function from your code.
Wed Oct 3 14:56:50 2018 [5812][1][FATAL] Mysqli_query failed.
Wed Oct 3 14:56:50 2018 [5812][1][FATAL] Query Failed: ALTER TABLE cases modify COLUMN type dynamicenum 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 ‘dynamicenum NULL’ at line 1
Wed Oct 3 14:56:50 2018 [5812][1][FATAL] Exception handling in C:\Bitnami\suitecrm-7.9.8-0\apps\suitecrm\htdocs\include\MVC\Controller\SugarController.php:400

Wed Oct 3 14:56:50 2018 [5812][1][FATAL] Exception in Controller: Database failure. Please refer to suitecrm.log for details.

Wed Oct 3 14:56:50 2018 [5812][1][FATAL] backtrace:
#0 C:\Bitnami\suitecrm-7.9.8-0\apps\suitecrm\htdocs\include\database\DBManager.php(353): sugar_die(‘Database failur…’)
#1 C:\Bitnami\suitecrm-7.9.8-0\apps\suitecrm\htdocs\include\database\DBManager.php(328): DBManager->registerError(’ Query Failed: …’, ’ Query Failed: …’, ‘Error with MySQ…’)
#2 C:\Bitnami\suitecrm-7.9.8-0\apps\suitecrm\htdocs\include\database\MysqliManager.php(179): DBManager->checkError(’ Query Failed: …’, ‘Error with MySQ…’)
#3 C:\Bitnami\suitecrm-7.9.8-0\apps\suitecrm\htdocs\include\database\MysqlManager.php(616): MysqliManager->query(‘ALTER TABLE cas…’, ‘Error with MySQ…’)
#4 C:\Bitnami\suitecrm-7.9.8-0\apps\suitecrm\htdocs\include\database\DBManager.php(764): MysqlManager->repairTableParams(‘cases’, Array, Array, true, NULL)
#5 C:\Bitnami\suitecrm-7.9.8-0\apps\suitecrm\htdocs\modules\UpgradeWizard\end.php(86): DBManager->repairTable(Object(aCase), true)
#6 C:\Bitnami\suitecrm-7.9.8-0\apps\suitecrm\htdocs\modules\UpgradeWizard\index.php(296): require(‘C:\Bitnami\suit…’)
#7 C:\Bitnami\suitecrm-7.9.8-0\apps\suitecrm\htdocs\include\MVC\View\SugarView.php(818): include_once(‘C:\Bitnami\suit…’)
#8 C:\Bitnami\suitecrm-7.9.8-0\apps\suitecrm\htdocs\include\MVC\View\views\view.classic.php(72): SugarView->includeClassicFile(‘modules/Cases/C…’)
#9 C:\Bitnami\suitecrm-7.9.8-0\apps\suitecrm\htdocs\include\MVC\View\SugarView.php(211): ViewClassic->display()
#10 C:\Bitnami\suitecrm-7.9.8-0\apps\suitecrm\htdocs\include\MVC\Controller\SugarController.php(435): SugarView->process()
#11 C:\Bitnami\suitecrm-7.9.8-0\apps\suitecrm\htdocs\include\MVC\Controller\SugarController.php(375): SugarController->processView()
#12 C:\Bitnami\suitecrm-7.9.8-0\apps\suitecrm\htdocs\include\MVC\SugarApplication.php(113): SugarController->execute()
#13 C:\Bitnami\suitecrm-7.9.8-0\apps\suitecrm\htdocs\index.php(52): SugarApplication->execute()
#14 {main}


Are your PHP and MySQL versions inside the requirements?

https://docs.suitecrm.com/admin/compatibility-matrix/

before the upgrade, if you run a Quick Repair and Rebuild, and scroll down to the bottom of the screen, if you get a button to “sync vardefs”, please press it, then retry the upgrade.

Running Quick Repair I don’t see such a button but i do see:
Differences found between database and vardefs

with:

Pressing the EXECUTE button gives me the same type of error.
Database failure. Please refer to suitecrm.log for details.

PHP Version 7.0.26
MySQLi Version: mysqlnd 5.0.12-dev - 20150407 -
MySQLi Host Info: 127.0.0.1 via TCP/IP
MySQLi Server Info: 5.7.20
MySQLi Client Encoding: utf8

It seems your vardef has the “type” column in “cases” table set as having type “dynamicenum”, which isn’t a MySQL data type. So I’d say the error is in your vardef.

Did you change it, customize it?

I did not change it, could be at some point in time some add-on module I played with did.
How do I fix this

Thanks so much for your help.

Look for any stuff under the “custom” directory mentioning the module Cases. Especially any vardefs files…

Hi pgr,

Please see attached screenshot, are you referring to that? I checked the original file on GitHub and it seemed to be the same.

Thank you

That is not the “type” column, that is the “status” column. It’s a bit confusing because we are looking for the “type” attribute of a column that happens to be named “type” :huh:

Also, I said to look in the “custom” directory. My hypothesis is that you have some file in the custom directory, and it’s taking precedence over the main file, and creating this incoherence.

Oops, sorry my mistake :slight_smile:

I found the attached file found in:

C:\Bitnami\suitecrm-7.9.8-0\apps\suitecrm\htdocs\custom\modules\Cases\Ext\Vardefs

which has mentioned “dynemicenum,” do you think it has anything to do with that? If yes how can I resolve this?

Thanks so much for your help

//WARNING: The contents of this file are auto-generated


 // created: 2018-07-11 11:01:00
$dictionary['Case']['fields']['assigned_to_c']['inline_edit']='1';
$dictionary['Case']['fields']['assigned_to_c']['labelValue']='assigned to';

 

 // created: 2018-07-11 09:47:03
$dictionary['Case']['fields']['class_c']['inline_edit']='1';
$dictionary['Case']['fields']['class_c']['labelValue']='Class';

 

 // created: 2017-12-28 14:25:57
$dictionary['Case']['fields']['jjwg_maps_address_c']['inline_edit']=1;

 

 // created: 2017-12-28 14:25:57
$dictionary['Case']['fields']['jjwg_maps_geocode_status_c']['inline_edit']=1;

 

 // created: 2017-12-28 14:25:56
$dictionary['Case']['fields']['jjwg_maps_lat_c']['inline_edit']=1;

 

 // created: 2017-12-28 14:25:56
$dictionary['Case']['fields']['jjwg_maps_lng_c']['inline_edit']=1;

 

 // created: 2018-07-11 09:49:06
$dictionary['Case']['fields']['subclass_c']['inline_edit']='1';
$dictionary['Case']['fields']['subclass_c']['labelValue']='SubClass';

 

 // created: 2018-07-11 09:49:36
$dictionary['Case']['fields']['type']['len']=100;
$dictionary['Case']['fields']['type']['type']='dynamicenum';
$dictionary['Case']['fields']['type']['inline_edit']=true;
$dictionary['Case']['fields']['type']['massupdate']=0;
$dictionary['Case']['fields']['type']['options']='Quick_Description';
$dictionary['Case']['fields']['type']['help']='Select Description';
$dictionary['Case']['fields']['type']['merge_filter']='disabled';
$dictionary['Case']['fields']['type']['comments']='The type of issue (ex: issue, feature)';

 

 // created: 2018-07-11 11:00:59
$dictionary['Case']['fields']['user_id_c']['inline_edit']=1;

 
?>

This line is definitely what is causing your problem:

$dictionary['Case']['fields']['type']['type']='dynamicenum';

However the entire file might need to be reviewed/removed, not just that line. I am not sure what your requirements are, which custom fields you’re using in Cases, but check them if you can.

It seems you have a custom field called “type”, maybe that was possible at one time, but now I see a default field with that same name in my install, so I don’t think you can add a custom field with the same name.

HI,

I deleted the file and tried to run the upgrade, however, the file recreates itself while I do the upgrade and I’m getting the Database error.

Thank you

Hi,

Please see attached image, I think this is causing the issue?

The original file should be under custom/Extension/modules/Cases, that’s where you need to make changes so they are permanent.

The effects only become effective after a Quick Repair and Rebuild.

If you delete the entire file, some fields will disappear from your Cases module.

What should I change “Dynamicenum” to?

That’s not what you need to change, you need to change the field name.

So all lines that start with

$dictionary['Case']['fields']['type']

should change to something like

$dictionary['Case']['fields']['type_c']

Note that you should only change the “type” when it comes immediately after [fields], not the other. So you will have one line like this:

$dictionary['Case']['fields']['type_c']['type']='dynamicenum';

You will probably need to also change the column name in MySQL, to keep existing data in that field.

Be careful with these changes, if you can get help from someone more technical, please do. And make sure you have backups to go back in case you mess things up.

Ok, thank you very much for your help.