Problem/Motivation

I tried to uninstall the Gutenberg Editor (gutenberg) module by means of the GUI.
It produced the following error:

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "gutenberg" plugin does not exist. Valid plugin IDs for Drupal\filter\FilterPluginManager are: editor_file_reference, filter_caption, filter_html_escape, filter_null, filter_html_image_secure, filter_align, filter_html, filter_url, filter_autop, filter_htmlcorrector, filter_mailchimp_campaign, media_embed in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

Drupal\Core\Plugin\DefaultPluginManager->getDefinition() (Line: 70)
Drupal\filter\FilterPluginCollection->initializePlugin() (Line: 80)
Drupal\Component\Plugin\LazyPluginCollection->get() (Line: 26)
Drupal\filter\FilterPluginCollection->get() (Line: 92)
Drupal\filter\FilterPluginCollection->sortHelper()
uasort() (Line: 90)
Drupal\Core\Plugin\DefaultLazyPluginCollection->sort() (Line: 84)
Drupal\filter\FilterPluginCollection->sort() (Line: 144)
Drupal\filter\Entity\FilterFormat->filters() (Line: 58)
Drupal\filter\FilterUninstallValidator->validate() (Line: 592)
Drupal\Core\Extension\ModuleInstaller->validateUninstall() (Line: 99)
Drupal\Core\ProxyClass\Extension\ModuleInstaller->validateUninstall() (Line: 132)
Drupal\system\Form\ModulesUninstallForm->buildForm()
call_user_func_array() (Line: 532)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 91)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 57)
Drupal\Core\StackMiddleware\Session->handle() (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 708)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Trying to visit the site's front page now produces a WSOD with the same error and an even longer call stack.

drush pm-list report "gutenberg" as "Disabled".
drush cr only reports " [success] Cache rebuild complete."

I am setting priority to "Critical" because I have so far found no way to recover the site.

Steps to reproduce

Disable all components of the Gutenberg ecosystem. This hit me after I tried to uninstall the last one (short name "gutenberg").

Proposed resolution

No idea.

Comments

gisle created an issue. See original summary.

marcofernandes’s picture

Status: Active » Postponed (maintainer needs more info)

Can you describe the steps you made to uninstall Gutenberg?
I ask this because there's an issue when trying to uninstall Gutenberg. At the extend GUI, the Gutenberg will be disabled and trying to uninstall it through drush or drupal console will throw an error stating that there's a text format in use. So, to be able to uninstall, the Gutenberg text format must be disabled and only then it's possible to uninstall the module. And there's no way around it, at least that I know of.

So, I assume on what you're describing that you were able to uninstall without disabling the text format. I thought that wasn't possible and that's why I'm asking you to describe the steps so I can replicate the issue.

marcofernandes’s picture

Btw, to try to fix it, enable Gutenberg module again and then first disable the Gutenberg blocks text format and then uninstall the module.

gisle’s picture

Btw, to try to fix it, enable Gutenberg module again and then first disable the Gutenberg blocks text format and then uninstall the module.

I've now done that. It didn't fix it. Below are a description of what I did with as much details as I am able to provide:

Steps taken

Reenabled gutenberg with drush. Success.

Site is now operational again.

Drupal version: 8.9.13
Gutenberg version: 8.x-2.x-dev (latest)

State of the Gutenberg ecosystem:

  • Articles list block - Disabled
  • Example Block - Disabled
  • Gutenberg Cards Block - Disabled
  • Gutenberg Cloud - Disabled
  • Gutenberg Editor - Enabled
  • EditorsKit - Disabled

When I unistalled last time, the checkbox under "Unistall" was initially grayed out, and there was a message: "The following reason prevents Gutenberg Editor from being uninstalled: Provides a filter plugin that is in use in the following filter formats:" followed by a list of text formats (such as "Restricted HTML") to remove it from. I then visited each and every one of them and unchecked the "Gutenberg" text filter. The checkbox under "Unistall" then became active, I checked it, and finally clicked "Uninstall".

