CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • DB Error: constraint violation
Pages: [1]

Author Topic: DB Error: constraint violation  (Read 2138 times)

kristin

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 3.3
  • CMS version: Joomla
  • MySQL version: ?
  • PHP version: ?
DB Error: constraint violation
February 03, 2011, 09:50:28 am
I am getting an error when testing our event registration pages. The error details are below.
Any suggestions anyone?  ???
Thanks in advance,
Kristin


Sorry. A non-recoverable error has occurred.
DB Error: constraint violation
Error Details
Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`kb4girls/civicrm_value_general_kb4girls_event_registrat_8`, CONSTRAINT `FK_civicrm_value_general_kb4girls_e_52303da88a81b12a` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_event` (`id`) ON DE), 1452
Additional Details:

Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_value_general_kb4girls_event_registrat_8  ( birth_date__age_59,emergency_contact_38,phone_number_of_emergency_contac_39,do_you_have_any_limiting_conditi_41,if_yes_please_explain_the_condit_42,do_you_agree_to_sign_the_liabili_40,entity_id ) VALUES ( '33','sky',0447442339,0,'',1,76 ) ON DUPLICATE KEY UPDATE birth_date__age_59 = '33',emergency_contact_38 = 'sky',phone_number_of_emergency_contac_39 = 0447442339,do_you_have_any_limiting_conditi_41 = 0,if_yes_please_explain_the_condit_42 = '',do_you_agree_to_sign_the_liabili_40 = 1 [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`kb4girls/civicrm_value_general_kb4girls_event_registrat_8`, CONSTRAINT `FK_civicrm_value_general_kb4girls_e_52303da88a81b12a` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_event` (`id`) ON DE)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_value_general_kb4girls_event_registrat_8  ( birth_date__age_59,emergency_contact_38,phone_number_of_emergency_contac_39,do_you_have_any_limiting_conditi_41,if_yes_please_explain_the_condit_42,do_you_agree_to_sign_the_liabili_40,entity_id ) VALUES ( '33','sky',0447442339,0,'',1,76 ) ON DUPLICATE KEY UPDATE birth_date__age_59 = '33',emergency_contact_38 = 'sky',phone_number_of_emergency_contac_39 = 0447442339,do_you_have_any_limiting_conditi_41 = 0,if_yes_please_explain_the_condit_42 = '',do_you_agree_to_sign_the_liabili_40 = 1 [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`kb4girls/civicrm_value_general_kb4girls_event_registrat_8`, CONSTRAINT `FK_civicrm_value_general_kb4girls_e_52303da88a81b12a` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_event` (`id`) ON DE)]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_value_general_kb4girls_event_registrat_8  ( birth_date__age_59,emergency_contact_38,phone_number_of_emergency_contac_39,do_you_have_any_limiting_conditi_41,if_yes_please_explain_the_condit_42,do_you_agree_to_sign_the_liabili_40,entity_id ) VALUES ( '33','sky',0447442339,0,'',1,76 ) ON DUPLICATE KEY UPDATE birth_date__age_59 = '33',emergency_contact_38 = 'sky',phone_number_of_emergency_contac_39 = 0447442339,do_you_have_any_limiting_conditi_41 = 0,if_yes_please_explain_the_condit_42 = '',do_you_agree_to_sign_the_liabili_40 = 1 [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`kb4girls/civicrm_value_general_kb4girls_event_registrat_8`, CONSTRAINT `FK_civicrm_value_general_kb4girls_e_52303da88a81b12a` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_event` (`id`) ON DE)]"]
)

Andrew Perry

  • I post occasionally
  • **
  • Posts: 98
  • Karma: 1
  • Building empowering tools that comply with rules
    • Community Builders Australia
  • CiviCRM version: 3.x, 4.x
  • CMS version: Joomla 1.0.x, 1.5.x -> Drupal 6.x, 7.x, WordPress
  • MySQL version: 5.1, 5.5, 5.6
  • PHP version: 5.2, 5.3, 5.4
Re: DB Error: constraint violation
February 03, 2011, 11:12:22 pm
Hi Kristin

Are you still having this problem or have you sorted it out?

Regards

Andrew
Community Builders Australia Pty Ltd
www.communitybuilders.com.au

penguintrax

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 2
  • CiviCRM version: 3.3x and 4.x depending on site
  • CMS version: Joomla 1.5 or 1.7 depending on site
  • MySQL version: 5.0.92-community
  • PHP version: 5.2.17
Re: DB Error: constraint violation
February 09, 2011, 01:06:14 pm
I'm having the same problem on my live registration page (test works fine). Below is the backtrace dump:

backTrace

/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Error.php, backtrace, 159
, handle,
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/PEAR.php, call_user_func, 931
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB.php, PEAR_Error, 968
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/PEAR.php, DB_Error, 564
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB/common.php, raiseError, 1903
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB/mysql.php, raiseError, 898
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB/mysql.php, mysqlRaiseError, 327
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB/common.php, simpleQuery, 1216
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB/DataObject.php, query, 2421
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB/DataObject.php, _query, 1607
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/DAO.php, query, 145
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/DAO.php, query, 868
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/BAO/CustomValueTable.php, executeQuery, 224
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/BAO/CustomValueTable.php, create, 322
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Contact/BAO/Contact.php, store, 376
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Contact/BAO/Contact.php, create, 1742
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Event/Form/Registration/Confirm.php, createProfileContact, 998
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Event/Form/Registration/Confirm.php, updateContactFields, 487
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Form.php, postProcess, 250
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/StateMachine.php, mainProcess, 167
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php, perform, 64
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Controller.php, perform, 203
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Page.php, handle, 103
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Controller.php, handle, 284
/home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php, run, 219
/home/famcafe/public_html/components/com_civicrm/civicrm.php, invoke, 81
/home/famcafe/public_html/components/com_civicrm/civicrm.php, civicrm_invoke, 24
/home/famcafe/public_html/libraries/joomla/application/component/helper.php, require_once, 162
/home/famcafe/public_html/includes/application.php, renderComponent, 124
/home/famcafe/public_html/index.php, dispatch, 68



