I got this message in the status report after upgrading to drupal 8.7.3:

Content
    The node.feeds_item field needs to be updated.
Taxonomy term
    The taxonomy_term.field_illustratie field needs to be updated.

Note that prior to the upgrade
- node.feeds_item was not used or changed
- taxonomy_term.field_illustratie was created

None of these drush 8.1.1 commands could solve : drush cron / drush cr / drush updb / drush entity-updates

Comments

pobster’s picture

This is directly related to the entity-updates command.  What error(s) is it throwing when you run it?

jjgw’s picture

What else than drush entity-updates should I run?
The drush command returns just the same message as shown in the status report.

pobster’s picture

That seems unlikely?  To check ... you're running ONE of the following;

drush updatedb:status --entity-updates

drush entity:updates

You should receive output looking something along the lines of...

The following updates are pending:

node entity type :
The node.feeds_item field needs to be updated.

 Do you wish to run all pending updates? (yes/no) [yes]:
 > yes

 // Do you wish to run all pending updates?: yes.

 Finished performing updates

Are you maybe not saying "yes" to running the command?  Is your drush being run as part of a CI job (and hence not passing -y?)

jjgw’s picture

The outcome is the same!
The drush commands you're suggesting are for drush version 9.
So I ran the drush entity-version twice with the drush version 8.1.17 present on the server

[cur@www45 jan.site]$ drush updatedb:status --entity-updates
The drush command 'updatedb:status' could not be found.  Run `drush cache-clear drush` to clear the commandfile cache if  [error]
you have installed new extensions.
[cur@www45 jan.site]$ drush entity:updates
The drush command 'entity:updates' could not be found.  Run `drush cache-clear drush` to clear the commandfile cache if   [error]
you have installed new extensions.
[cur@www45 jan.site]$ drush version
 Drush Version   :  8.1.17

[cur@www45 jan.site]$ drush entity-updates
The following updates are pending:

node entity type :
  The node.feeds_item field needs to be updated.
taxonomy_term entity type :
  The taxonomy_term.field_illustratie field needs to be updated.
Do you wish to run all pending updates? (y/n): y
Cache rebuild complete.                                                                                                   [ok]
Finished performing updates.                                                                                              [ok]
[cur@www45 jan.site]$ drush entity-updates
The following updates are pending:

node entity type :
  The node.feeds_item field needs to be updated.
taxonomy_term entity type :
  The taxonomy_term.field_illustratie field needs to be updated.
Do you wish to run all pending updates? (y/n): yes
Do you wish to run all pending updates? (y/n): y
Cache rebuild complete.                                                                                                   [ok]
Finished performing updates.                                                    [ok]

Only local images are allowed.

pobster’s picture

