Posted by tim.plunkett on October 2, 2012 at 2:31pm
10 followers
Jump to:
| Project: | Drupal core |
| Version: | 8.x-dev |
| Component: | base system |
| Category: | bug report |
| Priority: | major |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | symfony, WSCCI, wscci-hitlist |
Issue Summary
#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
#1
Drush 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.
#2
#3
This 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."
#4
#1801230: Drush cache clear doesn't work with latest 8.x HEAD marked as a duplicate of this issue
#5
I played with this a bit today and fixed the cache-clear problem by doing in drush a lot of what index.php is doing
drupal_bootstrap(DRUPAL_BOOTSTRAP_CODE);// global $kernel;
$kernel = new Drupal\Core\DrupalKernel('prod', drush_get_context('DRUSH_DEBUG', FALSE));
$kernel->boot();
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.
#6
Automatically closed -- issue fixed for 2 weeks with no activity.