Cannot change an existing field's type. in field_update_field() line 240 of field.crud.inc My instance of drupal is throwing an error. The file that is throwing the error is modules/field/field.crud.inc

The error is


  FieldException: Cannot change an existing field's type. in field_update_field() (line 240 of modules/field/field.crud.inc).


A local var dump displays the following results.

Variable $field

array (
  'active' =&gt; 1,
  'cardinality' =&gt; 1,
  'deleted' =&gt; 0,
  'entity_types' =&gt; 
  array (
  ),
  'field_name' =&gt; 'field_address',
  'foreign keys' =&gt; 
  array (
    'format' =&gt; 
    array (
      'columns' =&gt; 
      array (
        'format' =&gt; 'format',
      ),
      'table' =&gt; 'filter_format',
    ),
  ),
  'indexes' =&gt; 
  array (
    'format' =&gt; 
    array (
      0 =&gt; 'format',
    ),
  ),
  'locked' =&gt; 0,
  'module' =&gt; 'text',
  'settings' =&gt; 
  array (
    'max_length' =&gt; 255,
  ),
  'translatable' =&gt; 0,
  'type' =&gt; 'text',
)


Variable $prior_field

array (
  'translatable' =&gt; '0',
  'entity_types' =&gt; 
  array (
  ),
  'settings' =&gt; 
  array (
  ),
  'storage' =&gt; 
  array (
    'type' =&gt; 'field_sql_storage',
    'settings' =&gt; 
    array (
    ),
    'module' =&gt; 'field_sql_storage',
    'active' =&gt; '1',
    'details' =&gt; 
    array (
      'sql' =&gt; 
      array (
        'FIELD_LOAD_CURRENT' =&gt; 
        array (
          'field_data_field_address' =&gt; 
          array (
            'country' =&gt; 'field_address_country',
            'administrative_area' =&gt; 'field_address_administrative_area',
            'sub_administrative_area' =&gt; 'field_address_sub_administrative_area',
            'locality' =&gt; 'field_address_locality',
            'dependent_locality' =&gt; 'field_address_dependent_locality',
            'postal_code' =&gt; 'field_address_postal_code',
            'thoroughfare' =&gt; 'field_address_thoroughfare',
            'premise' =&gt; 'field_address_premise',
            'sub_premise' =&gt; 'field_address_sub_premise',
            'organisation_name' =&gt; 'field_address_organisation_name',
            'name_line' =&gt; 'field_address_name_line',
            'first_name' =&gt; 'field_address_first_name',
            'last_name' =&gt; 'field_address_last_name',
            'data' =&gt; 'field_address_data',
          ),
        ),
        'FIELD_LOAD_REVISION' =&gt; 
        array (
          'field_revision_field_address' =&gt; 
          array (
            'country' =&gt; 'field_address_country',
            'administrative_area' =&gt; 'field_address_administrative_area',
            'sub_administrative_area' =&gt; 'field_address_sub_administrative_area',
            'locality' =&gt; 'field_address_locality',
            'dependent_locality' =&gt; 'field_address_dependent_locality',
            'postal_code' =&gt; 'field_address_postal_code',
            'thoroughfare' =&gt; 'field_address_thoroughfare',
            'premise' =&gt; 'field_address_premise',
            'sub_premise' =&gt; 'field_address_sub_premise',
            'organisation_name' =&gt; 'field_address_organisation_name',
            'name_line' =&gt; 'field_address_name_line',
            'first_name' =&gt; 'field_address_first_name',
            'last_name' =&gt; 'field_address_last_name',
            'data' =&gt; 'field_address_data',
          ),
        ),
      ),
    ),
  ),
  'foreign keys' =&gt; 
  array (
  ),
  'indexes' =&gt; 
  array (
  ),
  'id' =&gt; '132',
  'field_name' =&gt; 'field_address',
  'type' =&gt; 'text',
  'module' =&gt; 'text',
  'active' =&gt; '1',
  'locked' =&gt; '0',
  'cardinality' =&gt; '1',
  'deleted' =&gt; '0',
  'columns' =&gt; 
  array (
    'value' =&gt; 
    array (
      'type' =&gt; 'varchar',
      'length' =&gt; NULL,
      'not null' =&gt; false,
    ),
    'format' =&gt; 
    array (
      'type' =&gt; 'varchar',
      'length' =&gt; 255,
      'not null' =&gt; false,
    ),
  ),
)
This is my solution to this problem, i'm going to also document how I found the solution. 

If you see the message that something went wrong stop and look at the logs that Drupal reports back to you and take the time to read them.

In this example I was getting this error due to a specific module and when Drupal was faulting out the module basic_cart_order was the last one to be rebuilding based on the logs.

Now that I knew what module was faulting out it was time to find out why. I found the fields that where causing the message field_address and I looked within in that module for that value.

grep -R "field_address"


That brought me over to this file

sites/all/modules/basic_cart/basic_cart_order/basic_cart_order.features.field_base.inc

I opened up that file and made a couple of changes to all the fields that where causing a conflict to the database. You can find all the fields that cause the error in your log message. I added a prefix to all the fields with basic_cart_order.

This fixed the problem down to the line that was throwing the error.