Closed (fixed)
Project:
Drush
Component:
Base system (internal API)
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Nov 2010 at 21:55 UTC
Updated:
22 Nov 2010 at 05:40 UTC
Jump to comment: Most recent file
Working on other issue I've found that DRUSH_DEBUG is set later than message logging starts. For example this is not shown without attached patch:
Bootstrap to phase 0. [0.04 sec, 1.13 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.05 sec, 1.27 MB] [bootstrap]
Loading drushrc "/etc/drush/drushrc.php" [bootstrap]
into "system" scope. [0.05 sec, 1.28 MB]
Other separate issue I'm mixing here is that errors in the validation of a bootstrap phase are never shown from drush_main(). This is a very useful log information we are not getting when people submit issues, and also useful to prevent support issues. As an example, with mysql stopped (not the better example though):
without patch:
$drush cc
SQLSTATE[HY000] [2002] Can't connect to local MySQL server through [warning]
socket '/var/run/mysqld/mysqld.sock' (2)
Command cache-clear needs a higher bootstrap level to run - you will [error]
need invoke drush from a more functional Drupal environment to run
this command.
The drush command 'cc' could not be executed. [error]
with patch:
drush cc
SQLSTATE[HY000] [2002] Can't connect to local MySQL server through [warning]
socket '/var/run/mysqld/mysqld.sock' (2)
Command cache-clear needs a higher bootstrap level to run - you will [error]
need invoke drush from a more functional Drupal environment to run
this command.
The drush command 'cc' could not be executed. [error]
Drush was not able to start (bootstrap) the Drupal database. [error]
Hint: This error often occurs when Drush is trying to bootstrap a
site that has not been installed or does not have a configured
database.
Drush was attempting to connect to :
Drupal version : 6.20-dev
Site URI : http://d6
Database driver : mysqli
Database hostname : localhost
Database username : root
Database name : drupal_6
Default theme : garland
Administration theme: garland
PHP configuration : /etc/php5/cli/php.ini
Drush version : 4.0-dev
Drush configuration:
/usr/src/drush-HEAD/examples/example.drushrc.php
Drupal root : /var/www/drupal-6.x-cvs
Site path : sites/d6
Modules path : sites/d6/modules
Themes path : sites/d6/themes
%paths : Array
You can select another site with a working database setup by
specifying the URI to use with the --uri parameter on the command
line or $options['uri'] in your drushrc.php file.
It seems that some change in the past put the access to that help information in the dark :/
Perhaps a cleaner approach can be made but just wanted to drop it here for feedback.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | drush-debug-messages-2.patch | 3.06 KB | greg.1.anderson |
| drush-debug-messages.diff | 3.07 KB | jonhattan |
Comments
Comment #1
greg.1.anderson commentedlooks good to me, except you shouldn't have removed
_drush_bootstrap_global_options();from the end of_drush_bootstrap_drush(), as that function must be called any time global options might be defined or redefined, e.g. inside a drushrc.php file, which_drush_bootstrap_drush()loads.Other than that, this patch tested out just fine.
Comment #2
moshe weitzman commentedOK, lets commit then. Nice catch.
Comment #3
greg.1.anderson commentedCommitted; wanted this in for testing aspects of #918468: drush.ini or php.ini? [Drush should use php.ini files in drush conf folders + some fixes for drush paths that contain spaces]