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 Import (Moderator: Yashodha Chaku) »
  • Import Issue - pls help
Pages: [1]

Author Topic: Import Issue - pls help  (Read 926 times)

madeleod

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.1.0
  • CMS version: Joomla
  • MySQL version: 5.1.61
  • PHP version: 5.3.14
Import Issue - pls help
August 24, 2012, 05:36:46 am
Hello,
I am having a big issue on importing my data from csv to civicrm. I followed the process and after several times, be able to import 600 contacts on 850 from the file.
Probably because I am using a shared server, the next time I tried to import again, here is the message I received.


Base de donnée de code d'erreur: Cannot add or update a child row: a foreign key constraint fails (`databasename`.`civicrm_address`, CONSTRAINT `FK_civicrm_address_master_id` FOREIGN KEY (`master_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL), 1452
Détails additionnels:

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

       [  code ] => -3
       
[message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_address (contact_id , location_type_id , is_primary , is_billing , supplemental_address_1 , supplemental_address_2 , city , postal_code_suffix , postal_code , country_id , master_id ) VALUES ( 1576 ,  2 ,  1 ,  0 , 'adresse' , 'adresse-2' , 'ville' , 'CEDEX' , 'cpostal' ,  1076 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`databasename`.`civicrm_address`, CONSTRAINT `FK_civicrm_address_master_id` FOREIGN KEY (`master_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_address (contact_id , location_type_id , is_primary , is_billing , supplemental_address_1 , supplemental_address_2 , city , postal_code_suffix , postal_code , country_id , master_id ) VALUES ( 1576 ,  2 ,  1 ,  0 , 'Adresse' , 'adresse-2' , 'ville' , 'CEDEX' , 'codepostal' ,  1076 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`databasename`.`civicrm_address`, CONSTRAINT `FK_civicrm_address_master_id` FOREIGN KEY (`master_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_address (contact_id , location_type_id , is_primary , is_billing , supplemental_address_1 , supplemental_address_2 , city , postal_code_suffix , postal_code , country_id , master_id ) VALUES ( 1576 ,  2 ,  1 ,  0 , 'adresse' , 'adresse-2' , 'ville' , 'CEDEX' , 'codepostal' ,  1076 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`databasename`.`civicrm_address`, CONSTRAINT `FK_civicrm_address_master_id` FOREIGN KEY (`master_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]"]
)


I read a lot of posts about this error and was unable to solve it for me.
Is anyone can help me in an urgent way, that i wouldn't have to type the 200 names to build my database?
Thx in advance.
m.

madeleod

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.1.0
  • CMS version: Joomla
  • MySQL version: 5.1.61
  • PHP version: 5.3.14
Re: Import Issue - pls help
August 24, 2012, 07:39:07 am
Breaking News. I tried to import without the adress field and it works. Still donno why it doesn't work with. Any kind of begining of solution would be really appreciated.
Tks for reading.
m

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Import Issue - pls help
August 26, 2012, 06:36:31 am
It's hard to say. If you can make a copy of your CSV that is not confidential (change the details and use just a few rows) and you can recreate this error on the demo, then we can look into it.

It looks like it's trying to match an address, i.e. to share addresses, but the "master" address doesn't exist, but I'm not sure why it would do that.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Import Issue - pls help

This forum was archived on 2017-11-26.