This time, the checkbox under "Unistall" is also grayed out, and it now gives the reason: "Provides a filter plugin that is in use in the following filter formats: Gutenberg Blocks text format". I may have overlooked that text format on the list output (reasons) the last time around, but I am pretty sure I didn't.

Anyway I visit the page of the "Gutenberg Blocks text format", unchecks the "Gutenberg" text filter, examine under "Uninstall" and notice that the checkbox under uninstall is now active.

But I also noticed that the "Gutenberg Blocks text format" has its editor set to "Gutenberg", so I return, and replaces it with "None".

I then go ahead to the "Unistall" tab and check the the "Gutenberg editor", and the click "Uninstall" at the bottom of the screen.

The next page says:

The following modules will be completely uninstalled from your site, and all data from these modules will be lost!
- Gutenberg Editor

There is also two panels:
- Configuration updates
- Configuration deletions

The "Configuration updates" panel contains:

The listed configuration will be updated.
Text format
- Basic HTML
- Filtered HTML
- Full HTML
- Raw HTML5
- Restricted HTML
- Wysiwyg

This is every text format that has had the "Gutenberg" text filter installed, with the exception of "Gutenberg Blocks text format"

The "Configuration updates" panel contains:

The listed configuration will be deleted.
Action
    Delete reusable block
Custom block type
    Reusable block
Entity form display
    block_content.reusable_block.default
Entity view display
    block_content.reusable_block.default
    block_content.reusable_block.reusable_block
Field
    Body
Text format
    Gutenberg Blocks text format
View mode
    Reusable block
View
    Reusable Blocks

I then press "Uninstall".

This results in

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "gutenberg" plugin does not exist. Valid plugin IDs for Drupal\filter\FilterPluginManager are: editor_file_reference, filter_caption, filter_html_escape, filter_null, filter_html_image_secure, filter_align, filter_html, filter_url, filter_autop, filter_htmlcorrector, filter_mailchimp_campaign, media_embed in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

Drupal\Core\Plugin\DefaultPluginManager->getDefinition() (Line: 70)
Drupal\filter\FilterPluginCollection->initializePlugin() (Line: 80)
Drupal\Component\Plugin\LazyPluginCollection->get() (Line: 26)
Drupal\filter\FilterPluginCollection->get() (Line: 92)
Drupal\filter\FilterPluginCollection->sortHelper()
uasort() (Line: 90)
Drupal\Core\Plugin\DefaultLazyPluginCollection->sort() (Line: 84)
Drupal\filter\FilterPluginCollection->sort() (Line: 144)
Drupal\filter\Entity\FilterFormat->filters() (Line: 58)
Drupal\filter\FilterUninstallValidator->validate() (Line: 592)
Drupal\Core\Extension\ModuleInstaller->validateUninstall() (Line: 99)
Drupal\Core\ProxyClass\Extension\ModuleInstaller->validateUninstall() (Line: 132)
Drupal\system\Form\ModulesUninstallForm->buildForm()
call_user_func_array() (Line: 532)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 91)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 57)
Drupal\Core\StackMiddleware\Session->handle() (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 708)
Drupal\Core\DrupalKernel->handle() (Line: 19)

When I return to the front page, I get a WSOD with the same error, and an even longer call stack dump.

marcofernandes’s picture

Status: Postponed (maintainer needs more info) » Active

I was able to replicate the issue by enabling Gutenberg filter on other text formats other than Gutenberg blocks text format.
My first impressions is that it seems it is a core issue or just a missing step that needs to be implemented when uninstalling the module. I'll try do some debugging and test with other filters/text formats.

szeidler’s picture

For me the bug only occurs in 8.x-2.x. In 8.x-2.0-beta2 I don't get the error when uninstalling Gutenberg.

That means the bug seems to be related to the change in 8.x-2.x that all Gutenberg filters have been merged together into one single filter. I didn't had the time to investigate it more, but I somehow have the gut feeling, that it's related the the config schema for the new filter.

thorandre’s picture

Issue tags: +2.x-rc-blocker

