Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Running update.php on 7.x-1.1+65-dev from 7.x-1.0 fails at update #7004 with:
field_group module
Update #7004
Failed: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'group_attachments|node|page|form' for key 'identifier': ALTER TABLE {field_group} ADD UNIQUE KEY `identifier` (`identifier`); Array ( ) in db_add_unique_key() (line 2886 of /var/www/cmog/drupal/includes/database/database.inc).
Comments
Comment #1
alanburke CreditAttribution: alanburke commentedRun update 7003 again - did the trick for me
Comment #2
drupal a11y CreditAttribution: drupal a11y commentedGet the same issue:
result:
How do I run the Update #7003 again?
Comment #3
Patribus CreditAttribution: Patribus commentedHow can one carry out earlier updates?
I'm stucked with the
updates, since after installing the module, no tables were created in my DB (see here)
MAybe, if I install an earlier version, this would work, no?
I really do not know how to create the missing module tables...
CHeers
Comment #4
Patribus CreditAttribution: Patribus commentedwell, here a comment about my problem http://drupal.org/node/1966064#comment-7417968, it apparently does not have anything to do with the module itself but with some problems in ma drupal installation.
Cheers
Comment #5
gnite CreditAttribution: gnite commentedI have had the same issue and I found that I had in the field_group table entries with an empty identifier, must have been from before upgrading D6>D7 or something. Obviously, since this update is trying to make the identifier column a unique index, there can't be multiple entries with the same (empty) value. Deleting them solved the issue.
Comment #6
nils.destoop CreditAttribution: nils.destoop commentedIf you really have a duplicate record group_attachments|node|page|form. Then this should be fixed in the database. One of the records should be removed manually in the database. Running 7003 again won't help with that issue.
Comment #7
brian_c CreditAttribution: brian_c commentedI had this error when attempting to upgrade field_group from 1.0-rc2 to 1.2... the identifier field was completely empty, leading to an error when trying to add it as a unique index. This had the effect of killing all my field groups.
Upgrading in two steps, first from 1.0-rc2 to 1.0, and then from 1.0 to 1.2, fixed the issue.
Comment #8
Input CreditAttribution: Input commentedHad the same error/warning when updating to 7.x-1.2
Looked into field_groups table an renamed all duplicate groups (name and identifier part) and then deleted them within content type setup.
I think this happend because i used a dev version a while ago. At least the IDs of the duplicate group entries where far apart newer groups. So i think it was because of an version-change or because i deleted these groups earlier and recreated them a while ago with same names
Since the name or id wasn't used anywhere else renaming worked and you look inside contet-structure which group is still beeing used. The others just appear on the bottom of the list and can be deleted.
Maybe a solution is to programmatically check and rename duplicate groupnames during update procedure and give a warning that you should look into your content-types for groups with no children?
Comment #9
nils.destoop CreditAttribution: nils.destoop commentedDid all of you did the D6 > D7 upgrade? Seems like there was an issue in it, that can cause duplicate records: #1804840: Duplicate Group Names Cause D6->D7 Problem
Comment #10
markie CreditAttribution: markie commentedI ran into this issue and it seems that my field group was being duplicated in my display. Both were named group_meta. I created a second group (in my fields), and named it group_meta2. Moved the fields into the new group and then deleted the old group. The group in my display was still present, and so I deleted group_meta out of my fields listing. Then I was able to run the updates.
Comment #11
mbqt CreditAttribution: mbqt commentedI also met the same problem,
Field Group Update on 7.x-1.1 to 7.x-1.2 And 7.x-1.1 to 7.x-1.3
Running update.php Error:
Comment #12
technotronic12 CreditAttribution: technotronic12 commentedHave same error on update from 1.1 to 1.3. Anyone found cause or solution?
Iv'e managed to see the duplicate values for identifier field by running this query:
SELECT * FROM `field_group` WHERE identifier in (Select identifier from `field_group` group by identifier having count(*) > 1 order by identifier)
Deleting the duplicate records didn't work, had to go back to older module version and recover the database.
Comment #13
bdimaggioHey all -- alanburke's solution worked for me too. (Thanks alanburke!) Here's a quick and dirty way to do it:
1. Download/install devel module.
2. Go to the newly available /devel/php
3. In the resulting textarea, php-include the install file for Field Group, then manually call field_group_update_7003(). I.e.:
4. Run the code there, then go back and run the database install process again. Should work this time!
Comment #14
Sutharsan CreditAttribution: Sutharsan commentedAnother dirty way to re-run the '7003' update script:
update system set schema_version = '7002' where name = 'field_group';
Comment #15
boyan.borisov CreditAttribution: boyan.borisov commentedI submitted patch here which should handle these cases, too
Comment #16
nils.destoop CreditAttribution: nils.destoop commentedTat patch should idd fix this. Marking as duplicate.