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.
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | gutenberg-remove_config_leftovers_on_uninstall-3204782-16.patch | 1.14 KB | szeidler |
Comments
Comment #2
marcofernandes commentedCan 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.
Comment #3
marcofernandes commentedBtw, to try to fix it, enable Gutenberg module again and then first disable the Gutenberg blocks text format and then uninstall the module.
Comment #4
gisleI'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:
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:
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 BlocksI 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.
Comment #5
marcofernandes commentedI 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.
Comment #6
marcofernandes commentedComment #7
szeidler commentedFor 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.
Comment #8
thorandre commentedAdding 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.
Comment #9
thorandre commentedClearing 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.
Comment #10
ty10086 commentedThis same problem is in drupal 9.2.0, uninstall gutenbureg 3 mudules.
Comment #11
superbiche commentedHi,
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.
Comment #12
xpersonas commentedSame 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.
Comment #13
richard.lampitt commentedI'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:
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.
Comment #14
DennisBradenton commentedSame issue here. Uninstalling Gutenberg breaks Drupal. The only way to recover is with drush.
How to uninstall this successfully?
Comment #15
szeidler commentedI 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.
Comment #16
szeidler commentedCould 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.
Comment #17
DennisBradenton commentedThanks a lot for the patch. This solved the issue! I was able to uninstall gutenberg without issues now.
Comment #19
marcofernandes commentedTested and it seems good. Great work @szeidler ;)