Closed (fixed)
Project:
Drush
Component:
Base system (internal API)
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Sep 2012 at 16:27 UTC
Updated:
8 Oct 2012 at 00:57 UTC
Jump to comment: Most recent file
The recent addition of config.storage and config.storage.staging means that before drupal_container() can be called the site's settings.php needs to be read.
The patch attached ensures that drush only uses the t() function when drupal_container() is safe to call.
Currently just typing drush on the CLI in a drupal 8 root directory at HEAD generates the following error:
PHP Fatal error: Uncaught exception 'Exception' with message 'The configuration directory type <em class="placeholder">active</em> does not exist.' in /Users/alex/dev/sites/drupal8alt.dev/core/includes/bootstrap.inc:496
Stack trace:
#0 /Users/alex/dev/sites/drupal8alt.dev/core/includes/bootstrap.inc(2447): config_get_config_directory('active')
#1 /Users/alex/dev/sites/drupal8alt.dev/core/includes/bootstrap.inc(2675): drupal_container()
#2 /Users/alex/dev/sites/drupal8alt.dev/core/includes/bootstrap.inc(1456): language('language_interf...')
#3 /Users/alex/dev/drush5/includes/output.inc(152): t('Initialized Dru...', Array)
#4 /Users/alex/dev/drush5/includes/bootstrap.inc(698): dt('Initialized Dru...', Array)
#5 /Users/alex/dev/drush5/includes/bootstrap.inc(185): _drush_bootstrap_drupal_root()
#6 /Users/alex/dev/drush5/includes/bootstrap.inc(345): drush_bootstrap(1, 3)
#7 /Users/alex/dev/drush5/commands/core/help.drush.inc(260): drush_bootstrap_max(3)
#8 [internal function]: drush_core_help()
#9 /Users/alex/dev/drush5/includes/c in /Users/alex/dev/sites/drupal8alt.dev/core/includes/bootstrap.inc on line 496
Fatal error: Uncaught exception 'Exception' with message 'The configuration directory type <em class="placeholder">active</em> does not exist.' in /Users/alex/dev/sites/drupal8alt.dev/core/includes/bootstrap.inc on line 496
Exception: The configuration directory type <em class="placeholder">active</em> does not exist. in /Users/alex/dev/sites/drupal8alt.dev/core/includes/bootstrap.inc on line 496
Call Stack:
0.0004 709584 1. {main}() /Users/alex/dev/drush5/drush.php:0
0.0155 5153000 2. drush_main() /Users/alex/dev/drush5/drush.php:14
0.0567 12112712 3. _drush_bootstrap_and_dispatch() /Users/alex/dev/drush5/drush.php:59
0.0719 12123264 4. drush_dispatch() /Users/alex/dev/drush5/drush.php:90
0.0985 12142096 5. call_user_func_array() /Users/alex/dev/drush5/includes/command.inc:165
0.0985 12142464 6. drush_command() /Users/alex/dev/drush5/includes/command.inc:165
0.0986 12142776 7. _drush_invoke_hooks() /Users/alex/dev/drush5/includes/command.inc:198
0.0991 12190776 8. call_user_func_array() /Users/alex/dev/drush5/includes/command.inc:324
0.0991 12191144 9. drush_core_help() /Users/alex/dev/drush5/includes/command.inc:324
0.0991 12191536 10. drush_bootstrap_max() /Users/alex/dev/drush5/commands/core/help.drush.inc:260
0.1001 12193544 11. drush_bootstrap() /Users/alex/dev/drush5/includes/bootstrap.inc:345
0.1006 12195448 12. _drush_bootstrap_drupal_root() /Users/alex/dev/drush5/includes/bootstrap.inc:185
0.1135 14903224 13. dt() /Users/alex/dev/drush5/includes/bootstrap.inc:698
0.1139 14999312 14. t() /Users/alex/dev/drush5/includes/output.inc:152
0.1139 14999776 15. language() /Users/alex/dev/sites/drupal8alt.dev/core/includes/bootstrap.inc:1456
0.1139 14999856 16. drupal_container() /Users/alex/dev/sites/drupal8alt.dev/core/includes/bootstrap.inc:2675
0.1164 15776192 17. config_get_config_directory() /Users/alex/dev/sites/drupal8alt.dev/core/includes/bootstrap.inc:2447
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Uncaught exception 'Exception' with message 'The configuration directory type <em class="placeholder">active</em> does not exist.' in /Users/alex/dev/sites/drupal8alt.dev/core/includes/bootstrap.inc:496
Stack trace:
#0 /Users/alex/dev/sites/drupal8alt.dev/core/includes/bootstrap.inc(2447): config_get_config_directory('active')
#1 /Users/alex/dev/sites/drupal8alt.dev/core/includes/bootstrap.inc(2675): drupal_container()
#2 /Users/alex/dev/sites/drupal8alt.dev/core/includes/bootstrap.inc(1456): language('language_interf...')
#3 /Users/alex/dev/drush5/includes/output.inc(152): t('Initialized Dru...', Array)
#4 /Users/alex/dev/drush5/includes/bootstrap.inc(698): dt('Initialized Dru...', Array)
#5 /Users/alex/dev/drush5/includes/bootstrap.inc(185): _drush_bootstrap_drupal_root()
#6 /Users/alex/dev/drush5/includes/bootstrap.inc(345): drush_bootstrap(1, 3)
#7 /Users/alex/dev/drush5/commands/core/help.drush.inc(260): drush_bootstrap_max(3)
#8 [internal function]: drush_core_help()
#9 /Users/alex/dev/drush5/includes/c in /Users/alex/dev/sites/drupal8alt.dev/core/includes/bootstrap.inc, line 496
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 1-2-interdiff.txt | 887 bytes | alexpott |
| #2 | 1773988-2.early-drupal-container.drush_.patch | 1.2 KB | alexpott |
| #1 | 1773988-1.early-drupal-container.drush_.patch | 1.04 KB | alexpott |
| config.early-drupal-container.drush_.patch | 1.04 KB | alexpott |
Comments
Comment #1
alexpottBetter and safer implementation - tested on Drupal 6,7,8
Comment #2
alexpottDoh! uploaded same patch... here goes again...
Comment #3
tim.plunkettI like the $output approach.
Works as expected.
Comment #4
moshe weitzman commentedThis reliance on drupal_container() is getting uglier. We already "fixed" this once.
Comment #6
psynaptic commentedDid this get fixed? I'm getting this error with a fresh Drupal 8.x and Devel 8.x-1.x.
Comment #7
alexpottAre you sure it's this error... or is it the new one :) that I'm getting see #1801082: drupal_flush_all_caches() assumes a web request - "The service definition "router.builder" does not exist. "
Comment #8
psynaptic commentedThanks for the swift reply, Alex.
It looks like this error. Here's what it spews:
Comment #9
psynaptic commentedHmm.. I just thought of something.
Comment #10
psynaptic commentedOk, I realised I was using an old drush... d'oh.
I'm now getting the new error :)