Error Installing Version 5.0.2

Situation
OpenEMR setup starts fine, I enter all the information needed into the form, but once I save the database information and continue, I get an error (posted below, in the Logs section). I have tried changing the query, but then other problems arise. Help needed. Thanks in advance.

OpenEMR Version
I’m using OpenEMR version 5.0.2

Browser:
I’m using: Google Chrome

Operating System
I’m using: CPanel webhosting, Linux based, PHP 7.1, MySQL

Logs

ERROR. unable to execute SQL: 'CREATE TABLE `history_data` ( `id` bigint(20) NOT NULL auto_increment, `coffee` longtext, `tobacco` longtext, `alcohol` longtext, `sleep_patterns` longtext, `exercise_patterns` longtext, `seatbelt_use` longtext, `counseling` longtext, `hazardous_activities` longtext, `recreational_drugs` longtext, `last_breast_exam` varchar(255) default NULL, `last_mammogram` varchar(255) default NULL, `last_gynocological_exam` varchar(255) default NULL, `last_rectal_exam` varchar(255) default NULL, `last_prostate_exam` varchar(255) default NULL, `last_physical_exam` varchar(255) default NULL, `last_sigmoidoscopy_colonoscopy` varchar(255) default NULL, `last_ecg` varchar(255) default NULL, `last_cardiac_echo` varchar(255) default NULL, `last_retinal` varchar(255) default NULL, `last_fluvax` varchar(255) default NULL, `last_pneuvax` varchar(255) default NULL, `last_ldl` varchar(255) default NULL, `last_hemoglobin` varchar(255) default NULL, `last_psa` varchar(255) default NULL, `last_exam_results` varchar(255) default NULL, `history_mother` longtext, `dc_mother` text, `history_father` longtext, `dc_father` text, `history_siblings` longtext, `dc_siblings` text, `history_offspring` longtext, `dc_offspring` text, `history_spouse` longtext, `dc_spouse` text, `relatives_cancer` longtext, `relatives_tuberculosis` longtext, `relatives_diabetes` longtext, `relatives_high_blood_pressure` longtext, `relatives_heart_problems` longtext, `relatives_stroke` longtext, `relatives_epilepsy` longtext, `relatives_mental_illness` longtext, `relatives_suicide` longtext, `cataract_surgery` datetime default NULL, `tonsillectomy` datetime default NULL, `cholecystestomy` datetime default NULL, `heart_surgery` datetime default NULL, `hysterectomy` datetime default NULL, `hernia_repair` datetime default NULL, `hip_replacement` datetime default NULL, `knee_replacement` datetime default NULL, `appendectomy` datetime default NULL, `date` datetime default NULL, `pid` bigint(20) NOT NULL default '0', `name_1` varchar(255) default NULL, `value_1` varchar(255) default NULL, `name_2` varchar(255) default NULL, `value_2` varchar(255) default NULL, `additional_history` text, `exams` text, `usertext11` TEXT, `usertext12` varchar(255) NOT NULL DEFAULT '', `usertext13` varchar(255) NOT NULL DEFAULT '', `usertext14` varchar(255) NOT NULL DEFAULT '', `usertext15` varchar(255) NOT NULL DEFAULT '', `usertext16` varchar(255) NOT NULL DEFAULT '', `usertext17` varchar(255) NOT NULL DEFAULT '', `usertext18` varchar(255) NOT NULL DEFAULT '', `usertext19` varchar(255) NOT NULL DEFAULT '', `usertext20` varchar(255) NOT NULL DEFAULT '', `usertext21` varchar(255) NOT NULL DEFAULT '', `usertext22` varchar(255) NOT NULL DEFAULT '', `usertext23` varchar(255) NOT NULL DEFAULT '', `usertext24` varchar(255) NOT NULL DEFAULT '', `usertext25` varchar(255) NOT NULL DEFAULT '', `usertext26` varchar(255) NOT NULL DEFAULT '', `usertext27` varchar(255) NOT NULL DEFAULT '', `usertext28` varchar(255) NOT NULL DEFAULT '', `usertext29` varchar(255) NOT NULL DEFAULT '', `usertext30` varchar(255) NOT NULL DEFAULT '', `userdate11` date DEFAULT NULL, `userdate12` date DEFAULT NULL, `userdate13` date DEFAULT NULL, `userdate14` date DEFAULT NULL, `userdate15` date DEFAULT NULL, `userarea11` text, `userarea12` text, PRIMARY KEY (`id`), KEY `pid` (`pid`)) ENGINE=InnoDB AUTO_INCREMENT=1 ' due to: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.

