drush updb fails with "the 'media_delete_action' plugin does not exist" after 8.4.6 > 8.5.1 update We have recently updated a Drupal 8.4.6 installation via composer to Drupal 8.5.1. After the composer update I ran

drush updb


as usual. However, the command fails at one point with the following error message:

Failed: Drupal\Component\Plugin\Exception\PluginNotFoundException: The "media_delete_action" plugin does not     [error]
exist. in Drupal\Core\Plugin\DefaultPluginManager-&gt;doGetDefinition() (line 52 of
…\htdocs\casali\web\core\lib\Drupal\Component\Plugin\Discovery\DiscoveryTrait.php).


After that, every drush updb wants to do the following updates, since they are never completed:

system module :
  Change plugin IDs of actions.
  Clear caches due to schema changes in core.entity.schema.yml.

views module :
  Update dependencies for moved bulk field plugin.
  Add additional settings to the entity link field and convert node_path usage  to entity_link.
  Add placeholder settings to string or numeric filters.
  Fix cache max age for table displays.
  Include views data table provider in views dependencies.


I am not quite sure what to do here. As far as I have researched, media_delete_action is part of the media_entity module. However, that module is already part of the core in Drupal 8.4.x (https://www.drupal.org/project/media_entity).

If I run

drush en media_entity


it tells me

media_entity was not found.                                                                                                [warning]
The following projects provide some or all of the extensions not found:                                                    [ok]
media_entity
Would you like to download them? (y/n):


But I don't think I should have to do that, since it's already part of the core?
This is how we were able to solve this problem:

Temporarily install drupal/media_entity_actions:

composer require drupal/media_entity_actions:^1.0
drush en media_entity_actions


Run the database update:

drush updb


This time it will work:

system module :
  Change plugin IDs of actions.
  Clear caches due to schema changes in core.entity.schema.yml.

views module :
  Update dependencies for moved bulk field plugin.
  Add additional settings to the entity link field and convert node_path usage  to entity_link.
  Add placeholder settings to string or numeric filters.
  Fix cache max age for table displays.
  Include views data table provider in views dependencies.

Do you wish to run all pending updates? (y/n): y
Post updating system                                                                                                       [ok]
Post updating system                                                                                                       [ok]
Post updating views                                                                                                        [ok]
Post updating views                                                                                                        [ok]
Post updating views                                                                                                        [ok]
Post updating views                                                                                                        [ok]
Post updating views                                                                                                        [ok]
Post updating views                                                                                                        [ok]
Post updating views                                                                                                        [ok]
Cache rebuild complete.                                                                                                    [ok]
Finished performing updates.                                                                                               [ok]


Then the module can be uninstalled safely:

drush pm-uninstall media_entity_actions
composer remove drupal/media_entity_actions