- Issue created by @luckie joe
- ๐ซ๐ทFrance Quentin Harelle
I also have the issue at the moment, but only when enabling SDC, otherwise it was working well.
I'm going to test more.
- ๐ณ๐ฑNetherlands cleverhoods
I think it's attached to this issue: https://www.drupal.org/project/tracer/issues/3387444 ๐ Typed property Drupal\tracer\EventDispatcher\TraceableEventDispatcher::$tracer must not be accessed before initialization Fixed
After installing the update for Tracer(1.0.1), the issue got sorted. - ๐ณ๐ฑNetherlands cleverhoods
I think it's attached to this issue: https://www.drupal.org/project/tracer/issues/3387444 ๐ Typed property Drupal\tracer\EventDispatcher\TraceableEventDispatcher::$tracer must not be accessed before initialization Fixed
After installing the update for Tracer(1.0.1), the issue got sorted. - ๐ณ๐ฑNetherlands cleverhoods
The Tracer update didn't sort the issue out after all.
Hotfix patch is provided. - achap ๐ฆ๐บ
This also only occurred for me once I installed webprofiler. hook_event_dispatcher was working fine before then. Given that this is the case for others as well maybe this issue should be closed in favour of the related one in tracer?
- First commit to issue fork.
- Merge request !125Circular reference detected for service "hook_event_dispatcher.module_handler" โ (Merged) created by el7cosmos
-
el7cosmos โ
committed 7ecac0e4 on 4.x
Issue #3385203 by el7cosmos, cleverhoods, Luckie Joe: Circular reference...
-
el7cosmos โ
committed 7ecac0e4 on 4.x
- Status changed to Fixed
about 1 year ago 2:47pm 10 February 2024 Automatically closed - issue fixed for 2 weeks with no activity.
- ๐บ๐ธUnited States bob.hinrichs
This problem has resurfaced for us:
hook_event_dispatcher: 4.2.0
tracer: 1.0.4
drupal core: 10.4.5
We are running lando with a pantheon recipe (if that matters).When hook_event_dispatcher and tracer are enabled, and one runs drush updb, the following error results:
Circular reference detected for service "hook_event_dispatcher.module_handler", path: "hook_event_dispatcher.module_handler -> hook_event_dispatcher.manager -> hook_event_dispatcher.module_handler".
Some guesses as to why this is:
This error occurs during updb, because it has a special bootstrap mode that ensures all modules are loaded and update hooks are discovered in a single run, so it is instantiating the whole thing at once, and bringing the circular reference to light. Whereas in a normal page request, some services are only loaded on demand.
Tracerโs services include:
plugin.manager.tracer:
class: Drupal\tracer\TracerPluginManager
parent: default_plugin_managerTracerPluginManager extends Drupalโs DefaultPluginManager. That core base class automatically loads the module_handler. If you then have a circular dependency from module_handler โ hook_event_dispatcher.manager โ module_handler, enabling Tracer is the catalyst that triggers it during drush updb. \Drupal\tracer\TracerPluginManager extends DefaultPluginManager and calls parent::__construct. This parent class requires module_handler.
I will add an issue for tracer and cross-reference this, since I don't have enough understanding to know where the fix would reside, if a fix is possible.
Curious to see if this is reproducible by others.