I am trying to install a feature on an existing site with that already has some of the same field names (field_image for example), and I get the following error:

FieldException: Cannot change an existing field's type. in field_update_field() (line 230 of /var/aegir/platforms/dcpl-drupal7/modules/field/field.crud.inc).

This is related to #1058902: Error when enabling Debut Article, where they recommended:

This bug can be fixed following an approach used in media_gallery.install, which detects existing fields and throws a hook_requirements() error if there's an existing field with the same name but a different type. Arguably this should go in features, but a workaround in debut_article and other debut features meanwhile is important.



I'm experiencing the same issue, and I wonder why this shouldn't be allowed. I'm trying to update a file field to an image field using Features. The change really is minimal, but as the comment in field.crud.inc says around line 230: "// Some updates are always disallowed." Why exactly is Drupal core specifically disallowing us from doing this?

Should we move this issue to Drupal core?

Core disables changing an existing field's type because changing the field type possibly means changing the data schema ('columns'). Changing field type is considered a data migration topic, and left for contrib to handle - it was out of scope of the Field API D7, as it was out of scope of CCK D6.

In terms of Features, though, I guess Features could handle deletion / recreation of a new field with the same name - that means the loss of field values, though.

I don't think deletion/recreation is the way to go (and I don't think loss of field values is acceptable). My use-case was a move from filefield to imagefield which isn't so drastic.

Given this information, I'm inclined to mark this as "Won't fix".

We ran into this problem when changing a field type from text to text_long, which took down our QA server until I figured out what happened. Would be nice if features gave a warning about this before drush fu is run (ie. danger will robinson, you have changed a field type, are you sure you want to proceed?).

Hm, my guess is ideal here would be for features to prevent enabling of the module, and for another contrib module to handle converting the fields (so then the feature could be enabled). Or tell user that that field needs to be deleted.

Same problem here. Is the only option to completely wipe the database and reinstall from scratch? Or are there some shortcuts such as deleting certain tables/rows from the database that would provide a temporary workaround?

There's possibly a related topic in #1664160: Catch field exception when rebuilding (esp. in regards to DB column change). The stopgap was for Features to catch the FieldUpdateException and log the error. Of course, the problem is magnified in Drush.

I got this error and I went through and deleted all the content types (via the Drupal UI) and then the error went away (all content types were in a Feature so I didn't lose anything).

Patch #2 is definitely at least helpful in finding the problem. Before I applied the patch to my installation I didn't even know which field was causing the issue. I previously fixed the problem by deleting the content types and letting Features recreate them (like #10 did), but that didn't seem like a good option long term. Fast forward a few weeks when people are starting to use the system. The problem reared it's head again after a botched update, and it feels like even less of an option now :-p Patch #2 at least got the site running past the error so I could see what Features is doing and know which field is having issues. However, the message is only logged to the watchdog, and no error is displayed. Not sure how I feel about that.

I don't think the field in question actually changed types either (I haven't modified this field for a few weeks), so I think there's something else at play. This is my first time using Features, so I'm not sure how well I'll be able to pinpoint the issue. Harumph, just reverted the components of the Feature and everything is working fine now…