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) »
  • Weird db error on importing contacts into 3.2
Pages: [1]

Author Topic: Weird db error on importing contacts into 3.2  (Read 1511 times)

berto.d.sera

  • Guest
Weird db error on importing contacts into 3.2
June 25, 2010, 01:18:27 am
Hi!

I just upgraded our 3.0 to 3.2, and since thus far we only keep contacts in it, I went the export/import way, instead of taking the longer route of a full upgrade. It worked in the past. However, it doesn't seem to work anymore.

I have two export files, one for individuals and another for organizations (we have no households in store). The both where produced by 3.0, the files appear regular when opened in OOo.

On importing the files I get:

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

    [code] => -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_acl_cache (contact_id , acl_id ) VALUES ( 1 ,  2 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm_3-2/civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_acl_cache (contact_id , acl_id ) VALUES ( 1 ,  2 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm_3-2/civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`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_acl_cache (contact_id , acl_id ) VALUES ( 1 ,  2 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm_3-2/civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"]
)

Any hint?[/code]

berto.d.sera

  • Guest
Re: Weird db error on importing contacts into 3.2
June 25, 2010, 01:46:48 am
As I just found out, this is more of a general problem. I seem to get this message wherever I go. I was able to configure localization, but I cannot even open Domain Information in the Configuration checklist.

FYI, I installed using the automated installer, the civicrm module was a fresh download (to avoid leftovers I tarred the old one and put it away).

berto.d.sera

  • Guest
Re: Weird db error on importing contacts into 3.2
June 25, 2010, 02:05:29 am
so, upon a closer inspection:
1) the contains a civicrm_import_job_904d69b0a47c415c72ffee50d056859a  table (and more similar tables) which appear to be tmp tables and contain the data I was trying to import. So, no apparent trouble in decoding the csv file.
2) civicrm_contact is empty, and this obviously makes the FK refuse the entry.

In short, there is probably some better way to track what is making the civicrm_contact insert fail, as civicrm_acl_cache failure is but the last ring in the chain and it can hardly show any problem at all. What do we do to backtrack this stuff?

berto.d.sera

  • Guest
Re: Weird db error on importing contacts into 3.2
June 25, 2010, 02:30:58 am
Adding the backtrack of what happens on opening the "Domain Information" page. Not that it says anything interesting.

Code: [Select]
backTrace

/home/aegir/drupal-6.17/sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 143
, handle,
/home/aegir/drupal-6.17/sites/all/modules/civicrm/packages/PEAR.php, call_user_func, 931
/home/aegir/drupal-6.17/sites/all/modules/civicrm/packages/DB.php, PEAR_Error, 966
/home/aegir/drupal-6.17/sites/all/modules/civicrm/packages/PEAR.php, DB_Error, 564
/home/aegir/drupal-6.17/sites/all/modules/civicrm/packages/DB/common.php, raiseError, 1903
/home/aegir/drupal-6.17/sites/all/modules/civicrm/packages/DB/mysql.php, raiseError, 898
/home/aegir/drupal-6.17/sites/all/modules/civicrm/packages/DB/mysql.php, mysqlRaiseError, 327
/home/aegir/drupal-6.17/sites/all/modules/civicrm/packages/DB/common.php, simpleQuery, 1216
/home/aegir/drupal-6.17/sites/all/modules/civicrm/packages/DB/DataObject.php, query, 2411
/home/aegir/drupal-6.17/sites/all/modules/civicrm/packages/DB/DataObject.php, _query, 1043
/home/aegir/drupal-6.17/sites/all/modules/civicrm/CRM/Core/DAO.php, insert, 280
/home/aegir/drupal-6.17/sites/all/modules/civicrm/CRM/ACL/BAO/Cache.php, save, 99
/home/aegir/drupal-6.17/sites/all/modules/civicrm/CRM/ACL/BAO/Cache.php, store, 64
/home/aegir/drupal-6.17/sites/all/modules/civicrm/CRM/ACL/BAO/ACL.php, build, 775
/home/aegir/drupal-6.17/sites/all/modules/civicrm/CRM/ACL/API.php, group, 139
/home/aegir/drupal-6.17/sites/all/modules/civicrm/CRM/Core/Permission.php, group, 143
/home/aegir/drupal-6.17/sites/all/modules/civicrm/CRM/Core/Permission.php, customGroup, 147
/home/aegir/drupal-6.17/sites/all/modules/civicrm/CRM/Core/BAO/CustomGroup.php, customGroupClause, 364
/home/aegir/drupal-6.17/sites/all/modules/civicrm/CRM/Contact/Form/Edit/Address.php, getTree, 185
/home/aegir/drupal-6.17/sites/all/modules/civicrm/CRM/Contact/Form/Location.php(111) : eval()'d code, buildQuickForm, 1
/home/aegir/drupal-6.17/sites/all/modules/civicrm/CRM/Contact/Form/Location.php, eval, 111
/home/aegir/drupal-6.17/sites/all/modules/civicrm/CRM/Contact/Form/Domain.php, buildQuickForm, 157
/home/aegir/drupal-6.17/sites/all/modules/civicrm/CRM/Core/Form.php, buildQuickForm, 326
/home/aegir/drupal-6.17/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php, buildForm, 99
/home/aegir/drupal-6.17/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php, perform, 203
/home/aegir/drupal-6.17/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php, handle, 103
/home/aegir/drupal-6.17/sites/all/modules/civicrm/CRM/Core/Controller.php, handle, 277
/home/aegir/drupal-6.17/sites/all/modules/civicrm/CRM/Utils/Wrapper.php, run, 115
/home/aegir/drupal-6.17/sites/all/modules/civicrm/CRM/Core/Invoke.php, run, 191
/home/aegir/drupal-6.17/sites/all/modules/civicrm/civicrm.module, invoke, 341
, civicrm_invoke,
/home/aegir/drupal-6.17/includes/menu.inc, call_user_func_array, 348
/home/aegir/drupal-6.17/index.php, menu_execute_active_handler, 18

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: Weird db error on importing contacts into 3.2
June 25, 2010, 03:10:08 am

seems like this is a session issue:

1. can you try logging out and logging back in

2. if the above does not work, can you truncate your drupal session table

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

berto.d.sera

  • Guest
Re: Weird db error on importing contacts into 3.2
June 25, 2010, 03:25:10 am
logging out solved it, thanks :)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Weird db error on importing contacts into 3.2

This forum was archived on 2017-11-26.