Then, it'll be throwing an error somewhere?  Take a look in your dblog, your php error.log, your syslog even?  It'll be that something is mismatched and unable to be changed.  One thing which springs to mind as being a blocker before (and isn't guaranteed to be your issue) was an issue around the NOT NULL value being unable to be altered.

I've found this issue queue which may help you with being able to view what the expected and actual values are for the differences at least?  https://www.drupal.org/project/file_entity/issues/2914935

jjgw’s picture

Unfortunately I believe i am stuck because the drupal log files were deleted and i have no access on provider's logfiles.
I now also notice quite late that the drush entity-updates command has been deprecated.
I don't know if it has made the problem worse, anywhere it didn't work.

jjgw’s picture

Waw, it has been solved thanks to this :
https://drupal.stackexchange.com/questions/282317/mismatched-entity-and-or-field-definitions-for-comment-field

Solution : first installing Devel Entity Updates module and then running drush entup.

elebrun’s picture

I'm seeing that installing this to run drush entup is the solution to upgrading to 8.7.3 with entity mismatches in regards to taxonomy, but this isn't supposed to be run in production, correct? Are people running this in production to resolve this problem anyway?

jjgw’s picture

In my case the correction was'nt made on a production environment, but on an environment "for fun".
Notice also that the  Devel Entity Updates module is'nt covered by Drupals security advisory policy.

I believe this is one of the latest comments and patch suggestions about this issue :
https://www.drupal.org/project/file_entity/issues/3056070

tjtj’s picture

 ./drush entity:updates
The following updates are pending:

node entity type :
The node.feeds_item field needs to be uninstalled.

 Do you wish to run all pending updates? (yes/no) [yes]:
 > yes

In Connection.php line 695:

  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mydb.node__feeds_item' doesn't exist: UPDATE {node__feeds_item} SET deleted=:db_update_placeholder_0; Array
  (
      [:db_update_placeholder_0] => 1
  )

In Statement.php line 59:

  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mydb.node__feeds_item' doesn't exist
 

So how do I fix this?

Pozi’s picture

Hello,

i don't know if this is a proper way fo solving this issue but i solved the same error with my custom module DB schema table install.

Probably due to some sort of error module schema was not installed. You need to find table schema definition in contrib module that you use (should be placed in a root if module in *.install file) and make copy&paste into your module hook update of table schema definition.

Your module part should be done as described here: https://www.drupal.org/docs/8/api/update-api/updating-database-schema-andor-data-in-drupal-8

Good luck!

tjtj’s picture

 

./dr entity:updates
The following updates are pending:

block_content entity type :
The Custom block ID field needs to be updated.
The Revision ID field needs to be updated.
comment entity type :
The Comment ID field needs to be updated.
crop entity type :
The Crop ID field needs to be updated.
The Revision ID field needs to be updated.
feeds_feed entity type :
The Feed ID field needs to be updated.
feeds_subscription entity type :
The Feed ID field needs to be updated.
file entity type :
The File ID field needs to be updated.
media entity type :
The ID field needs to be updated.
The Revision ID field needs to be updated.
node entity type :
The ID field needs to be updated.
The Revision ID field needs to be updated.
paragraph entity type :
The ID field needs to be updated.
The Revision ID field needs to be updated.
path_alias entity type :
The ID field needs to be updated.
The Revision ID field needs to be updated.
payment entity type :
The Payment ID field needs to be updated.
shortcut entity type :
The ID field needs to be updated.
taxonomy_term entity type :
The Term ID field needs to be updated.
The Revision ID field needs to be updated.
webform_submission entity type :
The Submission ID field needs to be updated.
menu_link_content entity type :
The Entity ID field needs to be updated.
The Revision ID field needs to be updated.

Do you wish to run all pending updates? (yes/no) [yes]:
 > yes

In SqlContentEntityStorageSchema.php line 1870:

  The SQL storage cannot change the schema for an existing field (id in block_content entity) with data.
 

geles’s picture

You can comment out several line in SqlContentEntityStorageSchema.php as

 //  if ($this->hasColumnChanges($storage_definition, $original)) {
    //    throw new FieldStorageDefinitionUpdateForbiddenException('The SQL storage cannot change the schema for an existing field (' . $storage_definition->getName() . ' in ' . $storage_definition->getTargetEntityTypeId() . ' entity) with data.');
    //  }

D_Wicz’s picture

In our Drupal instance we began receiving the "Mismatched entity and/or field definitions" after a core upgrade as well as database out of date errors. Not really sure of which core upgrade it was.  

In the Status Report error section, we had 5 fields marked as mismatched. After attempting the drush entup command numerous times and getting confirmation the command was successful, the status report still showed the errors. These errors all where related to paragraph and viewfields (paragraph.pg_hp_vf_blogs being one such case) 

At Drupal Core 8.8.8 and Drush 8.3.2, we attempted the following process which finally resolved the errors outside of the drush command.

From the administrative menu, Structure -> Paragraph Types -> Home Page Blog List -> Manage Fields under machine name 'field_pg_hp_vf_blogs' and Field Type 'ViewField', we simply clicked "Save Field Settings". In four of the five cases, the field contained no data, in one case we received the warning that data was present. After saving, and returning to the main administrative menu and Reports - > Status Report, the errors were resolved. 

It seems as though saving through the GUI syncs up the changes in the database.

After updating all five of the fields marked as errors, the Status Report error section for "Mismatched entity and/or field definitions" was cleared from the error section. 

Hope this helps anyone else who may have tried drush entup and been unsuccessful.

Thomas Schuh’s picture

Thanks! This simple solution worked for me for some configurable fields (tax_rate, profile).

FatherShawn’s picture

Thank you for posting this!  So much better than an update hook!

d2d’s picture

Thank you.

gbirch’s picture

Worked for me too. Date field changed from datetime to pure date.

Giles Birch
Tech-Tamer, LLC

tce’s picture

It works 👍

ben.campbell’s picture

This worked for me too

ian-zabl’s picture

Thank you! Works like a charm.

timme77’s picture

Worked for me in D 9.2.2. Thx!

joegl’s picture

Thanks a million! This resolved it for us.

Just a note -- we had to save the "storage settings" for the field, which is on a different edit tab than the main edit tab.

tahiche’s picture

same as reported by @joegl , saving field settings (Edit) didnt´t make a difference, but saving Storage Settings solved the issue.

marthaflour’s picture

Thanks for adding that note about storage settings having its own tab, @joegl -- that saved me a lot of time!

Elvin - Albania Drupal Developer’s picture

i tried running the command drush entity:updates and this promted the following error: 

Drupal removed its automatic entity-updates API in 8.7. See https://www.drupal.org/node/3034742.

Then I followed your suggestion but I needed to edit both EDUT and FIELD SETTINGS tab under the field to get this solved.

parthabapari’s picture

Ah!!! Simple but life saving solution. Thanks 

newswatch’s picture

This was the simplest solution offered. And it worked like a charm.

[Database error notifications always have me worred :/]

-----------------------------
Subir Ghosh
www.subirghosh.in

terminator727’s picture

For Drupal 9, use devel_entity_updates module
composer require 'drupal/devel_entity_updates'
drush en devel_entity_updates
drush entity-updates
chucksimply’s picture

Thank you... works in my case for D9

lexicalparadoxx’s picture

Works on my D9 environment. Thank you!!

alaama’s picture

D9: This only removed statues error in /reports/status but:

- I'v had some fields somehow translated to 'es' (ex: Title->Título) and other UI strings (URL Alias -> ALIAS DE URL) which did not updated back to 'en'.

- Did not solve Mismatched field translation such as this one 

arnoldbird’s picture

Does not work if the field contains data:

In SqlContentEntityStorageSchema.php line 1756:

The SQL storage cannot change the schema for an existing field (field_profile_phone in node entity) with data.                                          
                                     

RenzoCarletti’s picture

This worked for me, thanks!

nattyweb’s picture

Superb support - thank you - worked for me with "user.field_mailchimp_subscribe field needs to be updated". Drupal 8.9.15.

chrisjames’s picture

After a core upgrade, we started getting "Mismatched entity and/or field definitions" errors, as well as database out of date errors in our Drupal instance. 

It's unclear which core upgrade it was.

We had 5 fields marked as mismatched in the Status Report error section. 

Despite multiple attempts at the drush entup command and confirmation that the command was successful, the status report still showed the errors. 

These errors all had something to do with paragraphs and viewfields (paragraph.pg hp vf blogs being one of them).

We tried the following process with Drupal Core 8.8.8 and Drush 8.3.2, and it finally fixed the errors outside of the drush command.

We simply clicked "Save Field Settings" from the administrative menu, Structure -> Paragraph Types -> Home Page Blog List -> Manage Fields, under machine name 'field pg hp vf blogs' and Field Type 'ViewField'. 

In four of the five cases, there was no data in the field, and in one case, there was no data at all.

Belba’s picture

I can confirm the above. Had the error with a paragraphg field. Only re-saving the field settings, despite the warning that data already exists for the field, was the solution to make the error message disappear.

Drupal 9.4

radziaziz’s picture

Thanks for the solution man!
In my case i use the same field (field type = entity referece) in 2 content type. Initally i set the field to accept unlimited value, then change it back to only allow 1 value. However i only change the settings at 1 of the content type, thinking that the settings will be copied at the 2nd. So the solution to just update (by click the Save field settings button) made sense, and most importantly it works!  

jbaum_13’s picture

We ran into the same issue and resaving the fields for the taxonomy term removed the entity mismatch errors. 

sami-an’s picture

$ drush field-create node --field-name=node.field_youtube 
$ drush field-delete node  --field-name=node.field_youtube 

or

$ drush field-create node --field-name=field_youtube 
$ drush field-delete node  --field-name=field_youtube 

For more options, see the following

https://www.drush.org/latest/commands/field_delete/