Sorry. A non-recoverable error has occurred.


DB Error: constraint violation

Error Details
Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`famcafe_site/civicrm_value_conference_registration_extended_1`, CONSTRAINT `FK_civicrm_value_conference_registr_07e4b4ef6f334081` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_event` (`id`) O), 1452
Additional Details:

Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_value_conference_registration_extended_1  ( florida_county_31,demographic_information_1,if_you_answered_other_please_ent_2,language_21,primary_language__0ther__14,military_service2_22,military_component_27,do_you_have_a_family_member_enro_5,comm_25,other_communication_needs_7,i_or_a_member_of_my_family_am_ar_8,services2_23,volunteer_28,i_can_help_interpret_in_the_foll_29,financial_assistance_guidelines_12,entity_id ) VALUES ( 'Dade','White','','English','','','',null,'ASL','',null,'Children’s Mental Health','RegistrationRoom MonitorConference Bag Stuffing','','no aid requested',15 ) ON DUPLICATE KEY UPDATE florida_county_31 = 'Dade',demographic_information_1 = 'White',if_you_answered_other_please_ent_2 = '',language_21 = 'English',primary_language__0ther__14 = '',military_service2_22 = '',military_component_27 = '',do_you_have_a_family_member_enro_5 = null,comm_25 = 'ASL',other_communication_needs_7 = '',i_or_a_member_of_my_family_am_ar_8 = null,services2_23 = 'Children’s Mental Health',volunteer_28 = 'RegistrationRoom MonitorConference Bag Stuffing',i_can_help_interpret_in_the_foll_29 = '',financial_assistance_guidelines_12 = 'no aid requested' [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`famcafe_site/civicrm_value_conference_registration_extended_1`, CONSTRAINT `FK_civicrm_value_conference_registr_07e4b4ef6f334081` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_event` (`id`) O)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_value_conference_registration_extended_1  ( florida_county_31,demographic_information_1,if_you_answered_other_please_ent_2,language_21,primary_language__0ther__14,military_service2_22,military_component_27,do_you_have_a_family_member_enro_5,comm_25,other_communication_needs_7,i_or_a_member_of_my_family_am_ar_8,services2_23,volunteer_28,i_can_help_interpret_in_the_foll_29,financial_assistance_guidelines_12,entity_id ) VALUES ( 'Dade','White','','English','','','',null,'ASL','',null,'Children’s Mental Health','RegistrationRoom MonitorConference Bag Stuffing','','no aid requested',15 ) ON DUPLICATE KEY UPDATE florida_county_31 = 'Dade',demographic_information_1 = 'White',if_you_answered_other_please_ent_2 = '',language_21 = 'English',primary_language__0ther__14 = '',military_service2_22 = '',military_component_27 = '',do_you_have_a_family_member_enro_5 = null,comm_25 = 'ASL',other_communication_needs_7 = '',i_or_a_member_of_my_family_am_ar_8 = null,services2_23 = 'Children’s Mental Health',volunteer_28 = 'RegistrationRoom MonitorConference Bag Stuffing',i_can_help_interpret_in_the_foll_29 = '',financial_assistance_guidelines_12 = 'no aid requested' [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`famcafe_site/civicrm_value_conference_registration_extended_1`, CONSTRAINT `FK_civicrm_value_conference_registr_07e4b4ef6f334081` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_event` (`id`) O)]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_value_conference_registration_extended_1  ( florida_county_31,demographic_information_1,if_you_answered_other_please_ent_2,language_21,primary_language__0ther__14,military_service2_22,military_component_27,do_you_have_a_family_member_enro_5,comm_25,other_communication_needs_7,i_or_a_member_of_my_family_am_ar_8,services2_23,volunteer_28,i_can_help_interpret_in_the_foll_29,financial_assistance_guidelines_12,entity_id ) VALUES ( 'Dade','White','','English','','','',null,'ASL','',null,'Children’s Mental Health','RegistrationRoom MonitorConference Bag Stuffing','','no aid requested',15 ) ON DUPLICATE KEY UPDATE florida_county_31 = 'Dade',demographic_information_1 = 'White',if_you_answered_other_please_ent_2 = '',language_21 = 'English',primary_language__0ther__14 = '',military_service2_22 = '',military_component_27 = '',do_you_have_a_family_member_enro_5 = null,comm_25 = 'ASL',other_communication_needs_7 = '',i_or_a_member_of_my_family_am_ar_8 = null,services2_23 = 'Children’s Mental Health',volunteer_28 = 'RegistrationRoom MonitorConference Bag Stuffing',i_can_help_interpret_in_the_foll_29 = '',financial_assistance_guidelines_12 = 'no aid requested' [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`famcafe_site/civicrm_value_conference_registration_extended_1`, CONSTRAINT `FK_civicrm_value_conference_registr_07e4b4ef6f334081` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_event` (`id`) O)]"]
)


Return to home page.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • DB Error: constraint violation

This forum was archived on 2017-11-26.