Circular reference detected for service

Created on 13 March 2022, over 3 years ago
Updated 29 August 2025, 16 days ago

Problem/Motivation

Upon installing the module with workspaces enabled.

Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "workspaces_moderation.manager", path: "options_request_listener -> router.route_provider -> path_processor_manager -> workspaces_negotiator_path.path_processor_domain -> workspaces_moderation.manager -> logger.channel.workspaces -> logger.factory -> logger.raven". in Drupal\Component\DependencyInjection\Container->get() (line 143 of core/lib/Drupal/Component/DependencyInjection/Container.php).

Steps to reproduce

Install both this module and workspaces.

πŸ› Bug report
Status

Closed: works as designed

Version

3.2

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom 3li U.K. πŸ‡¬πŸ‡§

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom farse

    I am getting a similar error but with "workspaces.manager"
    "The website encountered an unexpected error. Try again later.

    Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "workspaces.manager", path: "options_request_listener -> router.route_provider -> path_processor_manager -> path_alias.path_processor -> Drupal\path_alias\AliasManagerInterface -> path_alias.repository -> workspaces.manager -> logger.channel.workspaces -> logger.factory -> logger.raven -> symfony_mailer.override_manager -> config.manager -> Drupal\Core\Entity\EntityRepositoryInterface". in Drupal\Component\DependencyInjection\Container->get() (line 147 of core/lib/Drupal/Component/DependencyInjection/Container.php)."

    I don't have any custom code modifying any workspace so am a bit stuck.

  • πŸ‡¬πŸ‡§United Kingdom farse

    Found an issue in Workspace https://www.drupal.org/project/workspace/issues/2927552 πŸ› Circular reference detected for service Active

  • πŸ‡¬πŸ‡§United Kingdom farse

    the issue for my was with symfony mailer. and raven I couldn't install the latest version so I opted to use symfony lite instead and that solved the problem.

  • πŸ‡³πŸ‡΄Norway vegardjo

    Opening again, sorry if it is not the correct place. We are not using Workspace or Symfony mailer.

    I get this issue in Drupal 11.2.3 after enabling Layout Builder (as a dependency of Navigation module, but I get it also after disabling Navigation, but not LB).

    When clearing cache via Drush I get:

    In Container.php line 147:

    Circular reference detected for service "raven.config", 
    path: "cache_tags.invalidator -> plugin.manager.block -> logger.channel.default -> logger.factory -> logger.raven -> raven.config -> config.factory -> raven.seckit_overrider".
    
  • πŸ‡ΊπŸ‡ΈUnited States mfb San Francisco

    For anyone seeing a circular reference, please provide steps to reproduce from a fresh install of Drupal core. This would include which contrib module(s) and how they need to be configured to reproduce the bug. (If a custom module is required to reproduce the bug, please upload or link to some example reproduce code.)

    For extra bonus points you could open a merge request with a failing test :)

  • πŸ‡³πŸ‡΄Norway vegardjo

    Thanks, I tried a fresh version now:

    1. Fresh install of Drupal core, standard install
    2. composer require drupal/raven
    3. drush en raven
    4. drush cr -> [success] Cache rebuild complete.
    5. drush en layout_builder
    6. drush cr -> Circular reference detected for service "raven.config", path: "cache_tags.invalidator -> plugin.manager.block -> logger.channel.default -> logger.factory -> logger.raven -> raven.config -> config.factory -> raven.seckit_overrider".

    I'll poke around a bit more, but I'm not really grasping the full issue here I think, so don't hold your breath :)

  • πŸ‡³πŸ‡΄Norway vegardjo

    Can confirm that by not injecting the config in https://git.drupalcode.org/project/raven/-/blob/7.x/src/Config/SecKitOve... (but rather reading the values directly from within loadOverrides) my issue is resolved. I will try to find some time the coming days / week to make a MR.

  • πŸ‡ΊπŸ‡ΈUnited States mfb San Francisco

    Please test the MR - I believe this should resolve the issue by refactoring config to "properly" override (rather than having a special snowflake config service).

  • πŸ‡³πŸ‡΄Norway vegardjo

    Thanks for your swift reaction, seems indeed like a solid solution!

    I have applied the MR as a patch to both the fresh site and the original site where I first saw it, and applying it removes the error on both sites when following the process in my comment #8.

    I have not tested anything more, as we don't use seckit or any overrides AFAIK, but let me know if I can be to any more assistance.

    • mfb β†’ committed 55c0374a on 7.x
      Issue #3269293 by mfb, vegardjo: Refactor config due to circular...
  • πŸ‡ΊπŸ‡ΈUnited States mfb San Francisco

    For future reference, this ideally would've been filed as a new issue, as it was a new bug in the 7.x branch, but in any case thanks for reporting

  • Now that this issue is closed, please review the contribution record.

    As a contributor, attribute any organization helped you, or if you volunteered your own time.

    Maintainers, please credit people who helped resolve this issue.

  • πŸ‡ΊπŸ‡ΈUnited States mfb San Francisco

    @farse on the current 7.x branch I am still seeing a ServiceCircularReferenceException if I install symfony_mailer module and core workspaces_ui module along with any logger that uses config, such as core syslog module or Raven module.

    Given that the issue also affects core syslog module, I would say the issue should ideally be resolved in either symfony_mailer or core?

    There might be some workaround we could do in Raven module, but I'm not sure off hand what that would be, aside from no longer using config..

Production build 0.71.5 2024