Support from Acquia helps fund testing for Drupal Acquia logo

Comments

OnkelTem created an issue. See original summary.

OnkelTem’s picture

Issue summary: View changes
OnkelTem’s picture

Title: Circular reference detected for service "access_manager » Circular reference detected for service "access_manager"
lussoluca’s picture

On which core version?

OnkelTem’s picture

On which core version?

Drupal version is 8.0.5, which I specified above, if that's what you're asking...

leif98’s picture

I have also tried to install the webprofiler and it bricked my website. I am currently on 8.1.0

[21-Apr-2016 20:16:20 UTC] Uncaught PHP Exception Drupal\Core\Database\SchemaObjectExistsException: "Table webprofiler already exists." at /mnt/www/html/mysite/docroot/core/lib/Drupal/Core/Database/Schema.php line 592 request_id="v-e8b2c692-07fd-11e6-a153-22000be1c755"

[21-Apr-2016 20:17:11 UTC] Uncaught PHP Exception Symfony\Component\Routing\Exception\RouteNotFoundException: "Route "webprofiler.settings" does not exist." at /mnt/www/html/mysite/docroot/core/lib/Drupal/Core/Routing/RouteProvider.php line 186 request_id="v-0780c22c-07fe-11e6-8504-22000be1c755"
OnkelTem’s picture

@leif98

Seems like a different issue.

lussoluca’s picture

Status: Active » Closed (cannot reproduce)

Sorry I cannot reproduce this with both 8.0.5 and 8.1.3.
Feel free to reopen it if it occurs again.

Joao Informatico madrid’s picture

Hi.

I have exactly the same problem

louis.roy’s picture

Issue summary: View changes

