Running drush without arguments:
...
status Provides a birds-eye view of the current Drupal installation, if any.
Initialized Drupal 6.9 root directory at /home/wp/public_html/.../public [notice]
Initialized Drupal site default at sites/default [notice]
...
sql cli Open a SQL command-line interface using Drupalâs credentials.
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/drush/drush/includes/drush.inc:434) in /includes/bootstrap.inc on line 1019
Call Stack:
0.0005 82860 1. {main}() /home/drush/drush/drush.php:0
0.0064 677284 2. drush_main() /home/drush/drush/drush.php:26
0.0156 1151032 3. drush_dispatch($command = array ('description' => 'Print this help message. Use --filter to limit command list to one command file (e.g. --filter=pm)', 'bootstrap' => 0, 'options' => array ('-r <path>, --root=<path>' => 'Drupal root directory to use (default: current directory)', '-l <uri> , --uri=<uri>' => 'URI of the drupal site to use (only needed in multisite environments)', '-v, --verbose' => 'Display all available output', '-q, --quiet' => 'Hide all output', '-y, --yes' => 'Assume \'yes\' as answer to all prompts', '-s, --simulate' => 'Simulate all relevant actions (don\'t actually change the system)', '-i, --include' => 'A list of paths to search for drush commands', '-c, --config' => 'Specify a config file to use. See example.drushrc.php', '-u, --user' => 'Specify a user to login with. May be a name or a number.', '-b, --backend' => 'Hide all output and return structured data (internal use only).'), 'examples' => array ('drush dl cck zen' => 'Download CCK module and Zen theme.', 'drush --uri=http://example.com status' => 'Show status command for the example.com multi-site.'), 'commandfile' => 'core', 'path' => '/home/drush/drush/commands/core', 'engines' => array (), 'command' => 'help', 'callback' => 'drush_command', 'arguments' => array (), 'extras' => array (), 'core' => array (), 'scope' => 'site', 'drupal dependencies' => array (), 'drush dependencies' => array ())) /home/drush/drush/drush.php:65
0.0156 1151032 4. call_user_func_array('drush_command', array ()) /home/drush/drush/includes/drush.inc:23
0.0156 1151032 5. drush_command() /home/drush/drush/includes/drush.inc:0
0.0157 1151064 6. call_user_func_array('drush_invoke', array (0 => 'help')) /home/drush/drush/includes/command.inc:274
0.0157 1151064 7. drush_invoke($command = 'help') /home/drush/drush/includes/command.inc:0
0.0160 1151216 8. call_user_func_array('core_help', array ()) /home/drush/drush/includes/command.inc:226
0.0160 1151216 9. core_help() /home/drush/drush/includes/command.inc:0
0.0490 2723824 10. drush_bootstrap($phase = 5) /home/drush/drush/commands/core/core.drush.inc:137
0.0491 2723824 11. _drush_bootstrap_drupal_full() /home/drush/drush/includes/environment.inc:164
0.0491 2764812 12. drupal_bootstrap($phase = 8) /home/drush/drush/includes/environment.inc:523
0.0495 2765084 13. _drupal_bootstrap($phase = 4) /home/wp/public_html/dev.wielkapolandia.co.uk/public/includes/bootstrap.inc:971
0.0499 2799868 14. session_start() /home/wp/public_html/dev.wielkapolandia.co.uk/public/includes/bootstrap.inc:1019
Variables in local scope (#13):
$conf = array ('domain_bootstrap_modules' => array (0 => 'domain_prefix'))
$cache = *uninitialized*
$phase = 4
$cache_mode = *uninitialized*
How to get rid of this?
I've got at least 8 warnings similar to this.
Line drush.inc:434:
print str_repeat(' ', $indent) . (string)$message . "\n";
Comments
Comment #1
emackn commentedI see the same thing on HEAD
Comment #2
moshe weitzman commentedcannot reproduce
Comment #3
cdale commentedI get the same thing.
The warning's don't show up when I use the "-q" option, but I'm not sure if that is just suppressing the warnings, or causing them not to happen.
When I run with the "--verbose" option, I get the following: (The "-v" option does not appear to work as documented)
I don't know if that will be helpful or not. I'll keep digging and see what I can find.
Comment #4
cdale commentedNOTE: This only seems to affect outputting of the "help" command. Other commands seem to run as expected.
Comment #5
ccshannon commentedI found this thread because of a similar, non-DRUSH problem.
I have a command-line PHP script for importing external content into Drupal via a proprietary XML format. It will run from a cronjob when all is said and done.
When I run from the cli (note I changed some file and path names to protect the innocent):
FYI, line '115' in 'myscript.php' is a print statement that runs _BEFORE_ I invoke Drupal in my script.
When I move my Drupal invocation ahead of the print statement ... voila, no more PHP Warning!
Somehow line 434 in drush.inc is being executed before the code invokes Drupal bootstrap. Then, when Drupal bootstrap tries to start a session, PHP throws the warning.
Comment #6
moshe weitzman commentedFixed on Thursday.
Comment #8
asb commentedHi,
now I'm getting this strange error also (latest Drush All-Versions-HEAD from 2009-Oct-23).
Behaviour: Calling 'drush' from within Drupal's site root outputs an
Cannot modify header information - headers already sent by...; no command is being executed (excect 'drush sql conf', hmmm...). It simply doews nothing but outputting this error.Configuration: I'm running several Drupal sites on a dedicated Debian server ('Lenny'). 'drush' is working fine for all other sites, the affected site is quite new, I'm not running other modules than on the other sites.
Workaround: Even if the affected site is working fine, 'drush' seems to reuqire an addition "memory footprint". Increasing the PHP memory limit in settings.php solved the issue (e.g.
ini_set('memory_limit', '90M');.Stepts to reproduce: Take a random D6 site which requires a certain amount on PHP memory which you know of; decrease it in small steps until you find the minimal value where the site still runs fine; at this value, drush will most probably give the
Cannot modify header information - headers already sent by...error.I think this is at least partial a Drush issue since the site runs fine, just Drush requires more memory. If there's no sound way to determine the actual memory requirements, 'drush' could at least capture the error and give a hint to increase the PHP memory limit.
Thanks & greetings, -asb
PS: Feeling lucky to have drush back on the affected site ;)
Comment #9
frankcarey commentedMan, this was a bear to figure out! Headers already sent was a big red herring. The headers sent errror was probably an error sent by php, regarding lack of memory. causing the session_set() calls to fail. in my case we have memory limit set in .htaccess (I forget why) so this was using the large memory limit for the site, and a low (default) memory limit for the command line. I changed php.ini and it is back to functional. On some systems cli (command line) php has it's own settings, so that might be part of the issue for others.