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 »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • DB Error: already exists
Pages: [1]

Author Topic: DB Error: already exists  (Read 1168 times)

SPM

  • I’m new here
  • *
  • Posts: 18
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: Drupal 7
  • MySQL version: 5.1.61
  • PHP version: 5.3.3
DB Error: already exists
June 24, 2014, 09:24:21 am
I am uploading relationship data for contacts on a new install of Civi (v4.4.5) and Drupal 7.28

I created and sucessfully tested a small batch to update existing contacts. However when I went to upload the main batch I received the following message just after clicking to upload -

"Sorry but we are not able to provide this at the moment. DB Error: already exists"

Any ideas please. The test batch worked so the mapping is correct.

Thank you.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: DB Error: already exists
June 24, 2014, 11:26:00 am
Can you enable debugging and then post the full error message?
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.

SPM

  • I’m new here
  • *
  • Posts: 18
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: Drupal 7
  • MySQL version: 5.1.61
  • PHP version: 5.3.3
Re: DB Error: already exists
June 25, 2014, 04:24:56 am
here it is!

Thank you for your help.

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

       
Code: [Select]
=> -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_language , hash , email_greeting_id , postal_greeting_id , addressee_id ) VALUES ('Individual' ,  NULL ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , '21' , 'en_US' , '5ac1f8cba717ed527a73f3a5da78e2ad' ,  1 ,  1 ,  1 )  [nativecode=1062 ** Duplicate entry '21' 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_language , hash , email_greeting_id , postal_greeting_id , addressee_id ) VALUES ('Individual' ,  NULL ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , '21' , 'en_US' , '5ac1f8cba717ed527a73f3a5da78e2ad' ,  1 ,  1 ,  1 )  [nativecode=1062 ** Duplicate entry '21' 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_language , hash , email_greeting_id , postal_greeting_id , addressee_id ) VALUES ('Individual' ,  NULL ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , '21' , 'en_US' , '5ac1f8cba717ed527a73f3a5da78e2ad' ,  1 ,  1 ,  1 )  [nativecode=1062 ** Duplicate entry '21' for key 'UI_external_identifier']"]
)

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: DB Error: already exists
June 25, 2014, 07:32:32 am
Seems that the issue is a repeated value for "external_identifier"

Seems you have the external ID 21 already in your database and also in your import batch.
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 »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • DB Error: already exists

This forum was archived on 2017-11-26.