RuntimeException: Recursive router rebuild detected
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3556048. -->
Reported by: [mandclu](https://www.drupal.org/user/52136)
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>I was recently working on a site, and kept getting fatal errors whenever I tried to install a module. I noticed that modeler_api was mentioned in the output, and remembered installing it before the problems began. I uninstalled it, and the problems went away.</p>
<p>The full error output is:</p>
<pre>RuntimeException: Recursive router rebuild detected. in Drupal\Core\Routing\RouteBuilder->rebuild() (line 121 of core/lib/Drupal/Core/Routing/RouteBuilder.php).<br>Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild() (Line: 67)<br>Drupal\Core\Routing\RouteProviderLazyBuilder->getRouteProvider() (Line: 83)<br>Drupal\Core\Routing\RouteProviderLazyBuilder->getRouteByName() (Line: 541)<br>Drupal\modeler_api\Api->getRouteByName() (Line: 336)<br>Drupal\modeler_api\Hook\EntityHooks->systemInfoAlter() (Line: 474)<br>Drupal\Core\Extension\ModuleHandler->alter() (Line: 322)<br>Drupal\Core\Extension\ExtensionList->doList() (Line: 155)<br>Drupal\Core\Extension\ModuleExtensionList->doList() (Line: 284)<br>Drupal\Core\Extension\ExtensionList->getList() (Line: 408)<br>Drupal\Core\Extension\ExtensionList->recalculateInfo() (Line: 368)<br>Drupal\Core\Extension\ExtensionList->getAllAvailableInfo() (Line: 396)<br>Drupal\Core\Extension\ExtensionList->getAllInstalledInfo() (Line: 437)<br>Drupal\node\NodeViewsData->getNodeAccessImplementations() (Line: 99)<br>Drupal\node\NodeViewsData->getViewsData() (Line: 167)<br>Drupal\views\Hook\ViewsViewsHooks->viewsData() (Line: 219)<br>Drupal\views\ViewsData->Drupal\views\{closure}() (Line: 357)<br>Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 218)<br>Drupal\views\ViewsData->getData() (Line: 142)<br>Drupal\views\ViewsData->get() (Line: 94)<br>Drupal\views\Plugin\Derivative\ViewsEntityRow->getDerivativeDefinitions() (Line: 101)<br>Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives() (Line: 87)<br>Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() (Line: 340)<br>Drupal\Core\Plugin\DefaultPluginManager->findDefinitions() (Line: 216)<br>Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() (Line: 25)<br>Drupal\Core\Plugin\DefaultPluginManager->getDefinition() (Line: 16)<br>Drupal\Core\Plugin\Factory\ContainerFactory->createInstance() (Line: 85)<br>Drupal\Component\Plugin\PluginManagerBase->createInstance() (Line: 827)<br>Drupal\views\Plugin\views\display\DisplayPluginBase->getPlugin() (Line: 133)<br>Drupal\views\Plugin\views\style\StylePluginBase->init() (Line: 830)<br>Drupal\views\Plugin\views\display\DisplayPluginBase->getPlugin() (Line: 349)<br>Drupal\rest\Plugin\views\display\RestExport->collectRoutes() (Line: 119)<br>Drupal\views\EventSubscriber\RouteSubscriber->routes()<br>call_user_func() (Line: 146)<br>Drupal\Core\Routing\RouteBuilder->rebuild() (Line: 83)<br>Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild() (Line: 246)<br>Drupal\Core\Extension\ModuleInstaller->install() (Line: 83)<br>Drupal\Core\ProxyClass\Extension\ModuleInstaller->install() (Line: 508)<br>Drupal\system\Form\ModulesListForm->submitForm()<br>call_user_func_array() (Line: 105)<br>Drupal\Core\Form\FormSubmitter->executeSubmitHandlers() (Line: 43)<br>Drupal\Core\Form\FormSubmitter->doSubmitForm() (Line: 589)<br>Drupal\Core\Form\FormBuilder->processForm() (Line: 321)<br>Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)<br>Drupal\Core\Controller\FormController->getContentResult()<br>call_user_func_array() (Line: 123)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)<br>Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)<br>Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)<br>Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)<br>Drupal\Core\StackMiddleware\Session->handle() (Line: 48)<br>Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)<br>Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 116)<br>Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)<br>Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)<br>Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)<br>Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 53)<br>Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)<br>Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 716)<br>Drupal\Core\DrupalKernel->handle() (Line: 19)</pre><p>It's also worth noting that after the error, the modules would show as installed, but would exhibit problems. For example, the menu items would not be visible until after a cache clear, and I would see warnings about entity definition mismatches.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<p>Unfortunately I don't yet know how specifically to reproduce the problem. The site in question had a large number of modules enabled so I suspect there is an incompatibility with one of them.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3 id="summary-ui-changes">User interface changes</h3>
<h3 id="summary-api-changes">API changes</h3>
<h3 id="summary-data-model-changes">Data model changes</h3>
issue