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

CommentFileSizeAuthor
#11 3456138.patch2.21 KBmauro_
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

maxilein created an issue. See original summary.

maxilein’s picture

Issue summary: View changes
maxilein’s picture

drush cr runs fine and gives no error.
I've have increased the php memory_limit to 2048M just to make sure.

maxilein’s picture

Project: Drupal core » Hook Event Dispatcher
Version: 10.3.x-dev » 4.1.x-dev
Component: base system » Code
Priority: Normal » Critical
maxilein’s picture

Version: 4.1.x-dev » 4.0.1
maxilein’s picture

It is also happening with 4.1.x dev than with 4.0.1
But the loading of pages gets a lot further...

maxilein’s picture

Version: 4.0.1 » 4.1.x-dev
maxilein’s picture

I 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

jelle_s’s picture

After some digging around, I found #3436599: Replace RequestCloseSubscriber with needs_destruction tag on ModuleHandler, where Drupal core's ModuleHandler got the needs_destruction service tag. It seems that since HookEventDispatcherModuleHandler decorates that service, it also has the needs_destruction tag, meaning that it should probably also implement Drupal\Core\DestructableInterface and the destruct method. That interface has existed since Drupal 8.0.0, so it's safe to implement without having any BC breaks.

mauro_’s picture

StatusFileSize
new2.21 KB

I 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.

el7cosmos’s picture

Version: 4.1.x-dev » 4.x-dev
Status: Active » Needs review

  • el7cosmos committed 9ac7ec18 on 4.x authored by Jelle_S
    Issue #3456138 by Jelle_S, Mauro_, maxilein, el7cosmos: Call to...
el7cosmos’s picture

Status: Needs review » Fixed

  • el7cosmos committed a89a84bf on 4.1.x authored by Jelle_S
    Issue #3456138 by Jelle_S, Mauro_, maxilein, el7cosmos: Call to...

Status: Fixed » Closed (fixed)

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