Getting following exceptions on a fresh drupal 8 installation while running drush command. I am using Drush Version : 7.0-dev
Additional uncaught exception thrown while handling exception.Original
Drupal\Core\DependencyInjection\ContainerNotInitializedException: \Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container. in Drupal::getContainer() (line 129 of /Library/WebServer/Documents/drupal-8/core/lib/Drupal.php).
Drupal::getContainer() drupal8_bootstrap(0) _drush_bootstrap_drupal_configuration() drush_bootstrap(3, 5) drush_bootstrap_to_phase(5) Drush\Boot\DrupalBoot->bootstrap_and_dispatch() drush_main()
Additional
Drupal\Core\DependencyInjection\ContainerNotInitializedException: \Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container. in Drupal::getContainer() (line 129 of /Library/WebServer/Documents/drupal-8/core/lib/Drupal.php).
Drupal::getContainer() Drupal::theme() _drupal_log_error(Array, 1) _drupal_exception_handler(Object)
Drush command terminated abnormally due to an unrecoverable error. [error]
Comments
Comment #1
berdirYou need to update drush to the latest dev-master (or possibly an alpha, I don't know).
Comment #2
adhariwal commented@Berdir, It did not help. I updated my drush to the latest dev-master and run the command again but receiving this error again.
Comment #3
adhariwal commentedComment #4
adhariwal commentedmy drush version:
Drush Version : 7.0.0-alpha9 and running drush cc all command returns this error:
exception [error]
'Drupal\Core\DependencyInjection\ContainerNotInitializedException'
with message '\Drupal::$container is not initialized yet.
\Drupal::setContainer() must be called with a real container.' in
/Library/WebServer/Documents/drupal-8/core/lib/Drupal.php:129
Stack trace:
#0 /Library/WebServer/Documents/drupal-8/core/lib/Drupal.php(454):
Drupal::getContainer()
#1 /usr/local/bin/drush/commands/core/views.d8.drush.inc(458):
Drupal::moduleHandler()
#2 [internal function]: views_drush_cache_clear(Array)
#3 /usr/local/bin/drush/includes/command.inc(1294):
call_user_func_array('views_drush_cac...', Array)
#4 /usr/local/bin/drush/commands/core/cache.drush.inc(238):
drush_command_invoke_all_ref('drush_cache_cle...', Array)
#5 /usr/local/bin/drush/commands/core/cache.drush.inc(100):
drush_cache_clear_types(false)
#6 [internal function]: drush_cache_clear_pre_validate('all')
#7 /usr/local/bin/drush/includes/command.inc(359):
call_user_func_array('drush_cache_cle...', Array)
#8 /usr/local/bin/drush/includes/command.inc(210):
_drush_invoke_hooks(Array, Array)
#9 [internal function]: drush_command('all')
#10 /usr/local/bin/drush/includes/command.inc(178):
call_user_func_array('drush_command', Array)
#11 /usr/local/bin/drush/lib/Drush/Boot/DrupalBoot.php(68):
drush_dispatch(Array)
#12 /usr/local/bin/drush/drush.php(71):
Drush\Boot\DrupalBoot->bootstrap_and_dispatch()
#13 /usr/local/bin/drush/drush.php(11): drush_main()
#14 {main}
Comment #5
adhariwal commentedComment #6
joshi.rohit100I am facing same issue ):
Comment #7
berdirAre you sure that you didn't see https://github.com/drush-ops/drush/pull/1230, which was broken yesterday?
@adhariwal: I have no idea why that command is even doing something for you, drush cc all in D8 doesn't work, use drush cr.
drush cc all gives me just this:
$ drush cc all
`cache-clear all` is deprecated for Drupal 8 and later. Please use the `cache-rebuild` command instead.
Comment #9
kanzer commentedThe same problem a new drupal-8-beta-9 site.
Drush version : 7.0-devI upgrade drush today:
composer global updateI get an error:
with sites drupal 7 everything works fine
Comment #10
mgiffordI updated drush against the git repository when I ran into this error. It's working fine for me now in D8.
Comment #11
picacsso commentedStill not working for me. Only command that works is drush cr. When i attempt drush cc all I get the same error as reported by previous users.
Here's my setup:
Drush was attempting to connect to:
Drupal version : 8.0.0-beta10
Site URI : http://default
Database driver : mysql
Database hostname : localhost
Database port : 3306
Database username : root
Database name : drupal8
PHP configuration : /Applications/MAMP/bin/php/php5.4.26/conf/php.ini
PHP OS : Darwin
Drush script : /Users/macbook/drush/drush.php
Drush version : 7.0-dev
Drush temp : /tmp
directory
Drush configuration :
Drush alias files :
Drupal root : /Users/macbook/Sites/drupal8/drupal
Site path : sites/default
Active config path : sites/default/files/config_3_ymvnHNz0lDihkBUuaFWa5dPPiqax910aXDJBpwIC_VEgRfniAs91z5Y_aaKvU6je
X2vDFLOQ/active
Staging config path : sites/default/files/config_3_ymvnHNz0lDihkBUuaFWa5dPPiqax910aXDJBpwIC_VEgRfniAs91z5Y_aaKvU6je
X2vDFLOQ/staging
Attempted to enable a custom module (tried this from different directories withing D8 and still nada):
Comment #12
artofeclipse commentedHi, I was facing the same issue as @emko_one, but and I got it fixed by doing some updates to my composer installation and make sure that I have mysql.sock in /tmp/ folder.
the new version of MAMP store the tmp files by default in his own folder, so make sure to add a symlink to your tmp.
I hope help some.
Thanks.
Comment #13
nikky171091 commentedI am facing same issue ):
Comment #14
nikky171091 commentedGot the solution
drush cr all
Comment #15
helonaut commented@artofeclipse Thanks man, when I got a new laptop I installed the new version of MAMP and had the same problem. Going into /tmp and creating a symlink to the MAMP socket file was the solution:
Comment #16
jmaguniaI was also getting this error:
exception 'Drupal\Core\DependencyInjection\ContainerNotInitializedException' with message '\Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container.' in [error] /OBSCURED/core/lib/Drupal.php:129SQLite users should check to make sure their DB is writable by the user who is executing drush.
Comment #17
aangel commentedThis person cleared the problem by changing file permissions.
Comment #18
sjerdoNvm. Seems like I commented on the wrong issue.
I experience this error when executing drush php-eval.
Comment #19
ressaI was getting the error below, and found this issue:
Setting /tmp write permissions to 777 fixed it.