Support

Home Forums Event Espresso Premium Duplicate entry '0' for key 'PRIMARY'

Duplicate entry '0' for key 'PRIMARY'

Posted: February 11, 2021 at 7:20 am


isabelle.daigle

February 11, 2021 at 7:20 am

I got since the recent Update of my Event Espression this error :


[11-Feb-2021 14:13:10 UTC] Erreur de la base de données WordPress Duplicate entry '0' for key 'PRIMARY' pour la requête INSERT INTO
wp_esp_answer (REG_ID, QST_ID, ANS_value) VALUES (1977, 16, 'testtest+test912@gmail.com') faite par do_action('wp_ajax_nopriv_process_reg_step'), WP_Hook->do_action, WP_Hook->apply_filters, EED_Single_Page_Checkout::process_reg_step, EED_Single_Page_Checkout::process_ajax_request, EED_Single_Page_Checkout->_initialize, EED_Single_Page_Checkout->_process_form_action, EE_SPCO_Reg_Step_Attendee_Information->process_reg_step, EE_SPCO_Reg_Step_Attendee_Information->_process_registrations, EE_SPCO_Reg_Step_Attendee_Information->_save_registration_form_input, EE_Base_Class->save, EEM_Base->insert, EEM_Base->_insert_into_specific_table, EEM_Base->_do_wpdb_query, EEM_Base->_process_wpdb_query

[11-Feb-2021 14:13:11 UTC] PHP Notice: WPDB Erreur "Duplicate entry '0' for key 'PRIMARY'" tout en exécutant la méthode wpdb "insert" avec les arguments ["wp_esp_answer",{"REG_ID":1977,"QST_ID":16,"ANS_value":"testtest+test912@gmail.com"},["%d","%d","%s"]]. Tentative automatique de correction de EE Core DB. in /home/vialepol/public_html/wp-content/plugins/event-espresso-core-reg/core/db_models/EEM_Base.model.php on line 2387

[11-Feb-2021 14:13:11 UTC] Erreur de la base de données WordPress Duplicate entry '0' for key 'PRIMARY' pour la requête INSERT INTO wp_esp_answer (REG_ID, QST_ID, ANS_value) VALUES (1977, 16, 'testtest+test912@gmail.com') faite par do_action('wp_ajax_nopriv_process_reg_step'), WP_Hook->do_action, WP_Hook->apply_filters, EED_Single_Page_Checkout::process_reg_step, EED_Single_Page_Checkout::process_ajax_request, EED_Single_Page_Checkout->_initialize, EED_Single_Page_Checkout->_process_form_action, EE_SPCO_Reg_Step_Attendee_Information->process_reg_step, EE_SPCO_Reg_Step_Attendee_Information->_process_registrations, EE_SPCO_Reg_Step_Attendee_Information->_save_registration_form_input, EE_Base_Class->save, EEM_Base->insert, EEM_Base->_insert_into_specific_table, EEM_Base->_do_wpdb_query, EEM_Base->_process_wpdb_query, EEM_Base->_process_wpdb_query

[11-Feb-2021 14:13:11 UTC] PHP Notice: WPDB AGAIN: Erreur "Duplicate entry '0' for key 'PRIMARY'" tout en exécutant la même méthode et les mêmes arguments que précédemment. Tentative automatique de correction des EE Addons DB in /home/vialepol/public_html/wp-content/plugins/event-espresso-core-reg/core/db_models/EEM_Base.model.php on line 2387

[11-Feb-2021 14:13:11 UTC] Erreur de la base de données WordPress Duplicate entry '0' for key 'PRIMARY' pour la requête INSERT INTO wp_esp_answer (REG_ID, QST_ID, ANS_value) VALUES (1977, 16, 'testtest+test912@gmail.com') faite par do_action('wp_ajax_nopriv_process_reg_step'), WP_Hook->do_action, WP_Hook->apply_filters, EED_Single_Page_Checkout::process_reg_step, EED_Single_Page_Checkout::process_ajax_request, EED_Single_Page_Checkout->_initialize, EED_Single_Page_Checkout->_process_form_action, EE_SPCO_Reg_Step_Attendee_Information->process_reg_step, EE_SPCO_Reg_Step_Attendee_Information->_process_registrations, EE_SPCO_Reg_Step_Attendee_Information->_save_registration_form_input, EE_Base_Class->save, EEM_Base->insert, EEM_Base->_insert_into_specific_table, EEM_Base->_do_wpdb_query, EEM_Base->_process_wpdb_query, EEM_Base->_process_wpdb_query, EEM_Base->_process_wpdb_query

My User can not subcribe to our events. The cart was good, but when enter firtname and email and try to subcribe they have an error popup. When I check the log i saw this.

Wordpress : 5.6.1
Event Espressio : 4.10.10.p
PHP : 7.4.14


isabelle.daigle

February 11, 2021 at 7:22 am

I paste the error code here : https://pastebin.com/raw/5DFx2Qmt


isabelle.daigle

February 11, 2021 at 7:30 am

I juste found something interesting :

INSERT INTO wp_esp_answer (REG_ID, QST_ID, ANS_value) VALUES (1977, 16, 'testtest+test912@gmail.com')

When I check the SQL Table wp_esp_answer they have 4 fields : ANS_ID, REG_ID, QST_ID, ANS_value

So in the query missing one field, so they take the default value. But in our DB, the field ANS_ID do not have auto increment ID activated… I think it’s not normal right?


Tony

  • Support Staff

February 11, 2021 at 7:55 am

Hi there,

Did you create a backup of your database before updating?

Do you have access to phpMyAdmin or similar through your host?

It looks like your wp_esp_answer table either has corrupt data, or has been changed to no longer auto increment the primary key field and is defaulting to 0.


isabelle.daigle

February 11, 2021 at 8:07 am

Thank you Tony,

Yeah exactly I found they table either has corrupt data. So I check all WordPress Table and put the auto increment all where is needed.

I found the same way some corrupted data.

Thanks you again for your help! 🙂


Tony

  • Support Staff

February 11, 2021 at 1:31 pm

You’re most welcome, I’m glad you found the problem.

Any further issues just let us know 🙂

The support post ‘Duplicate entry '0' for key 'PRIMARY'’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso