Problem/Motivation
After upgrading to 10.3 from 10.2.7 the site is somehow incomplete:
drush updb ran smoothly without errors.
[Fri Jun 21 08:31:15.469325 2024] [php:notice] [pid 1156] [client IP:51322] Error: Call to undefined method Drupal\\hook_event_dispatcher\\HookEventDispatcherModuleHandler::destruct() in /var/www/web/core/lib/Drupal/Core/DrupalKernel.php on line 723 #0 /var/www/web/index.php(22): Drupal\\Core\\DrupalKernel->terminate()\n#1 {main}, referer: https://site/admin/reports/updates
That's all I have.
I cannot drush un module. Because the module does not exist...
So I think something happens during starting the site up.
The error is displayed on all pages at the bottom, just as if the loading of the page was interrupted.
How do I troubleshoot this to get to the root of the problem?
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comments
Comment #2
maxilein commentedComment #3
maxilein commenteddrush cr runs fine and gives no error.
I've have increased the php memory_limit to 2048M just to make sure.
Comment #4
maxilein commentedComment #5
maxilein commentedComment #6
maxilein commentedIt is also happening with 4.1.x dev than with 4.0.1
But the loading of pages gets a lot further...
Comment #7
maxilein commentedComment #8
maxilein commentedI had to go back to D10.2.7:
then uninstall
the module Content Dependency Tracker and Core Event Dispatcher which was why I needed hook_event_dispatcher in the first place.
Then the upgrade to D10.3 worked. The error is gone.
I added an issue for Content dependency tracker because I cannot locate the root cause. https://www.drupal.org/project/cdt/issues/3456165
Comment #9
jelle_sAfter some digging around, I found #3436599: Replace RequestCloseSubscriber with needs_destruction tag on ModuleHandler, where Drupal core's ModuleHandler got the
needs_destructionservice tag. It seems that sinceHookEventDispatcherModuleHandlerdecorates that service, it also has theneeds_destructiontag, meaning that it should probably also implementDrupal\Core\DestructableInterfaceand thedestructmethod. That interface has existed since Drupal 8.0.0, so it's safe to implement without having any BC breaks.Comment #11
mauro_ commentedI agree with Jelle_S and I think the solution of #10 seems adequate. Thanks!
Here's a patch for anyone who needs to upgrade quickly.
Comment #12
el7cosmosComment #14
el7cosmos