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.
By jjgw on
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
This is directly related to
This is directly related to the entity-updates command. What error(s) is it throwing when you run it?
What else than drush entity
What else than drush entity-updates should I run?
The drush command returns just the same message as shown in the status report.
That seems unlikely? To
That seems unlikely? To check ... you're running ONE of the following;
You should receive output looking something along the lines of...
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?)
The outcome is the same!
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]
Then, it'll be throwing an
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
Unfortunately I believe i am
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.
Waw, it has been solved
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.
Devel Entity Updates Question
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?
In my case the correction was
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
I get this too
So how do I fix this?
Hello,
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!
I get an error message
./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.
You can comment out several
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.');
// }
Other possible solution
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.
Worked for me
Thanks! This simple solution worked for me for some configurable fields (tax_rate, profile).
Super tip!
Thank you for posting this! So much better than an update hook!
Worked For Me!
Thank you.
Worked for me too
Worked for me too. Date field changed from datetime to pure date.
Giles Birch
Tech-Tamer, LLC
Noice!
It works 👍
This worked for me too
This worked for me too
Saved me time
Thank you! Works like a charm.
Worked for me in D 9.2.2. Thx
Worked for me in D 9.2.2. Thx!
Thanks a million! This
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.
same as reported by @joegl ,
same as reported by @joegl , saving field settings (Edit) didnt´t make a difference, but saving Storage Settings solved the issue.
Thanks for adding that note!
Thanks for adding that note about storage settings having its own tab, @joegl -- that saved me a lot of time!
surprisingly it worked
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.
Ah!!! Simple but life saving
Ah!!! Simple but life saving solution. Thanks
This was the simplest
This was the simplest solution offered. And it worked like a charm.
[Database error notifications always have me worred :/]
-----------------------------
Subir Ghosh
www.subirghosh.in
For Drupal 9, use devel
Works
Thank you... works in my case for D9
[D9] Works!
Works on my D9 environment. Thank you!!
D9: This only removed statues
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
Does not work if the field
Does not work if the field contains data:
Works
This worked for me, thanks!
Lifesaver - thank you
Superb support - thank you - worked for me with "user.field_mailchimp_subscribe field needs to be updated". Drupal 8.9.15.
This Post
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.
I can confirm the above
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
Solved my problem, D9
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!
Same issue
We ran into the same issue and resaving the fields for the taxonomy term removed the entity mismatch errors.
The following solution worked for me
For more options, see the following
https://www.drush.org/latest/commands/field_delete/