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) »
  • 3.3 to 3.4 upgrade error: ALTER TABLE civicrm_entity_tag *Duplicate entry*
Pages: [1]

Author Topic: 3.3 to 3.4 upgrade error: ALTER TABLE civicrm_entity_tag *Duplicate entry*  (Read 854 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
3.3 to 3.4 upgrade error: ALTER TABLE civicrm_entity_tag *Duplicate entry*
August 14, 2011, 06:55:02 pm
Hey got a weird one here, and haven't seen this one before.  I could do the schema integrity but before I do that I wanted to check about duplicate entries, which may not be related to schema integrity.  Any ideas what to do here?  Can I remove some entries from this table to solve the problem?

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

    [code] => -5
    [message] => DB Error: already exists
    [mode] => 16
    [debug_info] => ALTER TABLE civicrm_entity_tag
ADD UNIQUE INDEX UI_entity_id_entity_table_tag_id( entity_table, entity_id, tag_id ) [nativecode=1062 ** Duplicate entry 'civicrm_contact-163-6' for key 'UI_entity_id_entity_table_tag_id']
    [type] => DB_Error
    [user_info] => ALTER TABLE civicrm_entity_tag
ADD UNIQUE INDEX UI_entity_id_entity_table_tag_id( entity_table, entity_id, tag_id ) [nativecode=1062 ** Duplicate entry 'civicrm_contact-163-6' for key 'UI_entity_id_entity_table_tag_id']
    [to_string] => [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="ALTER TABLE civicrm_entity_tag
ADD UNIQUE INDEX UI_entity_id_entity_table_tag_id( entity_table, entity_id, tag_id ) [nativecode=1062 ** Duplicate entry 'civicrm_contact-163-6' for key 'UI_entity_id_entity_table_tag_id']"]
)

Here is a sample of a few of the 580+ rows in the civicrm_entity_tag table.

Code: [Select]
+-----+-----------------+-----------+--------+
| id  | entity_table    | entity_id | tag_id |
+-----+-----------------+-----------+--------+
| 133 | civicrm_contact |       136 |      6 |
| 136 | civicrm_contact |       139 |      6 |
| 329 | civicrm_contact |      1361 |      6 |
+-----+-----------------+-----------+--------+
Try CiviTeacher: the online video tutorial CiviCRM learning library.

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: 3.3 to 3.4 upgrade error: ALTER TABLE civicrm_entity_tag *Duplicate entry*
August 17, 2011, 03:11:29 pm
Found the solution in this thread.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • 3.3 to 3.4 upgrade error: ALTER TABLE civicrm_entity_tag *Duplicate entry*

This forum was archived on 2017-11-26.