That looks like the MariaDB rowsize error, doesn’t it?

oh yeah, like this mariadb fix by bradymiller · Pull Request #2628 · openemr/openemr · GitHub

hi @konsyr11 ,
Are you using mysql or mariadb? And what is the version of mysql/mariadb that you are using?
-brady

Hello, first of all thank you so much for replying. I will keep the topic here and close my GitHub issue. @brady.miller from phpmyadmin database server details: 10.3.18-MariaDB - MariaDB Server
Is there a particular fix/patch I can apply?

Hi @konsyr11 ,

The new versions of mariadb for 10.1/10.2/10.3 broke OpenEMR because of the following mariadb issue:
"
Prior to MariaDB 10.2.26, 10.3.17, and 10.4.7, MariaDB didn’t properly calculate the row sizes while executing DDL, so “unsafe” tables could be created, even with innodb_strict_mode=ON set. This was fixed by MDEV-19292. As a side effect, tables that could be created in previous versions may get rejected after the latest releases.
"

We have fixed this and plan to release the patch and new packages in several days. If you can’t wait until then, let us know since there are other ways to get most recent version of 5.0.2 (note this won’t get the testing that the patches or new packages will be getting).

-brady

by the way, here’s the fix:

@brady.miller so I just need to get the files from “Files Changed” and replace the original ones with them?? And if not, I am interested in getting the patched beta. Nasty issue…
This is my OpenEMR/sql directory:


Apart from replacing database.sql and 5_0_1-to-5_0_2_upgrade.sql, do I need to do anything about 5_0_2-to-5_0_3_upgrade.sql??

Hi @konsyr11 ,

Since this affects install(and don’t have a patch zip yet), you need a updated package. You can download a daily build for the rel-502 branch here, which is most recent 5.0.2 and is fixed (note would consider it beta sortish):
https://seven.openemr.io/e/files/openemr-cvs.tar.gz
https://seven.openemr.io/e/files/openemr-cvs.zip

-brady

Great, will let you know if everything is correct. I will close the issue too.