Getting similar results here on Drupal 8.1.8 :

Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "access_manager", path: [error]
"plugin.cache_clearer -> plugin.manager.menu.local_action -> access_manager -> paramconverter_manager -> webprofiler.token_converter -> profiler ->
webprofiler.views -> views.executable -> views.views_data -> router". in
/Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php:147
Stack trace:
#0 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(494):
Drupal\Component\DependencyInjection\Container->get('access_manager', 1)
#1 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(236):
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#2 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(177):
Drupal\Component\DependencyInjection\Container->createService(Array, 'router')
#3 /Users/me/Projects/project/core/modules/user/src/Plugin/LanguageNegotiation/LanguageNegotiationUserAdmin.php(91):
Drupal\Component\DependencyInjection\Container->get('router')
#4 /Users/me/Projects/project/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(21):
Drupal\user\Plugin\LanguageNegotiation\LanguageNegotiationUserAdmin::create(Object(Drupal\Core\DependencyInjection\Container), Array, 'language-user-a...',
Array)
#5 /Users/me/Projects/project/core/lib/Drupal/Component/Plugin/PluginManagerBase.php(84):
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('language-user-a...', Array)
#6 /Users/me/Projects/project/core/modules/language/src/LanguageNegotiator.php(210):
Drupal\Component\Plugin\PluginManagerBase->createInstance('language-user-a...', Array)
#7 /Users/me/Projects/project/core/modules/language/src/LanguageNegotiator.php(186):
Drupal\language\LanguageNegotiator->getNegotiationMethodInstance('language-user-a...')
#8 /Users/me/Projects/project/core/modules/language/src/LanguageNegotiator.php(131):
Drupal\language\LanguageNegotiator->negotiateLanguage('language_interf...', 'language-user-a...')
#9 /Users/me/Projects/project/core/modules/language/src/ConfigurableLanguageManager.php(218):
Drupal\language\LanguageNegotiator->initializeType('language_interf...')
#10 /Users/me/Projects/project/core/modules/views/src/ViewsData.php(107): Drupal\language\ConfigurableLanguageManager->getCurrentLanguage()
#11 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(280):
Drupal\views\ViewsData->__construct(Object(Drupal\webprofiler\Cache\CacheBackendWrapper), Object(Drupal\webprofiler\Config\ConfigFactoryWrapper),
Object(Drupal\Core\Extension\ModuleHandler), Object(Drupal\language\ConfigurableLanguageManager))
#12 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(177):
Drupal\Component\DependencyInjection\Container->createService(Array, 'views.views_dat...')
#13 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(494):
Drupal\Component\DependencyInjection\Container->get('views.views_dat...', 1)
#14 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(236):
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#15 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(177):
Drupal\Component\DependencyInjection\Container->createService(Array, 'views.executabl...')
#16 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(494):
Drupal\Component\DependencyInjection\Container->get('views.executabl...', 1)
#17 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(236):
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#18 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(177):
Drupal\Component\DependencyInjection\Container->createService(Array, 'webprofiler.vie...')
#19 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(494):
Drupal\Component\DependencyInjection\Container->get('webprofiler.vie...', 1)
#20 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(329):
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#21 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(177):
Drupal\Component\DependencyInjection\Container->createService(Array, 'profiler')
#22 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(494):
Drupal\Component\DependencyInjection\Container->get('profiler', 1)
#23 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(236):
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#24 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(177):
Drupal\Component\DependencyInjection\Container->createService(Array, 'webprofiler.tok...')
#25 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(494):
Drupal\Component\DependencyInjection\Container->get('webprofiler.tok...', 1)
#26 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(329):
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#27 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(177):
Drupal\Component\DependencyInjection\Container->createService(Array, 'paramconverter_...')
#28 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(494):
Drupal\Component\DependencyInjection\Container->get('paramconverter_...', 1)
#29 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(236):
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#30 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(177):
Drupal\Component\DependencyInjection\Container->createService(Array, 'access_manager')
#31 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(494):
Drupal\Component\DependencyInjection\Container->get('access_manager', 1)
#32 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(236):
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#33 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(177):
Drupal\Component\DependencyInjection\Container->createService(Array, 'plugin.manager....')
#34 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(494):
Drupal\Component\DependencyInjection\Container->get('plugin.manager....', 1)
#35 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(329):
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#36 /Users/me/Projects/project/core/lib/Drupal/Component/DependencyInjection/Container.php(177):
Drupal\Component\DependencyInjection\Container->createService(Array, 'plugin.cache_cl...')
#37 /Users/me/Projects/project/core/lib/Drupal/Core/Extension/ModuleInstaller.php(200):
Drupal\Component\DependencyInjection\Container->get('plugin.cache_cl...')
#38 /Users/me/Projects/project/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install(Array,
true)
#39 /usr/local/Cellar/drush/8.1.3/libexec/commands/core/drupal/environment.inc(131): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array, true)
#40 /usr/local/Cellar/drush/8.1.3/libexec/commands/core/drupal/environment.inc(198): drush_module_install(Array)
#41 /usr/local/Cellar/drush/8.1.3/libexec/commands/pm/pm.drush.inc(1167): drush_module_enable(Array)
#42 /usr/local/Cellar/drush/8.1.3/libexec/includes/command.inc(373): drush_pm_enable('webprofiler')
#43 /usr/local/Cellar/drush/8.1.3/libexec/includes/command.inc(224): _drush_invoke_hooks(Array, Array)
#44 /usr/local/Cellar/drush/8.1.3/libexec/includes/command.inc(192): drush_command('webprofiler')
#45 /usr/local/Cellar/drush/8.1.3/libexec/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#46 /usr/local/Cellar/drush/8.1.3/libexec/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#47 /usr/local/Cellar/drush/8.1.3/libexec/drush.php(12): drush_main()
#48 {main}

reekris’s picture

Status: Closed (cannot reproduce) » Active

I'm reopening this since it seems people still have this problem. I'm also experiencing this issue when installing Webprofiler on 8.1.8 with Devel 8.x-1.0-alpha1. Getting same stack trace as above, and it bricks my site completely, I have to restore a backup to get it running again.

Seems like it only happens if I have the views module installed while installing Webprofiler. Commenting out the following code in WebprofilerServiceProvider.php makes the installation work:

