i have a content type on site 1 and on site 2. I made some minor changes to the type on site 1 as well as to the field collection which it used and figured it might be good to try wrapping all of this in to a feature to export over to site 2.

When i enabled the feature on site 2 it crashed with this error:

DatabaseSchemaObjectExistsException: Cannot add index <em class="placeholder">field_subsection_revision_id</em> to table <em class="placeholder">field_data_field_subsection</em>: index already exists. in DatabaseSchema_mysql->addIndex() (line 437 of /home/admin/public_html/sap/includes/database/mysql/schema.inc).

and i can no longer go to admin/modules page without getting this error.

this is more likely a D7 core bug (stupid exceptions all over the place which leave system in corrupted state) but it occurred from features so figured it made sense to post here.

my guess is the registry is corrupted but never been too sure how to fix this ("drush rr" rarely works correctly)

Comments

liquidcms’s picture

going to admin/structure/features also crashes with same error

liquidcms’s picture

fixed it by going in to db directly and removing the index from that table... actually what i had to do was remove it from the data table, then the revision table and then go back and remove it again from the data table.. ughhh

i think this is very similar to the core bug i posted here: #1551132: When trying to create a table that already exists but is empty, recreate the table rather than throwing a DatabaseSchemaObjectExistsException where D7 (and will continue with D8) where D7 has polluted the core code base with a bunch of ill-conceived exceptions causing code to bail in the middle of what it was doing when in most cases there is nothing wrong.. leaving the site corrupted.

liquidcms’s picture

Version: 7.x-2.0 » 7.x-2.0-rc3

sorry, i incorrectly posted wrong ver number.. i doubt this would be fixed though in 2.0, but have that now and will try again soon.

liquidcms’s picture

Version: 7.x-2.0-rc3 » 7.x-2.1
Priority: Major » Critical

just tried with Features 7.x-2.1 on a different site and same issue.

as this has pretty much corrupted my site i iwll change priority to Critical. To summarize, i enabled a Features module and i now get exception error on various pages:
- features admin
- db updates page
- module admin page
- etc

hefox’s picture

Version: 7.x-2.1 » 7.x-2.x-dev
Priority: Critical » Normal

I'm not sure what you're doing here that is causing this, but as I don't see any one else reporting this and never seen it myself bumping it down.

Are you changing the field type or such? If can't do something via core ui, can't do it via features -- e.g. change a field of type boolean to a field of type text. You mentioned field collection; could be something from them?

What was the diff between the features that caused the fatal?

hefox’s picture

Status: Active » Postponed (maintainer needs more info)

Need steps to reproduce on any site

hefox’s picture

Status: Postponed (maintainer needs more info) » Postponed

Postponed by #2270619: Updating field base even though there no changes; looks like it mentions the issue (index/revert) and fixing that will fix this

cjwest’s picture

subscribe

cjwest’s picture

Thanks liquidcms! Removing the index from both tables worked for me.