Problem/Motivation

I can't update from drupal 8 to drupal 9

Steps to reproduce

I run composer update and then drush updatedb
here is the pending update ;
Update_ID : entity_revision_metadata_bc_cleanup
type : post_update
Description : Remove backwards-compatibility leftovers from entity type definitions.

Drush 10 can not update :
[notice] Update started: system_post_update_entity_revision_metadata_bc_cleanup
> [error] Drupal\crop\CropStorage does not implement Drupal\Core\Entity\ContentEntityStorageInterface
> [error] Update failed: system_post_update_entity_revision_metadata_bc_cleanup
[error] Update aborted by: system_post_update_entity_revision_metadata_bc_cleanup

Comments

zorax created an issue. See original summary.

zorax’s picture

In crop-1.0-alpha2-installed.php line 341 may be the problem is there...:

$connection->insert('key_value')
->fields(array(
  'collection',
  'name',
  'value',
))
->values(array(
  'collection' => 'entity.definitions.installed',
  'name' => 'crop.entity_type',
  'value' => 'O:36:"Drupal\Core\Entity\ContentEntityType":42:{s:25:" * revision_metadata_keys";a:4:{s:16:"revision_default";s:16:"revision_default";s:13:"revision_user";s:12:"revision_uid";s:16:"revision_created";s:18:"revision_timestamp";s:20:"revision_log_message";s:12:"revision_log";}s:31:" * requiredRevisionMetadataKeys";a:1:{s:16:"revision_default";s:16:"revision_default";}s:15:" * static_cache";b:1;s:15:" * render_cache";b:0;s:19:" * persistent_cache";b:1;s:14:" * entity_keys";a:7:{s:2:"id";s:3:"cid";s:6:"bundle";s:4:"type";s:8:"revision";s:3:"vid";s:8:"langcode";s:8:"langcode";s:4:"uuid";s:4:"uuid";s:16:"default_langcode";s:16:"default_langcode";s:29:"revision_translation_affected";s:29:"revision_translation_affected";}s:5:" * id";s:4:"crop";s:16:" * originalClass";s:23:"Drupal\crop\Entity\Crop";s:11:" * handlers";a:5:{s:7:"storage";s:23:"Drupal\crop\CropStorage";s:12:"view_builder";s:36:"Drupal\Core\Entity\EntityViewBuilder";s:6:"access";s:45:"Drupal\Core\Entity\EntityAccessControlHandler";s:4:"form";a:3:{s:7:"default";s:36:"Drupal\Core\Entity\ContentEntityForm";s:6:"delete";s:47:"Drupal\Core\Entity\ContentEntityConfirmFormBase";s:4:"edit";s:36:"Drupal\Core\Entity\ContentEntityForm";}s:11:"translation";s:52:"Drupal\content_translation\ContentTranslationHandler";}s:19:" * admin_permission";s:15:"administer crop";s:25:" * permission_granularity";s:11:"entity_type";s:8:" * links";a:0:{}s:17:" * label_callback";N;s:21:" * bundle_entity_type";s:9:"crop_type";s:12:" * bundle_of";N;s:15:" * bundle_label";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:" * string";s:9:"Crop type";s:12:" * arguments";a:0:{}s:10:" * options";a:0:{}}s:13:" * base_table";s:4:"crop";s:22:" * revision_data_table";s:19:"crop_field_revision";s:17:" * revision_table";s:13:"crop_revision";s:13:" * data_table";s:15:"crop_field_data";s:11:" * internal";b:0;s:15:" * translatable";b:1;s:19:" * show_revision_ui";b:0;s:8:" * label";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:" * string";s:4:"Crop";s:12:" * arguments";a:0:{}s:10:" * options";a:0:{}}s:19:" * label_collection";s:0:"";s:17:" * label_singular";s:0:"";s:15:" * label_plural";s:0:"";s:14:" * label_count";a:0:{}s:15:" * uri_callback";N;s:8:" * group";s:7:"content";s:14:" * group_label";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:" * string";s:7:"Content";s:12:" * arguments";a:0:{}s:10:" * options";a:1:{s:7:"context";s:17:"Entity type group";}}s:22:" * field_ui_base_route";N;s:26:" * common_reference_target";b:0;s:22:" * list_cache_contexts";a:0:{}s:18:" * list_cache_tags";a:1:{i:0;s:9:"crop_list";}s:14:" * constraints";a:1:{s:26:"EntityUntranslatableFields";N;}s:13:" * additional";a:1:{s:9:"fieldable";b:1;}s:8:" * class";s:23:"Drupal\crop\Entity\Crop";s:11:" * provider";s:4:"crop";s:14:" * _serviceIds";a:0:{}s:18:" * _entityStorages";a:0:{}s:20:" * stringTranslation";N;}',
))
richgerdes’s picture

Category: Feature request » Support request

I had this problem when upgrading an older site. Turns out it was the result of the crop module not being installed, but its entities were still in the definitions table. I was able to reinstall crop and then uninstall it via Drush and that cleaned up the extra definitions.