Circular reference detected for service "plugin.manager.eca.action", path: "plugin.manager.eca.action -> eca.service.action".

Created on 6 April 2025, 18 days ago

Problem/Motivation

The trio of modules (eca, modeler_api and bpmn_io) can not be installed.

Steps to reproduce

  1. clone eca branch 3.0.x
  2. clone modeler_api branch 1.0.x
  3. clone bpmn_io branch 3.0.x
  4. enable all three modules

Observe that drush reports the error: Circular reference detected for service "plugin.manager.eca.action", path: "plugin.manager.eca.action -> eca.service.action". which was rendered by the Container object on line 147.

Proposed resolution

Track down the circular reference and attempt a fix.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @cosmicdreams
  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul

    I was able to get the error to reoccur when manually enabling additional modules. This time I got a full call stack

    The website encountered an unexpected error. Try again later.
    
    Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "plugin.manager.eca.action", path: "plugin.manager.eca.action -> eca.service.action". in Drupal\Component\DependencyInjection\Container->get() (line 147 of core/lib/Drupal/Component/DependencyInjection/Container.php).
    Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() (Line: 237)
    Drupal\Component\DependencyInjection\Container->createService() (Line: 177)
    Drupal\Component\DependencyInjection\Container->get() (Line: 72)
    Drupal\eca_ui\Plugin\modeler_api_model_owner\Eca::create() (Line: 21)
    Drupal\Core\Plugin\Factory\ContainerFactory->createInstance() (Line: 85)
    Drupal\Component\Plugin\PluginManagerBase->createInstance() (Line: 30)
    modeler_api_entity_type_build() (Line: 118)
    Drupal\Core\Entity\EntityTypeManager->Drupal\Core\Entity\{closure}() (Line: 315)
    Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 117)
    Drupal\Core\Entity\EntityTypeManager->findDefinitions() (Line: 213)
    Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() (Line: 25)
    Drupal\Core\Plugin\DefaultPluginManager->getDefinition() (Line: 132)
    Drupal\Core\Entity\EntityTypeManager->getDefinition() (Line: 100)
    Drupal\eca\PluginManager\Action->setCacheBackend() (Line: 38)
    Drupal\Core\Action\ActionManager->__construct() (Line: 259)
    Drupal\Component\DependencyInjection\Container->createService() (Line: 177)
    Drupal\Component\DependencyInjection\Container->get() (Line: 430)
    Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() (Line: 463)
    Drupal\Component\DependencyInjection\Container->Drupal\Component\DependencyInjection\{closure}() (Line: 55)
    Drupal\Core\Plugin\CachedDiscoveryClearer->clearCachedDefinitions() (Line: 353)
    Drupal\Core\Extension\ModuleInstaller->doInstall() (Line: 229)
    Drupal\Core\Extension\ModuleInstaller->install() (Line: 83)
    Drupal\Core\ProxyClass\Extension\ModuleInstaller->install() (Line: 175)
    Drupal\system\Form\ModulesListConfirmForm->submitForm()
    call_user_func_array() (Line: 105)
    Drupal\Core\Form\FormSubmitter->executeSubmitHandlers() (Line: 43)
    Drupal\Core\Form\FormSubmitter->doSubmitForm() (Line: 589)
    Drupal\Core\Form\FormBuilder->processForm() (Line: 321)
    Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
    Drupal\Core\Controller\FormController->getContentResult()
    call_user_func_array() (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 600)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
    Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
    Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
    Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
    Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
    Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 53)
    Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 715)
    Drupal\Core\DrupalKernel->handle() (Line: 19)
    
  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul

    A bit of issue queue sluething has uncovered that this is a recurring problem for some modules. The solution is to change the approach to lazy loading dependencies not through constructor injection but in getter injection. A practical example of this can be found in: https://www.drupal.org/project/filelog/issues/3416342 πŸ› Circular reference detected for service Fixed

  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul

    I was able to determine that his bug actually belongs to the eca module. Specifically the eca_ui module.

  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul

    cosmicdreams β†’ changed the visibility of the branch 3517626--circular-reference to hidden.

  • Pipeline finished with Failed
    18 days ago
    Total: 668s
    #467011
  • First commit to issue fork.
  • Pipeline finished with Canceled
    18 days ago
    Total: 81s
    #467187
  • Pipeline finished with Skipped
    18 days ago
    #467197
  • Pipeline finished with Skipped
    18 days ago
    #467198
  • Pipeline finished with Failed
    18 days ago
    Total: 523s
    #467188
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Made some changes in the MR and also afterwards fixed the PHPDoc comments.

    As a folllow-up, I also created an issue in modeler_api: πŸ“Œ Optimize plugin managers Active

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen
Production build 0.71.5 2024