@brady.miller same thing…
ERROR. unable to execute SQL: 'CREATE TABLE `history_data` ( `id` bigint(20) NOT NULL auto_increment, `coffee` longtext, `tobacco` longtext, `alcohol` longtext, `sleep_patterns` longtext, `exercise_patterns` longtext, `seatbelt_use` longtext, `counseling` longtext, `hazardous_activities` longtext, `recreational_drugs` longtext, `last_breast_exam` varchar(255) default NULL, `last_mammogram` varchar(255) default NULL, `last_gynocological_exam` varchar(255) default NULL, `last_rectal_exam` varchar(255) default NULL, `last_prostate_exam` varchar(255) default NULL, `last_physical_exam` varchar(255) default NULL, `last_sigmoidoscopy_colonoscopy` varchar(255) default NULL, `last_ecg` varchar(255) default NULL, `last_cardiac_echo` varchar(255) default NULL, `last_retinal` varchar(255) default NULL, `last_fluvax` varchar(255) default NULL, `last_pneuvax` varchar(255) default NULL, `last_ldl` varchar(255) default NULL, `last_hemoglobin` varchar(255) default NULL, `last_psa` varchar(255) default NULL, `last_exam_results` varchar(255) default NULL, `history_mother` longtext, `dc_mother` text, `history_father` longtext, `dc_father` text, `history_siblings` longtext, `dc_siblings` text, `history_offspring` longtext, `dc_offspring` text, `history_spouse` longtext, `dc_spouse` text, `relatives_cancer` longtext, `relatives_tuberculosis` longtext, `relatives_diabetes` longtext, `relatives_high_blood_pressure` longtext, `relatives_heart_problems` longtext, `relatives_stroke` longtext, `relatives_epilepsy` longtext, `relatives_mental_illness` longtext, `relatives_suicide` longtext, `cataract_surgery` datetime default NULL, `tonsillectomy` datetime default NULL, `cholecystestomy` datetime default NULL, `heart_surgery` datetime default NULL, `hysterectomy` datetime default NULL, `hernia_repair` datetime default NULL, `hip_replacement` datetime default NULL, `knee_replacement` datetime default NULL, `appendectomy` datetime default NULL, `date` datetime default NULL, `pid` bigint(20) NOT NULL default '0', `name_1` varchar(255) default NULL, `value_1` varchar(255) default NULL, `name_2` varchar(255) default NULL, `value_2` varchar(255) default NULL, `additional_history` text, `exams` text, `usertext11` TEXT, `usertext12` varchar(255) NOT NULL DEFAULT '', `usertext13` varchar(255) NOT NULL DEFAULT '', `usertext14` varchar(255) NOT NULL DEFAULT '', `usertext15` varchar(255) NOT NULL DEFAULT '', `usertext16` varchar(255) NOT NULL DEFAULT '', `usertext17` varchar(255) NOT NULL DEFAULT '', `usertext18` varchar(255) NOT NULL DEFAULT '', `usertext19` varchar(255) NOT NULL DEFAULT '', `usertext20` varchar(255) NOT NULL DEFAULT '', `usertext21` varchar(255) NOT NULL DEFAULT '', `usertext22` varchar(255) NOT NULL DEFAULT '', `usertext23` varchar(255) NOT NULL DEFAULT '', `usertext24` varchar(255) NOT NULL DEFAULT '', `usertext25` varchar(255) NOT NULL DEFAULT '', `usertext26` varchar(255) NOT NULL DEFAULT '', `usertext27` varchar(255) NOT NULL DEFAULT '', `usertext28` varchar(255) NOT NULL DEFAULT '', `usertext29` varchar(255) NOT NULL DEFAULT '', `usertext30` varchar(255) NOT NULL DEFAULT '', `userdate11` date DEFAULT NULL, `userdate12` date DEFAULT NULL, `userdate13` date DEFAULT NULL, `userdate14` date DEFAULT NULL, `userdate15` date DEFAULT NULL, `userarea11` text, `userarea12` text, PRIMARY KEY (`id`), KEY `pid` (`pid`)) ENGINE=InnoDB AUTO_INCREMENT=1 ' due to: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.

something went wrong with the code quote, sorry for the flooding

Also, if it helps, the Installer manages to create 50 tables in the database

hi @konsyr11 ,
That history_data is a different table than what was breaking previously in mariadb 10.3.17, which is what was fixed (form_eye_neuro table). I’ll test 10.3.18 tonight and see if I can duplicate your error.
-brady

Also,
Are you creating the database before you run the install? If so, what encoding are you using?

The databases can only be created by my web host. I can check the encoding, but I am not sure I will be able to change it.

@brady.miller
Server charset: UTF-8 Unicode (utf8)
Server Connection Collation: utf8mb4_unicode_ci

hi @konsyr11 ,
I tested to work ok on mariadb 10.3.18. You need to use utf8_general_ci collation when you create the database. The utf8mb4_unicode_ci will take up more space, which is why it breaks history_data table. In the future, it would be good if somebody took the task to ensure mb4 support in OpenEMR, but I’m guessing that’s likely not gonna happen anytime soon.

1 Like

Will test it now, thank you.

@brady.miller I changed it, still same error…