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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • deleted groups causing New Contact to fail
Pages: [1]

Author Topic: deleted groups causing New Contact to fail  (Read 605 times)

jalama

  • I post frequently
  • ***
  • Posts: 176
  • Karma: 22
    • Rooty Hollow LLC
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6 and 7
  • MySQL version: 5.1
  • PHP version: 5.2.5 and 5.3
deleted groups causing New Contact to fail
October 25, 2010, 07:42:12 am
In case someone else sees this error.

Error: Still don't know the cause but we were finding that we could not add new contact.  The error message debug info is below.   The error indicated that we were adding someone to a group that did not exist, which was true.  We have not enabled any of the Drupal integration modules (other forum posts indicate this caused similar issues for tother people). 

Solution:The only way to fix it was to create a new group, change it's id (in this case to 17) in the civicrm_group table.  We then disabled the group as it was useless.  All is well now

I looked all over the place in the db and couldn't find any place this group was referenced, celar the civicrm_cache table, etc...  All to no avail.


Code: [Select]


[debug_info] => INSERT INTO civicrm_subscription_history (contact_id , group_id , date , method , status ) VALUES ( 22753 ,  17 ,  20101025102116 , 'Admin' , 'Added' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`uhcanohi_civicrm/civicrm_subscription_history`, CONSTRAINT `FK_civicrm_subscription_history_group_id` FOREIGN KEY (`group_id`) REFERENCES `civicrm_group` (`id`) ON DELETE CASCADE)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_subscription_history (contact_id , group_id , date , method , status ) VALUES ( 22753 ,  17 ,  20101025102116 , 'Admin' , 'Added' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`uhcanohi_civicrm/civicrm_subscription_history`, CONSTRAINT `FK_civicrm_subscription_history_group_id` FOREIGN KEY (`group_id`) REFERENCES `civicrm_group` (`id`) ON DELETE CASCADE)]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_subscription_history (contact_id , group_id , date , method , status ) VALUES ( 22753 ,  17 ,  20101025102116 , 'Admin' , 'Added' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`uhcanohi_civicrm/civicrm_subscription_history`, CONSTRAINT `FK_civicrm_subscription_history_group_id` FOREIGN KEY (`group_id`) REFERENCES `civicrm_group` (`id`) ON DELETE CASCADE)]"]
)



http://www.rootyhollow.com

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: deleted groups causing New Contact to fail
October 26, 2010, 12:25:18 am
Weird !? But thanks for the info, I will keep a close watch on this. I seem to remember I saw an issue with the table civicrm_subscription_history, which to my knowledge is used to keep track of new and removed group members, and how they were added.
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • deleted groups causing New Contact to fail

This forum was archived on 2017-11-26.