Circular reference detected for service "authentication_subscriber"

Created on 4 April 2024, 9 months ago
Updated 20 August 2024, 4 months ago

Problem/Motivation

Not sure if the problem is related to this module or the domain_role module. But soon I tried to enable the domain_role module, and the simple_oauth module started to throw this fatal error. Any idea to resolve this?

The website encountered an unexpected error. Please try again later.
Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "authentication_subscriber", path: "authentication_subscriber -> authentication -> authentication_collector -> simple_oauth.authentication.simple_oauth -> simple_oauth.server.resource_server.factory -> simple_oauth.repositories.access_token -> serializer". in Drupal\Component\DependencyInjection\Container->get() (line 147 of core/lib/Drupal/Component/DependencyInjection/Container.php).
Drupal\Component\DependencyInjection\Container->get('authentication_subscriber') (Line: 105)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.exception') (Line: 239)
Symfony\Component\HttpKernel\HttpKernel->handleThrowable(Object, Object, 1) (Line: 91)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 54)
Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

  1. Install and enable simple oauth module, configure this for REST APIs
  2. Install domain modules and add a couple of domain records
  3. Install domain_role module and this throws this error
🐛 Bug report
Status

Closed: works as designed

Version

6.0

Component

Code

Created by

🇮🇳India anuragsharmam

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

Comments & Activities

  • Issue created by @anuragsharmam
  • 🇮🇪Ireland marksmith

    Also received this error after updating the SimpleOAuth module the new beta6 version via composer (and before running update.php). The site appears to be working normally after running update.php.

  • 🇦🇪United Arab Emirates ThirstySix

    Update issue.
    Yes, It's fixed after drush updb

  • Status changed to Closed: works as designed 5 months ago
  • 🇭🇺Hungary djg_tram

    Most definitively not solved and hardly as designed. It succeeded in making my site completely unusable after installation (fortunately not a production site but still). Error message as above. Cache refresh goes without issues. DB update say nothing to update. I can't remove it because drush pmu cannot find the 'secret' and 'confidential' fields in the 'consumers' table. You cannot add those manually because the schema will refresh them, of course. Complete checkmate. I'll find a way out somehow but you can be dead sure I'll never revisit the module. :-)

    (Addendum, .install should warn about the required packages. You should never rely on everybody using composer to install. I looked into composer.json first because I was cautious but if a module breaks without its required packages then do you homework to make it clear before installation. And document it clearly.)

  • 🇳🇱Netherlands bojan_dev

    The project page and README.md does mention that it uses the PHP library "OAuth 2.0 Server". Also installing modules via composer is the recommended way, the following quote covers it:

    The recommended way of adding a module is with Composer, especially for modules that have dependencies. Several modules will just not work if you only add the zip / tar.gz file.

    Source: https://www.drupal.org/docs/extending-drupal/installing-modules#s-severa...

Production build 0.71.5 2024