Investigating a Recursive Router Rebuild Error During Drupal 11 Upgrade Testing

Uncovering a Recursive Router Rebuild Error During a Drupal 11 Upgrade

Automated regression tests for a Drupal 11 upgrade exposed an installation failure that appeared unrelated to custom project code. In a ComputerMinds article published on 2 June 2026, James Williams described how a Recursive router rebuild detected exception surfaced during Drupal installation inside a DDEV-based GitHub Actions testing environment. The tests used phpunit, a custom install profile, and a fresh site installation to validate project behaviour during the upgrade.

Instead of treating the active exception stack as the full story, James used PHP’s debug_backtrace() function to store earlier executions of Drupal core’s route rebuild method in a static variable. That allowed him to inspect what he describes as a “great uncle” call stack, referring to an earlier execution path that had already completed before the later failure occurred. The stored trace showed that an earlier router rebuild had been interrupted by a handled exception, leaving Drupal in a state where a later rebuild triggered the recursive rebuild error.

The investigation traced the earlier rebuild attempt to Drupal core’s menu_link_content module. During configuration imports performed as part of site installation, entity deletions triggered menu link cleanup logic that required route information, causing an unexpected rebuild attempt. James resolved the test failure by using hook_module_implements_alter() to disable the relevant entity_predelete hook implementation during installation, presenting the case as both a specific Drupal 11 upgrade fix and a reusable debugging technique for complex control-flow problems.

Disclosure: This content is produced with the assistance of AI.

Disclaimer: The opinions expressed in this story do not necessarily represent that of TheDropTimes. We regularly share third-party blog posts that feature Drupal in good faith. TDT recommends Reader's discretion while consuming such content, as the veracity/authenticity of the story depends on the blogger and their motives. 

Note: The vision of this web portal is to help promote news and stories around the Drupal community and promote and celebrate the people and organizations in the community. We strive to create and distribute our content based on these content policy. If you see any omission/variation on this please reach out to us at #thedroptimes channel on Drupal Slack and we will try to address the issue as best we can.

Related Organizations

Related People

Upcoming Events

Latest Opportunities