Problem/Motivation
Trying to get a brand new Drupal 11 site set up. Need to test Simple Oauth on this new site. Installing Consumers/Simple OAuth crashes site with a Circular reference detected for service "authentication_subscriber" error
Steps to reproduce
Install Drupal 11.0.0-beta-1.
Install consumers and simple_oauth via drupal_git and the repositories block of composer.json (gets around missing D11 patch for drupal/consumers:
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
},
{
"type": "package",
"package": {
"name": "drupal_git/consumers",
"version": "dev-1.x",
"type": "drupal-module",
"source": {
"url": "https://git.drupalcode.org/project/consumers.git",
"type": "git",
"reference": "8.x-1.x"
}
}
},
{
"type": "package",
"package": {
"name": "drupal_git/simple_oauth",
"version": "dev-6.0.x",
"type": "drupal-module",
"source": {
"url": "https://git.drupalcode.org/project/simple_oauth.git",
"type": "git",
"reference": "6.0.x"
}
}
}
],
Then later...
"extra": {
"patches": {
"drupal_git/consumers": {
"3429497 - Automated Drupal 11 compatibility fixes for consumers": "https://www.drupal.org/files/issues/2024-06-02/consumers.1.x-dev.rector.patch"
}
},
compoer require drupal_git/consumers drupal_git/simple_oauth
drush en simple_oauth
Full error as follows:
appserver_1 | [Wed Jul 10 21:37:34.987976 2024] [php:notice] [pid 2377] [client 172.240.2.2:44596] 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". in /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 147 #0 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(454): Drupal\\Component\\DependencyInjection\\Container->get('authentication_...', 1)\n#1 /app/vendor/symfony/event-dispatcher/EventDispatcher.php(243): Drupal\\Component\\DependencyInjection\\Container->Drupal\\Component\\DependencyInjection\\{closure}()\n#2 /app/vendor/symfony/event-dispatcher/EventDispatcher.php(206): Symfony\\Component\\EventDispatcher\\EventDispatcher::Symfony\\Component\\EventDispatcher\\{closure}(Object(Symfony\\Component\\HttpKernel\\Event\\ExceptionEvent), 'kernel.exceptio...', Object(Symfony\\Component\\EventDispatcher\\EventDispatcher))\n#3 /app/vendor/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\\Component\\EventDispatcher\\EventDispatcher->callListeners(Array, 'kernel.exceptio...', Object(Symfony\\Component\\HttpKernel\\Event\\ExceptionEvent))\n#4 /app/vendor/symfony/http-kernel/HttpKernel.php(241): Symfony\\Component\\EventDispatcher\\EventDispatcher->dispatch(Object(Symfony\\Component\\HttpKernel\\Event\\ExceptionEvent), 'kernel.exceptio...')\n#5 /app/vendor/symfony/http-kernel/HttpKernel.php(91): Symfony\\Component\\HttpKernel\\HttpKernel->handleThrowable(Object(Error), Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#6 /app/web/modules/contrib/simple_oauth/src/HttpMiddleware/BasicAuthSwap.php(54): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#7 /app/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Drupal\\simple_oauth\\HttpMiddleware\\BasicAuthSwap->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#8 /app/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\\Core\\StackMiddleware\\Session->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#9 /app/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\\Core\\StackMiddleware\\KernelPreHandle->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#10 /app/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\\Core\\StackMiddleware\\ContentLength->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#11 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\\big_pipe\\StackMiddleware\\ContentLength->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#12 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\\page_cache\\StackMiddleware\\PageCache->pass(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#13 /app/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\\page_cache\\StackMiddleware\\PageCache->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#14 /app/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\\Core\\StackMiddleware\\ReverseProxyMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#15 /app/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\\Core\\StackMiddleware\\NegotiationMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#16 /app/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\\Core\\StackMiddleware\\AjaxPageState->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#17 /app/web/core/lib/Drupal/Core/DrupalKernel.php(705): Drupal\\Core\\StackMiddleware\\StackedHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#18 /app/web/index.php(19): Drupal\\Core\\DrupalKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#19 {main}
This might be user error - investigating...