1

I am having an issue when trying import contacts into civi. We have imported many contacts before but all of the suddden I am getting this error:

Database Error Code: Duplicate entry '0385611' for key 'UI_external_identifier', 1062
Additional Details:
Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -5
    [message] => DB Error: already exists
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_contact (contact_type , contact_sub_type , do_not_email , do_not_phone , do_not_mail , do_not_sms , do_not_trade , is_opt_out , external_identifier , preferred_communication_method , preferred_language , hash , middle_name , email_greeting_id , postal_greeting_id , addressee_id ) VALUES ('Individual' , 'Applicant' ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , '0385611' , '' , 'en_US' , 'd2194546a08ba5d0bfd62d173aa2f933' , 'E' ,  1 ,  1 ,  1 )  [nativecode=1062 ** Duplicate entry '0385611' for key 'UI_external_identifier']
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_contact (contact_type , contact_sub_type , do_not_email , do_not_phone , do_not_mail , do_not_sms , do_not_trade , is_opt_out , external_identifier , preferred_communication_method , preferred_language , hash , middle_name , email_greeting_id , postal_greeting_id , addressee_id ) VALUES ('Individual' , 'Applicant' ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , '0385611' , '' , 'en_US' , 'd2194546a08ba5d0bfd62d173aa2f933' , 'E' ,  1 ,  1 ,  1 )  [nativecode=1062 ** Duplicate entry '0385611' for key 'UI_external_identifier']
    [to_string] => [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_contact (contact_type , contact_sub_type , do_not_email , do_not_phone , do_not_mail , do_not_sms , do_not_trade , is_opt_out , external_identifier , preferred_communication_method , preferred_language , hash , middle_name , email_greeting_id , postal_greeting_id , addressee_id ) VALUES ('Individual' , 'Applicant' ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , '0385611' , '' , 'en_US' , 'd2194546a08ba5d0bfd62d173aa2f933' , 'E' ,  1 ,  1 ,  1 )  [nativecode=1062 ** Duplicate entry '0385611' for key 'UI_external_identifier']"]
)

I have removed all but one contact from the import and still get the error. It seems as though it will not update a contact with the same external ID even though I have the rule setup to do just that.

Any suggestions?

Thank,

CiviCRM 4.7.3 on Drupal 7

  • Welcome to StackExchange! It would be helpful if you could edit your question to include your version of CiviCRM and the CMS you are using (e.g. Drupal, WordPress, Joomla). – William Mortada Feb 3 '17 at 13:20
  • Sorry forgot to add that info: The version is 4.7.3 and the cms is drupal 7. It appears that the duplicate matching is not working as it returns no matches even though there are some in there. – David Feb 3 '17 at 14:10
  • What is it that you are trying to do. Do you want to add another contact with the same external id? That is not possible because the external id must be unique. Or do you want to update a contact using the external id to find it? – Kainuk - CiviCooP Feb 3 '17 at 17:06
  • I am trying to update an existing contact with the same external id. This is how we have historically kept civicrm in sync with another company system. – David Feb 3 '17 at 18:49
  • I upgreaded to the most recent release and I am still receiving the error. I am not sure what broke the ability to update contacts via import, we used it allot in the past. – David Feb 3 '17 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.