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 »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Syncronize Users Fatal Error
Pages: [1]

Author Topic: Syncronize Users Fatal Error  (Read 3889 times)

kwixson

  • Guest
Syncronize Users Fatal Error
August 16, 2007, 10:07:25 pm
Issue similar to http://forum.civicrm.org/index.php/topic,378.msg2274/topicseen.html#msg2274

After deleting, reinitializing db and deleting and reloading 1.8 and 1.7, syncronize users gives this error:

Code: [Select]
Synchronize Users-to-Contacts

unrecoverable error
    Sorry. A non-recoverable error has occurred.

    Return to CiviCRM menu.

Error Details:

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

    [code] => -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_log (entity_table , entity_id , modified_id , modified_date ) VALUES ('civicrm_contact' , 2 , 102 , 20070816223954 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`asmcivicrm/civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`))]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_log (entity_table , entity_id , modified_id , modified_date ) VALUES ('civicrm_contact' , 2 , 102 , 20070816223954 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`asmcivicrm/civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`))]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_log (entity_table , entity_id , modified_id , modified_date ) VALUES ('civicrm_contact' , 2 , 102 , 20070816223954 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`asmcivicrm/civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`))]"]
)

I had messed up my initial install, which had worked properly, and clumsily dropped all the tables from the db -- without first unchecking the module, by the way. Then deleted the CiviCRM module files, then deleted the module's entry from the system table of Drupal. Reuploaded the files (this time version 1.8, where 1.7 was previously installed.) Then reinitialized database. At which point, the synchronize command first generated this kind of error. Then, seeing other things not work, either, repeated removal steps above except for the system table modification but with disabling the module first. Then uploaded 1.7 again and reinitialized the db. Now getting the error above.

Noticed another issue similar to this one, close because it couldn't be verified. Am using Drupal 5, PHP 5, MySQL 5.

What can I do to clean up and fix this mess?[/code]

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: Syncronize Users Fatal Error
August 17, 2007, 12:21:38 am
just to keep track, issue filed in jira for this: http://issues.civicrm.org/jira/browse/CRM-2206
Found this reply helpful? Support CiviCRM

Capnj

  • Guest
Re: Syncronize Users Fatal Error
August 21, 2007, 12:49:43 pm
Similar, but here are my details. This is a system with the latest 1.8 stable version.  Drupal is 5.2 running on a PHP5/MySQL5 system.  The database started life in the pre version 1 era and has been updated along the way. I am logged in as Drupal user 1.

gil

Error Details:

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

       
Code: [Select]
=> -24
    [message] => DB Error: connect failed
    [mode] => 16
    [debug_info] =>  [DB Error: connect failed]
    [type] => DB_Error
    [user_info] =>  [DB Error: connect failed]
    [to_string] => [db_error: message="DB Error: connect failed" code=-24 mode=callback callback=CRM_Core_Error::handle prefix="" info=" [DB Error: connect failed]"]
)
« Last Edit: August 21, 2007, 12:52:52 pm by Capnj »

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Syncronize Users Fatal Error
August 21, 2007, 01:50:48 pm
Since the error means "can't connect to the database" - my first thought is that the values in civicrm.settings.php for connecting to your Drupal DB are incorrect. Check CIVICRM_UF_DSN.
Protect your investment in CiviCRM by  becoming a Member!

Capnj

  • Guest
Re: Syncronize Users Fatal Error
August 22, 2007, 04:02:21 pm
Quote from: Dave Greenberg on August 21, 2007, 01:50:48 pm
Since the error means "can't connect to the database" - my first thought is that the values in civicrm.settings.php for connecting to your Drupal DB are incorrect. Check CIVICRM_UF_DSN.

That is certainly the obvious place to look, but I've checked and re-checked.  And the rest of the functions work so obviously the system is finding the Drupal DB.

gil

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: Syncronize Users Fatal Error
August 22, 2007, 04:18:03 pm

This is one of the two places where we use the UF_DSN (the other place is when we update the primary email of a contact). So a working system does not mean this value is right :(

If you are convinced this value is right, please check:

CRM/Core/BAO/CMSUser.php

and add appropriate debug statements in that file (and packages/DB.php) to get a better idea on why PHP is complaining that it cannot connect to the database.

Please avoid filing issues on the issue tracker till we have more complete information on a bug

thanx

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Syncronize Users Fatal Error

This forum was archived on 2017-11-26.