Adding the #2.x-rc-blocker for this, with the exception of this truly being caused by the mentioned core issue.

Worst case we'll find a way to document how to get around this issue if we're not able to figure out exactly what is causing it before pushing a 2.x release candidate.

thorandre’s picture

Priority: Critical » Normal
Issue tags: -2.x-rc-blocker

Clearing cache can help as a workaround here. Also before uninstalling the module you must unset the text filter in the configuration.

Still weird that this is not happening on earlier versions of Gutenberg.

Changing this to "Normal" as reactivating the module and removing the textfilter will handle the issue. Since this issue is not acutally breaking data on the site, we're not considering this critical.

ty10086’s picture

This same problem is in drupal 9.2.0, uninstall gutenbureg 3 mudules.

superbiche’s picture

Hi,

Same issue with 2.0.0 / Drupal 9.2.4.

Removing the Gutenberg filter from every text format doesn't make disabling safe, the error still happens despite disabling Gutenberg everywhere, removing the filter everywhere, even truncating the cache_discovery table.

The only way to avoid the WSOD situation was to...keep Gutenberg enabled.

xpersonas’s picture

Same here. 2.0.0 / Drupal 9.2.6.

Once this module is installed, it's a lifetime commitment. There's no going back to life before.

richard.lampitt’s picture

I'm having the same issue, and what appears to be happening is that Gutenberg's configuration is persisting in the config for the text formats despite manually editing and removing the Gutenberg dependency.

As an example, here's the change for my filter.format.restricted_html.yml file:

 uuid: 3e62864f-85a3-4ec3-896d-eed27dee08ad
 langcode: en
 status: true
-dependencies:
-  module:
-    - gutenberg
+dependencies: {  }
 _core:
   default_config_hash: KUjJ8Ti_ZJSlhGM88E_mhJP-8mmQRNUB6RFof615Kt0
 name: 'Restricted HTML'
 format: restricted_html
 weight: -7
@@ -30,12 +28,5 @@ filters:
     provider: filter
     status: true
     weight: 0
     settings:
       filter_url_length: 72
-  gutenberg:
-    id: gutenberg
-    provider: gutenberg
-    status: false
-    weight: 0
-    settings:
-      processor_settings: {  }

The import completes successfully, but the database isn't updated to reflect this change. Exporting the config after import restores the changes.

Because Gutenberg is still listed as a dependency on the text format, the uninstall falls over.

I can't manually edit the database table for the config because the data is stored as a blob.

DennisBradenton’s picture

Same issue here. Uninstalling Gutenberg breaks Drupal. The only way to recover is with drush.

AH01071: Got error 'PHP message: Uncaught PHP Exception Drupal\\Component\\Plugin\\Exception\\PluginNotFoundException: "The "gutenberg" plugin does not exist. Valid plugin IDs for Drupal\\filter\\FilterPluginManager are: filter_adsense, editor_file_reference, filter_caption, filter_html_escape, filter_align, filter_html_image_secure, filter_autop, filter_null, filter_html, filter_htmlcorrector, filter_url, filter_field_mapping, filter_comment_delimiter, filter_block, filter_mapping_fields, filter_media_entity_block, filter_reusable_block, filter_oembed, media_embed, token_filter" at /public_html/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php line 53'

How to uninstall this successfully?

szeidler’s picture

I found a similar an issue, which is challenging the same problem with views plugins at #2635728: Uninstalling a module providing display extenders causes fatal errors. It is also mentioning the problem we experience here with text formats. So it's clearly a core bug, but it should be possible to clean up the leftovers of Gutenberg in other text formats while uninstalling it.

szeidler’s picture

Status: Active » Needs review
Issue tags: +v2.2
StatusFileSize
new1.14 KB

Could you please test the attached patch? In my manual tests that seems to have solved the issue by removing all fragments of the text filter in other text formats.

DennisBradenton’s picture

Thanks a lot for the patch. This solved the issue! I was able to uninstall gutenberg without issues now.

marcofernandes’s picture

Status: Needs review » Fixed

Tested and it seems good. Great work @szeidler ;)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.