I have recently started working with Drush commands. One of the errors I see when things are wierd are a bit like this:
% drush -v en aoh_taxonomy
Initialized Drupal 6.19 root directory at /Users/mikl/Sites/whatever [notice]
Initialized Drupal site default at sites/default [notice]
: in (line of ). [error]
Command pm-enable 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 'en we_taxonomy' could not be executed.
The “: in (line of ).” looks a bit like Drush is doing wierd stuff to the PHP error messages. This makes problems really hard to solve, since no errors are reported in logs either…
| Comment | File | Size | Author |
|---|---|---|---|
| #34 | 979672-by-kentr-workaround-warnings-in-drupal-core-b-D6.patch | 910 bytes | anarcat |
| #33 | 979672-by-kentr-workaround-warnings-in-drupal-core-b-D7.patch | 910 bytes | anarcat |
| #19 | drush-bootstrap-warnings-979672-19.patch | 585 bytes | kentr |
Comments
Comment #1
miklThe wierd thing is that if I remove the '-v' flag, the command completes with no errors?
Comment #2
moshe weitzman commentedPlease confirm on HEAD drush before reporting issues.
Comment #3
greg.1.anderson commentedDoesn't look like 3.3; looks like HEAD, post-#917650: Improve the state of drush error reporting during startup. Maybe some php.ini settings are preventing the file and line from being reported? Maybe I'm wrong, though. Do as Moshe said, confirm in HEAD, check your php.ini settings. See README.txt in HEAD.
Comment #4
miklI have the same issues with HEAD, and I have wierd stuff going on with loading my Drush functions. I had a shell open, that I had a Drush command working in when I was on my way home in the train yesterday. When I ran the same command from the same shell this morning, drush complained that it could not find it.
When I opened a new shell and tried to run the same command again, I first got the “Command aoh-convert-word-relations needs a higher bootstrap level” and the second (and following times I ran it), I got “The drush command 'aoh-convert-word-relations' could not be found.”.
I am confused… Can it perhaps be related to changing IP-address/computer hostname? I am on Mac OS X 10.6.5 if that's any help…
Comment #5
miklOh yeah, and I checked my php.ini. Nothing out of the ordinary. Only thing I've changed from the stock PHP 5.3.3 ini-file is the error logging.
Comment #6
jonhattanCan you post a complete trace with --debug?
Comment #7
miklYep, full trace here:
(I put the error in strong-tags for clarity).
Comment #8
miklI’ve tried running the same command with the same site on a Debian server (running PHP 5.3.3-0.dotdeb.1), and I get the same behaviour.
The Drush file I was working on when this problem started showing up looks like this:
Is is called `dsb_taxonomy.drush.inc`, located in `profiles/dsb/modules/dsb/dsb_taxonomy`, which is also the location of the eponymous module which is enabled.
Comment #9
c2j8g0g8 commentedHello,
I posted this first in the forums, http://drupal.org/node/998062. Somebody said here's probably a bettter place for it.
I just installed Drupal 6.
The site works really well. I can do eveything in my Drupal site I need to using the normal Web GUI.
Now I'm installing & configuring the modules I want.
I installed the Drush application to help with all that. It looks like a lot of people are using it.
I read the module site's suggestion to use the HEAD version. So I installed the drush-HEAD branch with CVS.
When I try to do anything with it I just get an error, ": in (line of )." like discussed in here. I don't just get it with that verbose flag but always.
I figured out to use the debug flag to get this output:
but I don't know what else to do with it.
Since I'm new at this I guess I probably made a mistake in configuring something. I don't know if it's Drupal or Drush or something else.
If anybody could help out I'd appreciate it.
Thanks a bunch.
Dale
Comment #10
bitradiator commentedWhere did you install Drush? From this "Loading drushrc "/home/dale/www/drushrc.php" into "drupal" scope. [0.06 sec, 3.01 [bootstrap] MB]" it appears to be in your Drupal install.
Try installing into /home/dale/bin/ and adding this to your .profile:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
Comment #11
jonhattanDue to the grow in memory usage it seems the error happen while bootstrapping drupal to full, and is reported by drush afterwards.
The only suggestion I have is to comment out ob_start() and ob_end_clean() in this function: http://api.drush.ws/api/drush/includes--environment.inc/function/_drush_...
...and see if it print some more indicative error.
Comment #12
jonhattanMoreover. I was unable to reproduce a similar problem allegedly caused by a password with special chars (#) in #994894: fatal ": in (line of )." error with all commands after upgrade to 4.0-rc3. Is that your case?
Comment #13
c2j8g0g8 commentedHello,
> #10
> Posted by bitradiator on December 14, 2010 at 11:18pm new
>
> Where did you install Drush? From this "Loading drushrc "/home/dale/www/drushrc.php" into "drupal"
> scope. [0.06 sec, 3.01 [bootstrap] MB]" it appears to be in your Drupal install.
>
> Try installing into /home/dale/bin/ and adding this to your .profile:
Drush is installed in /home/dale/drush
And I have a symlink
ls -al `which drush`
lrwxrwxrwx 1 root root 25 2010-11-08 11:45 /usr/local/bin/drush -> /home/dale/drush/drush
And in case it matters my shell is TCSH not BASH, where
echo $PATH
/root/bin:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/scripts:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/bin/X11:/usr/games
> #11
> Posted by jonhattan on December 15, 2010 at 1:50am new
>
> Due to the grow in memory usage it seems the error happen while bootstrapping drupal to full,
> and is reported by drush afterwards.
In case it matters
php -i | grep memory_limit
memory_limit => 128M => 128M
> The only suggestion I have is to comment out ob_start() and ob_end_clean() in this function:
> http://api.drush.ws/api/drush/includes--environment.inc/function/_drush_...
vi drush/includes/environment.inc
/**
* Attempt to load the full Drupal system.
*/
function _drush_bootstrap_drupal_full() {
- ob_start();
+ // ob_start();
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
- ob_end_clean();
+ // ob_end_clean();
> ...and see if it print some more indicative error.
It doesn't really look like it to me.
> #12
> Posted by jonhattan on December 15, 2010 at 3:03am new
>
> Moreover. I was unable to reproduce a similar problem allegedly caused by a
> password with special chars (#) in #994894: fatal ": in (line of )." error
> with all commands after upgrade to 4.0-rc3. Is that your case?
Here is what I have for my db_url string. The password is exact. It's just a test system for now.
$db_url = 'mysqli://DaleAdmin:12_ab_34_CD_5a_6f@localhost/dalezensite';
Reading around that bug and some others I did install drush-6.x-3.3.tar.gz and it works ok with none of that ": (line of}" error. So that seems like it's new or unique to drush-HEAD.
Oh, and I also saw with version 3.3 that if I move the MySQL socket location in my /etc/my.cnf , to /home/dale/var/run/mysql/mysql.sock for example, it's fine for Drupal and other stuff. But Drush complains about not being able to find the /var/run/mysql/mysql.sock socket. But if I make a symlink
ls -al /var/run/mysql
lrwxrwxrwx 1 mysql mysql 16 2010-12-11 14:58 /var/run/mysql -> /home/dale/var/run/mysql
Then drush v3.3 works OK again.
Dale
Comment #14
c2j8g0g8 commentedI tried the different Drush versions available on this. Here are the results.
(1) DRUSH == drush-HEAD (cvs)
(2) DRUSH == drush-6.x-4.0-rc3
(3) DRUSH == drush-All-versions-3.x-dev
(4) DRUSH == drush-6.x-3.3
Nothing changed between these cases except the drush version.
I repeated it all again on another Drupal installation, and have the same results as I did above.
Maybe that helps?
Dale
Comment #15
c2j8g0g8 commentedHi,
I provided what you'd asked for in both of your last messages.
Is there some additional info that I can provide?
Just hoping to get a working, up-to-date drush sytem. Or is the best advice to just forget about the newer versions and stick with the working 3.3?
Thanks!
Dale
Comment #16
greg.1.anderson commenteddrush-4 stable will be released shortly; sometime after that, the drush-3 line will be unsupported.
There isn't enough information here to determine what the problem is. You'll have to do some more investigation on your own if you want to keep up with drush advances.
Comment #17
c2j8g0g8 commentedSo I guess I have to abandon Vers3 soon enough.
What kind of info can I get for you? I'm not a developer that knows the code and how to debug it.
What more can I give you other than the debug output I pasted above from "drush pm-list -d"? Just let me know.
I don't really understand how it can be my Configuration that's the problem, Since it works OK for some versions of Drush and not for others.
And I guess its not just a problem for me because other people are seeing the same errors, right?
Comment #18
wulff commentedFWIW, setting
$conf['error_level'] = 0got rid of this error message in my case. (Drush 4.2 and Pressflow 6.)Comment #19
kentr commentedFor me on v3.3, the issue is pinpointed at line 753 of
includes/environment.incWhen error reporting is on and set to show E_WARNING, the
drupal_set_header('Content-Type: text/html; charset=utf-8');line of _drupal_bootstrap_full() generates a PHP warning, which is caught by
drupal_set_message(),then by
_drush_log_drupal_messages().Suppressing PHP warnings for that line only will eliminate this problem.
IMO, this is a cleaner solution than disabling error reporting for the site in general, because on dev installations people may want the PHP warnings in general. At least, I do.
Attaching a patch. Line numbers correlate to v3.3.
Comment #20
kentr commentedI posted the last comment before upgrading. The issue appears to be gone in v4.4.
And wouldn't you know it: v4.4 doesn't want to work for me in general. So I'm back to v3.3.
Comment #21
eugenmayer commentedjust wanted to state, the issue is not gone - its driving me crazy for days now.
using current head...
Its def. and drush issues, as the drupal instance works fine after that.
I tried to trace down the issue, and actually it is something pretty hard to find yet. It is 100% related to the full drupal bootstrap. Interestingly, it happens to work just a second before, when i run updatedb ( which does a drupal boostrap also ).
That those issues apear after the bootstrap is quiet normal, as
so drush _drush_log_drupal_messages(); takes out those errors out of the drupal boot ( so the drupal installation ), those errors seem to be "empty" or somewhat.
Comment #22
eugenmayer commentedconfirming that path #19 solves the issue!
Comment #23
greg.1.anderson commented#19 is okay, and could probably be committed if re-rolled against master and tested. I am a little concerned that hiding warnings here is just masking a more serious issue in Drupal core; if we hid all warnings, might we miss seeing future problems? Maybe they would not be problems if we hid them, though.
For the problem above, please see http://drupal.org/node/1174496, and see if maybe this is the same issue you are having. I always patch Drupal core with http://drupal.org/node/1174496#comment-4629384; perhaps this is the same thing you are seeing. It would be interesting to know if it was the same problem or something different.
Comment #24
greg.1.anderson commentedComment #25
moshe weitzman commentedI'm not too interested in hiding all warning during the major bootstrapping of drupal. We need to find the problem in Drupal and fix there if possible. I suspect that this is not a Drush issue.
Comment #26
eugenmayer commented#25 / #24: the drupal installation works flawlessly. And iam not just telling you that. In addition, when using drupal for the updaedb / bootstrap process, it works flawlessly. When drupal works without issue ( watchdog) on updatedb and later the bootstrap. So drush shall do this.
I would say, thats a drush issue, but hey, what else.
Comment #27
greg.1.anderson commentedIt would be interesting to know if the patch mentioned in #23 makes this go away for you.
I don't know that I am entirely convinced. It is possible that the same defect is happening under Drupal as Drush (php warning), and the symptoms of that are simply less obvious under Drupal, or perhaps you do not have warnings enabled in your webserver's php.ini, which would also mask the warning.
I'm kind of with moshe on not wanting to hide all warnings all the time during the Drupal bootstrap, because in other instances, we might miss something serious. For this particular issue, the symptom (warning) is more serious than the defect (mostly innocuous, but still definitely a Drupal problem); therefore, it might be worthwhile to have a drush option (
$options['i-want-to-remain-oblivious'] = TRUE;) to hide problems from people who just want to get their work done.Comment #28
eugenmayer commentedGreg i have debugged this to the bones, those errors are empty and i have not a slighly clue how to get deeper. I would neet to place a debug_backtrace into drupal_set_message to actually see what geenrates those errors. That is _very_ unusual or never seen in Drupal when you use a non-cli boostrap. Those errors never apear when bootstrap the drupal instance the normal way, those erros are not related to one installation, but at least 4/4 i tried ( different code bases, but similar).
As those errors never apear in drupal and the drupal installations are working fine, i expect this to be an issue on the drush side.
Hiding away issues - absolutely not my approach either. But - there are not issues most probably, those are false-positives. But yes, the cleaner solution is to find were it all comes from.
But marking that as an support-issue is, in my eyes wrong. That or that way - its def. a bug.
Comment #29
greg.1.anderson commentedI am not disagreeing or agreeing with you, but did you try the patch in #23?
Comment #30
eugenmayer commented@greg: well, i tried the #23 patch before, what did not solve my issue. Yet, its currently not applied, but it is already in our drupal-core pach list and will be rolled out when platform building works :) But as i said, tried it - did not help me.
Comment #31
greg.1.anderson commentedOkay. I'd be fine with a solution per #27, but final resolution of this issue will be up to moshe.
Comment #32
eugenmayer commentedjust verified, #23 does not fix it, #19 does
Comment #33
anarcat commentedI have witnessed this bug under Aegir 1.5 on CentOS 6.0 with PHP 5.3.2 and Drupal 6.22.
I can also confirm that #1174496: WSOD: drupal_error_handler() assumes filter_xss() is defined is not sufficient to fix this bug.
I rerolled the patch for Drush 5, but couldn't test there. I'll submit a Drush 4 patch later.
Comment #34
anarcat commented... and the attached patch works for Drush 4.
Now, I agree this is less than idea, but it's a worthy workaround. Without this I can't install Drupal 6 with Aegir's provision-install if --verbose is enabled.
Comment #35
anarcat commentedof course, the above suffixes should be D5 and D4, not D7 and D6. sorry for the confusion.
Comment #36
greg.1.anderson commentedI am still ambivalent about unconditionally hiding bootstrap warnings. I suppose I could cave on this issue if moshe has changed his mind about #25, but I think I would be happier if this behavior was controlled by a Drush global option per #27. Alternate names fine.
Comment #37
anarcat commentedactually, i agree. digging deeper into this, i found there was a bug in *pressflow's* use of t() in _drupal_log_error() (which is a D7 function!!!) that triggered this. for those stuck with the problem, replace the t() with a tr() in the drupal_set_message().
big wtf.
Comment #38
eugenmayer commented@37: D6 does not have a tr method, so this is rather a D7 fix?
Comment #39
anarcat commentedi meant strtr(). And this fix is for Pressflow, maybe also D7.