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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • FK Constraint Error
Pages: [1]

Author Topic: FK Constraint Error  (Read 1070 times)

qjensen

  • I post frequently
  • ***
  • Posts: 141
  • Karma: 11
    • Scaled Solutions
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
FK Constraint Error
November 30, 2008, 05:23:48 am
I am trying to create my first organization in a new CiviCRM install, and I get the following error

Code: [Select]
INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' ,  2 , 'civicrm_contact,2' ,  102 ,  20081130070208 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`afccnet_civicrm/civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
It looks like CiviCRM is trying to update the log with the user id of the person that modified/created the record. The problem is the contacts database is empty. I am logged in as the Drupal admin, and I haven't created any contacts yet. Based on my understanding, I have to create an organization that contacts belong to, but I can't create the organization without a valid contact record.

Is there supposed to be a default contact in the database with id 102 to make this all work together?

TIA for any direction in solving this problem.
Q
Quint Jensen
Web Developer
Scaled Solutions
--" Remove the 'I want you to like me' notes from your forehead and place them where they truly will do the most good -- on your mirror!" Author Unknown

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: FK Constraint Error
November 30, 2008, 09:44:26 am
Quote
Is there supposed to be a default contact in the database with id 102 to make this all work together?
If you have loaded sample data yes, it will created first user with id 102.

Can you logout / login from your CMS and check if you still get same error ?

HTh
Kurund
Found this reply helpful? Support CiviCRM

qjensen

  • I post frequently
  • ***
  • Posts: 141
  • Karma: 11
    • Scaled Solutions
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: FK Constraint Error
December 01, 2008, 02:02:54 am
Thanks for the tip Kurund. I did load the sample data, then changed my mind and removed everything and started over. I guess I never logged out and logged back in after that and I had a cookie with the previous user id.
Quint Jensen
Web Developer
Scaled Solutions
--" Remove the 'I want you to like me' notes from your forehead and place them where they truly will do the most good -- on your mirror!" Author Unknown

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • FK Constraint Error

This forum was archived on 2017-11-26.