Reported by @agentrickard on IRC - Not sure where to categorize this for now, so I put this in "base system".

When installing a fresh HEAD with "drush si", you get several (three)
"WD menu: RouteNotFoundException: Route "field_ui.overview.comment" does not exist." exceptions.
The install process keeps going (thanks to drush forked-process batch handling ?) and seems to finish correctly.

Stepping through a debugger:
The exceptions are raised within theme_enable() / theme_disable() (standard install enables bartik, disables stark, enables seven -> 3 calls, matching the three exceptions)
- theme_(en|dis)able() triggers menu_router_rebuild() / menu_router_build()
- menu_router_build() calls every hook_menu(), and on each entry with a 'route name', tries to find the corresponding route.
At this point, field_ui_menu() is seen, but its Drupal\field_ui\Routing\RouteSubscriber hasn't been triggered yet, and the routes referenced in field_ui_menu() do not exist -> Exception
- Drupal\field_ui\Routing\RouteSubscriber only runs later in the install process, during the drupal_flush_all_caches() call in _install_profile_modules_finished() (batch 'finished' callback for the install_profile_modules() install task)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yched’s picture

Title: RouteNotFoundException exceptions during install » RouteNotFoundException exceptions during "drush si" on D8
Project: Drupal core » Drush
Version: 8.x-dev » 8.x-6.x-dev
Component: base system » Core Commands

Looks like this does not affect installs through the UI, so re-assigning to drush

moshe weitzman’s picture

Project: Drush » Drupal core
Version: 8.x-6.x-dev » 8.x-dev
Component: Core Commands » install system

I've noticed this too. Thanks for the debug trace.

Drush just calls install_drupal(). This is core's bug, and specifically triggerred by core's non-interactive installer. Help wanted.

clemens.tolboom’s picture

This issue was reported in drush #1969850: RouteNotFoundException: Route "path_delete" does not exist but this issue describes the cause better.

clemens.tolboom’s picture

I forgot to add that in #1969850: RouteNotFoundException: Route "path_delete" does not exist that this is also the case when installed manually the core/install.php
- http://drupal.d8/admin/reports/dblog
which contradicts #1. I'll double check by another walkthrough of the issue summary.

clemens.tolboom’s picture

Title: RouteNotFoundException exceptions during "drush si" on D8 » Menu Rebuilding to late causing RouteNotFoundException during install
Status: Active » Needs review
FileSize
490 bytes

We have only two modules providing a RouteSubscriber: field_ui and rest.

Changing standard profile by not including field_ui but rest in standard.info.yml gives the following on http://drupal.d8/admin/reports/dblog

Symfony\Component\Routing\Exception\RouteNotFoundException: Route "path_delete" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 146 of /Users/clemens/Sites/drupal/d8/www/core/lib/Drupal/Core/Routing/RouteProvider.php).

The error comes from path/path.module: hook_menu().

So this has not much to do with RouteSubscriber as well with menu rebuilding.

Attached patch seems to fix the issue but this should have a test.

yched’s picture

(yched) Looks like this does not affect installs through the UI
(clemens.tolboom) This is also the case when installed manually the core/install.php - See admin/reports/dblog

Ah, right, when I tested, UI install seemed to work fine, but I didn't check the status log after that.

Not too sure where this should be fixed, but I don't think standard_install() is the right place, since other install profiles will be affected as well.

clemens.tolboom’s picture

I agree current patch is not how it should be solved. But I have no clue how it should be solved. Let alone how to write a test for it.

Should we add this to

 function module_enable() {
...
  drupal_flush_all_caches();
}

?

clemens.tolboom’s picture

The weird part is we are enabling modules and then the 'module' standard.install 'decides' it'll configures the system. We have no clue the profile is about the get installed.

Attached patch prepend enabling the current profile with drupal_flush_all_caches(); in _install_module_batch

moshe weitzman’s picture

The installer is already extremely slow. We should not slow it down further with cache flushes unless we really understand why they are there, and document it.

clemens.tolboom’s picture

@moshe weitzman agreed.

Install_core.inc has 2 calls to drupal_flush_all_caches
- function install_finished
- function _install_profile_modules_finished
Esp. the latter looks weird as it's a one liner. Which of the two is really needed?

While debugging I wondered why we didn't make the profile installed last or even after all modules are enabled? That requires another batch step.

function install_base_system(&$install_state) {
...
  // The installation profile is also a module, which needs to be installed
  // after all the dependencies have been installed.
  $modules[] = drupal_get_profile();

IMHO a profile is not just another module.

Does this related to #1356276: Allow profiles to define a base/parent profile?

moshe weitzman’s picture

Yeah, I think the profile should go last, and futher it could add itself at the end as a task (or something) and not try to masquerade a module. Sounds like a relatively easy fix.

dcrocks’s picture

Is this going anywhere. I can verify that #8 eliminates the messages but is not a desirable fix.

dcrocks’s picture

I haven't seen these messages in recent installs of 8-x.dev)several weeks). Haven't tried drush though. Can this be closed?

clemens.tolboom’s picture

Status: Needs review » Closed (cannot reproduce)

@dcrocks thanks for check back.

I've checked both web/interactive install and drush site-install. There is no RouteNotFoundException exception anymore.

I haven't found the code change for this fix. Candidate files are install.core.inc, module.inc, ModuleHandler.php, theme.inc and menu.inc

#2004784: Move module install/uninstall implementations into ModuleInstaller
#1992606: Convert system_theme_settings to FormInterface
#1947720: Use Drupal::state() to replace state()

With drush I had this unrelated error
WD cron: Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: The service definition "keyvalue.expirable.null" does not exist. in Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition() (line 875 of /Users/clemens/Sites/drupal/d8/www/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php). [error]

Issue will be closed.

clemens.tolboom’s picture

Issue summary: View changes

typo