#1606794: Implement new routing system added a new routing system, which is pulled out of drupal_container.
Something isn't being built early enough when using drush.
$ drush cc all
WD php: Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: The service definition "router.builder" does not exist. in [error]
Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition() (line 690 of
/Users/tim/www/d8/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php).
Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: The service definition "router.builder" does not exist. in Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition() (line 690 of /Users/tim/www/d8/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php).
Drush command terminated abnormally due to an unrecoverable error.
Comments
Comment #1
moshe weitzman commentedDrush does a full bootstrap and then calls drupal_flush_all_caches(). I think that function is assuming a web request which is not always true. That function makes the fatal call to drupal_container(). Moving this bug to Drupal core.
Comment #2
moshe weitzman commentedComment #3
Crell commentedThis is yet another facet of the "Drupal doesn't work without a Kernel" problem, which is a factor in several issues. The solution to all of them is "always use a kernel". For command line, the ideal solution is "put the Console component in core, and use a kernel with it."
Comment #4
yesct commented#1801230: Drush cache clear doesn't work with latest 8.x HEAD marked as a duplicate of this issue
Comment #5
moshe weitzman commentedI played with this a bit today and fixed the cache-clear problem by doing in drush a lot of what index.php is doing
This instantiates an httpkernel which makes no sense for a cli request but works for now. Hopefully someone can share some pseudocode which lets us setup an App kernel or whatever is appropriate.
There is a similar error in drush site-install command but i can't bear to debug the installer right now. Anyway, this is now fixed for all drush commands that do full bootstrap.