Drupal 8: Mismatched entity and/or field definitions

If you get the warning "Entity/field definitions Mismatch detected Mismatched entity and/or field definitions." after upgrading (for example from 8.37 to 8.45 i.e. required security update) you have to fix this issue first before running database updates. If you don't you might get into unresolvable problems. The solution is easy.

1. Adapt index.php

Add the following script before $response->send(); in index.php file(located in Drupal root folder)

try {
catch (EntityStorageException $e) {


2. Run update.php

3. Clear caches and run cron

4. Remove the above script from index.php

Drupal 8: Mismatched entity and/or field definitions

Drupal themes to be compared