// Add ViewsDataCollector only if Views module is enabled.
    if (isset($modules['views'])) {
      $container->register('webprofiler.views', 'Drupal\webprofiler\DataCollector\ViewsDataCollector')
        ->addArgument(new Reference(('views.executable')))
        ->addArgument(new Reference(('entity.manager')))
        ->addTag('data_collector', [
          'template' => '@webprofiler/Collector/views.html.twig',
          'id' => 'views',
          'title' => 'Views',
          'priority' => 75,
        ]);
    }
Echofive’s picture

FileSize
7.36 KB

Hello,

I confirm the post #11 of reekris.

I try to install the Web Profiler and I get the same error.
If I put the (above) part of code into a PHP comment, I can install the module.
I also confirm that the fact to enable the module with this piece of code "executed" create an error (see just below) and the web site is unavailable.

The website encountered an unexpected error. Please try again later.
Symfony\Component\Routing\Exception\RouteNotFoundException: Route "webprofiler.settings" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 187 of core/lib/Drupal/Core/Routing/RouteProvider.php).

If the Web Profiler module install fail, I get the uploaded stack trace.

I use Drupal 8.2.2 (commit: 71894fa) and Devel 8.x-1.0-alpha1 (datestamp: 1466782415) with PHP 7.0.12
Note that I use Drush to install the module.

So, to temporary fix this issue.

  1. I download Devel.
  2. I enable the Devel module first.
  3. I DO A FUCKING BACKUP OF MY DB.
  4. I add a comment around the piece of code.
    /modules/contrib/devel/webprofiler/src/WebprofilerServiceProvider.php, line 42 to 52.
  5. I enable the Web Profiler module.
  6. I uncomment the previously commented lines.

I hope that this can help somebody to understand this error.

Thanks to reekris ;)

Kind regards,
Echofive

lussoluca’s picture

The weird thing is that from the stack trace it seems that views.views_data depends on router but I cannot find any evidence of this in code. Devel is the only contrib module do you have installed or there are something more?

Echofive’s picture

FileSize
5.59 KB

Hi lussoluca,

Thanks for your reply.
No, there is other contrib + custom modules used, our project is under development.

I join the list of all enabled modules (core + contrib).
For some confidentiality reasons, I can't show the custom modules.

If you have an idea, let me know ;)

Kind regards,
Echofive

lussoluca’s picture

Could you please look into the modules you have installed for classes with name ending in "ServiceProvider"?
If found, does any of this classes do something with views.views_data service?

Thanks

hupu’s picture

I have the same issue, but I solved the problem by running /update.php (even if there is nothing to update in the db) after the installation of webprofiler.

tormu’s picture

I had the alpha1 installed but the profiler was not enabled - just Devel. Now I updated to beta1, ran drush updb and tried to enable the profiler - the site crashes.
Error seems to be the same Circular reference detected for service "access_manager", path: "plugin.cache_clearer -> plugin.manager.menu.local_action -> access_manager -> paramconverter_manager -> webprofiler.token_converter -> profiler -> webprofiler.views -> views.executable -> views.views_data -> router"

..and after navigating to for example /admin I get Route "webprofiler.settings" does not exist - and this now happens everywhere. Uninstalling module reverts the site in working order again.

Searched the modules/contrib for anything related to "ServiceProvider", attached the shot - am I providing anything useful? No custom modules that contain the same string anywhere. Not at all familiar with OOP so not sure how to provide more info. I searched all the six files for "views_data" but that didn't pop out in any of those files.

The site is a Commerce site (with commerce beta5) if that might provide any help on what the stack might be.

lussoluca’s picture

Status: Active » Needs review
FileSize
1.99 KB

I've found the problem: it is an hidden dependency that pops-up only when more that 2 languages are enabled AND the "Account administration pages" language negotiation is enabled.
The language module (from core) replace the LanguageManager with ConfigurableLanguageManager that in turn loads all language negotiations plugins. One of that (the language-user-admin one) ask for the router service and cause the circular reference.

The only solution that I see is to remove the dependency in Webprofiler.

  • lussoluca committed a492f4b on 8.x-1.x
    Issue #2710787 by lussoluca: Circular reference detected for service "...
lussoluca’s picture

Status: Needs review » Fixed

Committed and pushed to 8.x-1.x

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.