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) »
  • Log in error and civi admin menu error
Pages: [1]

Author Topic: Log in error and civi admin menu error  (Read 2385 times)

gracea

  • Guest
Log in error and civi admin menu error
May 09, 2007, 09:21:59 pm
Help,

I suddenly cannot log into my site with my admin username and password through the log-in menu.  (i did just recently install smfforum and am now using that login menu - however i have had no problem logging in through it in the last few days).

I receive the following error:

Code: [Select]
Array
(
    [callback] => Array
      (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_contact (domain_id , contact_type , sort_name , display_name , preferred_communication_method , hash ) VALUES ( 0 , 'Individual' , 'gracearoha@auroville.org.in' , 'gracearoha@auroville.org.in' , '' , '75522cb070f76bfd31a708891fffd13e' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`25_civicrm-new/civicrm_contact`, CONSTRAINT `civicrm_contact_ibfk_1` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`))]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_contact (domain_id , contact_type , sort_name , display_name , preferred_communication_method , hash ) VALUES ( 0 , 'Individual' , 'gracearoha@auroville.org.in' , 'gracearoha@auroville.org.in' , '' , '75522cb070f76bfd31a708891fffd13e' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`25_civicrm-new/civicrm_contact`, CONSTRAINT `civicrm_contact_ibfk_1` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`))]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_contact (domain_id , contact_type , sort_name , display_name , preferred_communication_method , hash ) VALUES ( 0 , 'Individual' , 'gracearoha@auroville.org.in' , 'gracearoha@auroville.org.in' , '' , '75522cb070f76bfd31a708891fffd13e' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`25_civicrm-new/civicrm_contact`, CONSTRAINT `civicrm_contact_ibfk_1` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`))]"]
)

I can log in through the browser by going to site.com/user.

I noticed that the contact that is referred to in the above error shares the same e-mail address as the admin, but does not show up as a user in Drupal.  So i tried to delete this record from the database, but i receive the following error:

#1451 - Cannot delete or update a parent row: a foreign key constraint fails (`25_civicrm-new/civicrm_subscription_history`, CONSTRAINT `civicrm_subscription_history_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`))

Then when i try to go into the civicrm admin menu, i receive the following error:

Sorry. A non-recoverable error has occurred.
Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`25_civicrm-new/civicrm_contact`, CONSTRAINT `civicrm_contact_ibfk_1` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`)), 1452
(with the same details as the above error)


i am running civicrm 1.6 and Drupal 1.5 and have been running both for several months without this error.

Any ideas? [/code]

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Log in error and civi admin menu error
May 09, 2007, 09:47:49 pm

grace,

the mysql statement shows the insert happening with a domain_id of 0, and hence the FK error

can u check your civicrm.settings.php file and ensure that this statement is there

define('CIVICRM_DOMAIN_ID' , 1 );

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

gracea

  • Guest
Re: Log in error and civi admin menu error
May 09, 2007, 10:17:14 pm
Ah,
That did the trick.

Thank you!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Log in error and civi admin menu error

This forum was archived on 2017-11-26.