Cannot uninstall on Drupal 8.7 or later

Created on 8 January 2020, almost 5 years ago
Updated 17 April 2023, over 1 year ago

Trying to uninstall the Workflow / Multiversion package on Drupal 8.7 in preparation for update to core Workspaces / 8.8, I cannot get the module to uninstall properly.

Multiple errors are thrown and all content in the {node} table is deleted.

Versions installed

* Drupal 8.7.11
* Content Moderation 8.7.11 enabled

* Multiversion 8.x-1.0-dev (updated 07-JAN-2020)
* Deploy 8.x-1.0-beta-21
* Replication 8.x-1.0-beta-24
* Workspace 8.x-1.0-beta-33
* Drush 8.1.18
* Migrate Plus 8.x-4.2

Process

drush pmu deploy -y
drush wun -y

<h1>Uncaught exception thrown in shutdown function.</h1><p><em class="placeholder">Drupal\Component\Plugin\Exception\PluginNotFoundException</em>: The &quot;workspace_pointer&quot; entity type does not exist. in <em class="placeholder">Drupal\Core\Entity\EntityTypeManager-&gt;getDefinition()</em> (line <em class="placeholder">150</em> of <em class="placeholder">/core/lib/Drupal/Core/Entity/EntityTypeManager.php</em>). <pre class="backtrace">Drupal\Core\Entity\EntityTypeManager-&gt;getDefinition(&#039;workspace_pointer&#039;) (Line: 272)
Drupal\Core\Entity\EntityTypeManager-&gt;getHandler(&#039;workspace_pointer&#039;, &#039;storage&#039;) (Line: 208)
Drupal\Core\Entity\EntityTypeManager-&gt;getStorage(&#039;workspace_pointer&#039;) (Line: 48)
_hook_post_action_post_save(Object, &#039;delete&#039;) (Line: 1043)
_drupal_shutdown_function()
</pre></p><hr />Drupal\Component\Plugin\Exception\PluginNotFoundException: The "workspace_pointer" entity type does not exist. in /core/lib/Drupal/Core/Entity/EntityTypeManager.php:150
Stack trace:
#0 /core/lib/Drupal/Core/Entity/EntityTypeManager.php(272): Drupal\Core\Entity\EntityTypeManager->getDefinition('workspace_point...')
#1 /core/lib/Drupal/Core/Entity/EntityTypeManager.php(208): Drupal\Core\Entity\EntityTypeManager->getHandler('workspace_point...', 'storage')
#2 /modules/contrib/hook_post_action/hook_post_action.module(48): Drupal\Core\Entity\EntityTypeManager->getStorage('workspace_point...')
#3 /core/includes/bootstrap.inc(1043): _hook_post_action_post_save(Object(Drupal\workspace\Entity\WorkspacePointer), 'delete')
#4 [internal function]: _drupal_shutdown_function()
#5 {main}

drush pmu replication -y

<h1>Uncaught exception thrown in shutdown function.</h1><p><em class="placeholder">Drupal\Component\Plugin\Exception\PluginNotFoundException</em>: The &quot;replication_settings&quot; entity type does not exist. in <em class="placeholder">Drupal\Core\Entity\EntityTypeManager-&gt;getDefinition()</em> (line <em class="placeholder">150</em> of <em class="placeholder">/core/lib/Drupal/Core/Entity/EntityTypeManager.php</em>). <pre class="backtrace">Drupal\Core\Entity\EntityTypeManager-&gt;getDefinition(&#039;replication_settings&#039;) (Line: 272)
Drupal\Core\Entity\EntityTypeManager-&gt;getHandler(&#039;replication_settings&#039;, &#039;storage&#039;) (Line: 208)
Drupal\Core\Entity\EntityTypeManager-&gt;getStorage(&#039;replication_settings&#039;) (Line: 48)
_hook_post_action_post_save(Object, &#039;delete&#039;) (Line: 1043)
_drupal_shutdown_function()
</pre></p><hr />Drupal\Component\Plugin\Exception\PluginNotFoundException: The "replication_settings" entity type does not exist. in /core/lib/Drupal/Core/Entity/EntityTypeManager.php:150
Stack trace:
#0 /core/lib/Drupal/Core/Entity/EntityTypeManager.php(272): Drupal\Core\Entity\EntityTypeManager->getDefinition('replication_set...')
#1 /core/lib/Drupal/Core/Entity/EntityTypeManager.php(208): Drupal\Core\Entity\EntityTypeManager->getHandler('replication_set...', 'storage')
#2 /modules/contrib/hook_post_action/hook_post_action.module(48): Drupal\Core\Entity\EntityTypeManager->getStorage('replication_set...')
#3 /core/includes/bootstrap.inc(1043): _hook_post_action_post_save(Object(Drupal\replication\Entity\ReplicationSettings), 'delete')
#4 [internal function]: _drupal_shutdown_function()
#5 {main}

drush mun -y

*** The uninstall process can take a few minutes, it depends by the number of entities on[warning]
the site. Please be patient.
TypeError: Argument 3 passed to Drupal\views\EntityViewsData::mapFieldDefinition() must implement interface Drupal\Core\Field\FieldDefinitionInterface, null given, called in /core/modules/views/src/EntityViewsData.php on line 292 in /core/modules/views/src/EntityViewsData.php on line 389 #0 /core/modules/views/src/EntityViewsData.php(292): Drupal\views\EntityViewsData->mapFieldDefinition('redirect', 'revision_id', NULL, Object(Drupal\Core\Entity\Sql\DefaultTableMapping), Array)
#1 /modules/contrib/redirect/src/RedirectViewsData.php(16): Drupal\views\EntityViewsData->getViewsData()
#2 /core/modules/views/views.views.inc(178): Drupal\redirect\RedirectViewsData->getViewsData()
#3 [internal function]: views_views_data()
#4 /core/lib/Drupal/Core/Extension/ModuleHandler.php(392): call_user_func_array('views_views_dat...', Array)
#5 /core/modules/views/src/ViewsData.php(243): Drupal\Core\Extension\ModuleHandler->invoke('views', 'views_data')
#6 /core/modules/views/src/ViewsData.php(160): Drupal\views\ViewsData->getData()
#7 /modules/contrib/ds/src/Plugin/Derivative/DsEntityRow.php(91): Drupal\views\ViewsData->get('access_token')
#8 /core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(101): Drupal\ds\Plugin\Derivative\DsEntityRow->getDerivativeDefinitions(Array)
#9 /core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(87): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives(Array)
#10 /core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(284): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions()
#11 /core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(175): Drupal\Core\Plugin\DefaultPluginManager->findDefinitions()
#12 /core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php(22): Drupal\Core\Plugin\DefaultPluginManager->getDefinitions()
#13 /core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(16): Drupal\Core\Plugin\DefaultPluginManager->getDefinition('entity:taxonomy...')
#14 /core/lib/Drupal/Component/Plugin/PluginManagerBase.php(83): Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('entity:taxonomy...', Array)
#15 /core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(817): Drupal\Component\Plugin\PluginManagerBase->createInstance('entity:taxonomy...')
#16 /core/modules/views/src/Plugin/views/style/StylePluginBase.php(122): Drupal\views\Plugin\views\display\DisplayPluginBase->getPlugin('row')
#17 /core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(820): Drupal\views\Plugin\views\style\StylePluginBase->init(Object(Drupal\views\ViewExecutable), Object(Drupal\views\Plugin\views\display\Page), Array)
#18 /core/modules/views/src/ViewExecutable.php(882): Drupal\views\Plugin\views\display\DisplayPluginBase->getPlugin('style')
#19 /core/modules/views/src/ViewExecutable.php(1842): Drupal\views\ViewExecutable->initStyle()
#20 /core/modules/views/src/Plugin/views/display/PathPluginBase.php(132): Drupal\views\ViewExecutable->getTitle()
#21 /core/modules/views/src/Plugin/views/display/Page.php(91): Drupal\views\Plugin\views\display\PathPluginBase->getRoute('benefits_by_emp...', 'all')
#22 /core/modules/views/src/Plugin/views/display/PathPluginBase.php(220): Drupal\views\Plugin\views\display\Page->getRoute('benefits_by_emp...', 'all')
#23 /core/modules/views/src/EventSubscriber/RouteSubscriber.php(120): Drupal\views\Plugin\views\display\PathPluginBase->collectRoutes(Object(Symfony\Component\Routing\RouteCollection))
#24 [internal function]: Drupal\views\EventSubscriber\RouteSubscriber->routes()
#25 /core/lib/Drupal/Core/Routing/RouteBuilder.php(146): call_user_func(Array)
#26 /core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild()
#27 /core/lib/Drupal/Core/Extension/ModuleInstaller.php(496): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild()
#28 /core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(91): Drupal\Core\Extension\ModuleInstaller->uninstall(Array, true)
#29 /var/www/etf.local/vendor/drush/drush/commands/core/drupal/environment.inc(227): Drupal\Core\ProxyClass\Extension\ModuleInstaller->uninstall(Array)
#30 /modules/contrib/multiversion/multiversion.drush.inc(96): drush_module_uninstall(Array)
#31 /var/www/etf.local/vendor/drush/drush/includes/command.inc(422): drush_multiversion_uninstall()
#32 /var/www/etf.local/vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#33 /var/www/etf.local/vendor/drush/drush/includes/command.inc(199): drush_command()
#34 /var/www/etf.local/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#35 /var/www/etf.local/vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#36 /var/www/etf.local/vendor/drush/drush/drush.php(12): drush_main()
#37 {main}
TypeError: Argument 3 passed to Drupal\views\EntityViewsData::mapFieldDefinition() must implement interface Drupal\Core\Field\FieldDefinitionInterface, null given, called in /core/modules/views/src/EntityViewsData.php on line 292 in Drupal\views\EntityViewsData->mapFieldDefinition() (line 389 of /core/modules/views/src/EntityViewsData.php).
Drush command terminated abnormally due to an unrecoverable error.                       [error]
<h1>Uncaught exception thrown in shutdown function.</h1><p><em class="placeholder">Drupal\Component\Plugin\Exception\PluginNotFoundException</em>: The &quot;workspace&quot; entity type does not exist. in <em class="placeholder">Drupal\Core\Entity\EntityTypeManager-&gt;getDefinition()</em> (line <em class="placeholder">150</em> of <em class="placeholder">/core/lib/Drupal/Core/Entity/EntityTypeManager.php</em>). <pre class="backtrace">Drupal\Core\Entity\EntityTypeManager-&gt;getDefinition(&#039;workspace&#039;) (Line: 272)
Drupal\Core\Entity\EntityTypeManager-&gt;getHandler(&#039;workspace&#039;, &#039;storage&#039;) (Line: 208)
Drupal\Core\Entity\EntityTypeManager-&gt;getStorage(&#039;workspace&#039;) (Line: 48)
_hook_post_action_post_save(Object, &#039;delete&#039;) (Line: 1043)
_drupal_shutdown_function()
</pre></p><hr />Drupal\Component\Plugin\Exception\PluginNotFoundException: The "workspace" entity type does not exist. in /core/lib/Drupal/Core/Entity/EntityTypeManager.php:150
Stack trace:
#0 /core/lib/Drupal/Core/Entity/EntityTypeManager.php(272): Drupal\Core\Entity\EntityTypeManager->getDefinition('workspace')
#1 /core/lib/Drupal/Core/Entity/EntityTypeManager.php(208): Drupal\Core\Entity\EntityTypeManager->getHandler('workspace', 'storage')
#2 /modules/contrib/hook_post_action/hook_post_action.module(48): Drupal\Core\Entity\EntityTypeManager->getStorage('workspace')
#3 /core/includes/bootstrap.inc(1043): _hook_post_action_post_save(Object(Drupal\multiversion\Entity\Workspace), 'delete')
#4 [internal function]: _drupal_shutdown_function()
#5 {main}


drush cr

* load website *

The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Drupal\Core\Database\DatabaseExceptionWrapper</em>: SQLSTATE[42S22]: Column not found: 1054 Unknown column &#039;workspace&#039; in &#039;where clause&#039;: SELECT rid FROM {redirect} WHERE hash IN (:hashes__0, :hashes__1) AND workspace = :workspace AND _deleted != 1 ORDER BY LENGTH(redirect_source__query) DESC; Array
(
    [:workspace] =&gt; 1
    [:hashes__0] =&gt; 4o3i9Ab6UbDCpQCuaImwO5PVjfycPBOIY2bEymEcFFM
    [:hashes__1] =&gt; etebSAjbeiTzQ3dpJ4djiJNqJnCjj9_uhPafoqO8vi8
)
 in <em class="placeholder">Drupal\multiversion\Redirect\RedirectRepository-&gt;findMatchingRedirect()</em> (line <em class="placeholder">62</em> of <em class="placeholder">modules/contrib/multiversion/src/Redirect/RedirectRepository.php</em>). <pre class="backtrace">Drupal\Core\Database\Statement-&gt;execute(Array, Array) (Line: 631)
Drupal\Core\Database\Connection-&gt;query(&#039;SELECT rid FROM {redirect} WHERE hash IN (:hashes__0, :hashes__1) AND workspace = :workspace AND _deleted != 1 ORDER BY LENGTH(redirect_source__query) DESC&#039;, Array, Array) (Line: 358)
Drupal\Core\Database\Driver\mysql\Connection-&gt;query(&#039;SELECT rid FROM {redirect} WHERE hash IN (:hashes[]) AND workspace = :workspace AND _deleted != 1 ORDER BY LENGTH(redirect_source__query) DESC&#039;, Array) (Line: 62)
Drupal\multiversion\Redirect\RedirectRepository-&gt;findMatchingRedirect(&#039;admin/content&#039;, Array, &#039;en&#039;) (Line: 147)
Drupal\redirect\EventSubscriber\RedirectRequestSubscriber-&gt;onKernelRequestCheckRedirect(Object, &#039;kernel.request&#039;, Object)
call_user_func(Array, Object, &#039;kernel.request&#039;, Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher-&gt;dispatch(&#039;kernel.request&#039;, Object) (Line: 127)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 60)
Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 693)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)

Alternate process

If I try to run drush mdt instead of drush mun, I get:

drush mdt
Do you really want to disable all enabled entity types (block_content, content_moderation_state, file, media, node, shortcut, taxonomy_term, menu_link_content, replication_log, paragraph, redirect)? (y/n): y
TypeError: Argument 2 passed to Drupal\migrate\Plugin\MigratePluginManager::createInstance() must be of the type array, null given, called in /core/modules/migrate/src/Plugin/Migration.php on line 349 in /core/modules/migrate/src/Plugin/MigratePluginManager.php on line 52 #0 /core/modules/migrate/src/Plugin/Migration.php(349): Drupal\migrate\Plugin\MigratePluginManager->createInstance(NULL, NULL, Object(Drupal\migrate\Plugin\Migration))
#1 /core/modules/migrate/src/Plugin/migrate/id_map/Sql.php(322): Drupal\migrate\Plugin\Migration->getSourcePlugin()
#2 /core/modules/migrate/src/Plugin/migrate/id_map/Sql.php(301): Drupal\migrate\Plugin\migrate\id_map\Sql->ensureTables()
#3 /core/modules/migrate/src/Plugin/migrate/id_map/Sql.php(291): Drupal\migrate\Plugin\migrate\id_map\Sql->init()
#4 /core/modules/migrate/src/Plugin/migrate/id_map/Sql.php(833): Drupal\migrate\Plugin\migrate\id_map\Sql->getDatabase()
#5 /modules/contrib/multiversion/src/MultiversionMigration.php(200): Drupal\migrate\Plugin\migrate\id_map\Sql->destroy()
#6 /modules/contrib/multiversion/src/MultiversionManager.php(437): Drupal\multiversion\MultiversionMigration->cleanupMigration('file__from_tmp')
#7 /modules/contrib/multiversion/multiversion.drush.inc(160): Drupal\multiversion\MultiversionManager->disableEntityTypes(Array)
#8 /var/www/etf.local/vendor/drush/drush/includes/command.inc(422): drush_multiversion_disable_entity_types()
#9 /var/www/etf.local/vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#10 /var/www/etf.local/vendor/drush/drush/includes/command.inc(199): drush_command()
#11 /var/www/etf.local/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#12 /var/www/etf.local/vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#13 /var/www/etf.local/vendor/drush/drush/drush.php(12): drush_main()
#14 {main}
TypeError: Argument 2 passed to Drupal\migrate\Plugin\MigratePluginManager::createInstance() must be of the type array, null given, called in /core/modules/migrate/src/Plugin/Migration.php on line 349 in Drupal\migrate\Plugin\MigratePluginManager->createInstance() (line 52 of /core/modules/migrate/src/Plugin/MigratePluginManager.php).
Drush command terminated abnormally due to an unrecoverable error.
πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States agentrickard Georgia (US)

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States kenrbnsn New Jersey

    I am finally trying to remove this module from a site so I can move to to D9 and, eventually, D10. When I follow the directions that davo20019 posted on the site https://dev.to/davo20019/how-to-uninstall-the-contrib-module-multiversio..., I found the gist he mentions is no longer available. Is it available anywhere else?

  • πŸ‡ΊπŸ‡ΈUnited States kenrbnsn New Jersey

    @davo20019 I followed the directions and it seemed to get rid of multiversion and all of the associated modules. I've updated my site to 9.5.7, but when I do a
    "$ drush updb -y"

    I get this error:

    >  [notice] Update started: system_post_update_entity_revision_metadata_bc_cleanup
    >  [error]  Drupal\multiversion\Entity\Storage\Sql\MediaStorage 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
    

    What to I have to do to get rid of that error?

Production build 0.71.5 2024