Cant install forms DB

Situation

Trying to install CAMOS DB in forms and i get this error, also happens in other DB as well.

Query Error
ERROR: query failed: INSERT INTO form_CAMOS_category VALUES (1,NULL,NULL,NULL,NULL,NULL,NULL,‘prescriptions’)

Error: Duplicate entry ‘1’ for key ‘PRIMARY’

D:\xampp\htdocs\openemr\library\registry.inc at 92:sqlStatement
D:\xampp\htdocs\openemr\interface\forms_admin\forms_admin.php at 33:installSQL(D:/xampp/htdocs/openemr/library/…/interface/forms/CAMOS)

OpenEMR Version
I’m using OpenEMR version

Browser:
I’m using:

Operating System
I’m using: Windows 10, fresh install

Logs
Did you check the logs? Was there anything pertinent in them? Paste them here (surround with three backticks (```) for readability

@mohamed,

Data for the Primary key is duplicate therefore its giving the error please check data for primary key.

Thanks,
Nilesh

1 Like

@Nilesh_Hake,

And how may i ask to check primary key. New to openemr.

Just upgraded to 6.0. Still can’t resolve this error, hope anyone can help.

Hi @mohamed
Looks like the form has been install in the past at some point.

You need to check your database for tables with name starting with form_CAMOS…
There are four I believe. If they exist then you can drop them and then run form install again to get it registered.

I worry they may be populated with prior history so ensure this feature has not been used but lost in the past. Check with all your providers before any deletes.

note: or you may just truncate all the form_CAMOS_category… tables and install form. this is a better route to take imo

1 Like

Hi @sjpadgett
Thanks for your reply

I entered phpmyadmin and searched openemr structure for camos, and then dropped the four tables in the operation option. Then used Administration>Forms to install the database again. Still no luck.

Query Error
ERROR: query failed: INSERT INTO form_CAMOS_category VALUES (1,NULL,NULL,NULL,NULL,NULL,NULL,‘prescriptions’)

Error: Duplicate entry ‘1’ for key ‘PRIMARY’

D:\xampp\htdocs\openemr\library\registry.inc at 96:sqlStatement
D:\xampp\htdocs\openemr\interface\forms_admin\forms_admin.php at 34:installSQL(D:/xampp/htdocs/openemr/library/…/interface/forms/CAMOS)

Still cant install CAMOS, any help would be appreciated

Finally i managed to solve the error. What i did was i changed the max execution time, post max size, and max input time in the php.ini file. As well as changing the value for $cfg[‘ExecTimeLimit’] to 0 instead of 300 in “\xampp\phpMyAdmin\libraries\config.default.php” (change path according to your installation).

After that I followed the instructions by @sjpadgett
Navigated to phpmyadmin page (I am using XAMPP on Windows 10)
Selected openemr database
In the search box i wrote “form_CAMOS”
And clicked on each one (there are 4 of them) and did the following:
Operations> Empty the table (TRUNCATE)>OK
Then went back to Openemr. And navigated to: Administration> Forms> Forms Administration > CAMOS and installed database and then enabled and finally it worked !!

Obviously i don’t know what i am doing so use this guide with caution

1 Like