After installing mobile_tools DRUSH stopped working.

Here is a debug trace:

drush -d cc
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.04 sec, 2.2 MB]                                                                                                                      [bootstrap]
Initialized Drupal 6.16 root directory at /home/mybreathbiofeedback.com/web/public [0.05 sec, 2.7 MB]                                                                                             [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.06 sec, 2.76 MB]                                                                                                                     [bootstrap]
Initialized Drupal site mybreathbiofeedback.com at sites/default [0.12 sec, 2.85 MB]                                                                                                              [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.13 sec, 2.9 MB]                                                                                                             [bootstrap]
PDO support not available. Could not pre-validate database credentials. Assuming success [0.14 sec, 2.91 MB]                                                                                   [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.14 sec, 2.91 MB]                                                                                                                 [bootstrap]
Successfully connected to the Drupal database. [0.14 sec, 2.91 MB]                                                                                                                             [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.15 sec, 3.12 MB]                                                                                                                     [bootstrap]
session_start(): Cannot send session cookie - headers already sent by (output started at /opt/local/share/drush/includes/drush.inc:660) bootstrap.inc:1037 [0.15 sec, 3.18 MB]                 [warning]
session_start(): Cannot send session cache limiter - headers already sent (output started at /opt/local/share/drush/includes/drush.inc:660) bootstrap.inc:1037 [0.15 sec, 3.18 MB]             [warning]
Constant DRUPAL_MINIMUM_PHP_MEMORY_LIMIT already defined drupal_tweaks.module:17 [0.16 sec, 3.72 MB]                                                                                              [notice]
Undefined index:  SERVER_NAME mobile_tools.module:728 [0.17 sec, 4.02 MB]                                                                                                                         [notice]
Cannot modify header information - headers already sent by (output started at /opt/local/share/drush/includes/drush.inc:660) mobile_tools.module:410 [0.17 sec, 4.02 MB]                       [warning]
Undefined index:  parent browscap.module:85 [0.17 sec, 4.05 MB]                                                                                                                                   [notice]
Cannot modify header information - headers already sent by (output started at /opt/local/share/drush/includes/drush.inc:660) mobile_tools.module:906 [0.18 sec, 4.78 MB]                       [warning]
Drush command could not be completed. [0.18 sec, 4.78 MB]
CommentFileSizeAuthor
#4 diff.patch92.57 KBkbalderson
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sasconsul’s picture

Version: 6.x-1.9 » 6.x-1.12

Sorry, I reported the wrong version number.

deverman’s picture

yes we are also experiencing this problem with drush version 3.1 and it is very painful to manage our servers now as we need to disable the module each time. Would really like a fix for this.

kbalderson’s picture

subscribing

kbalderson’s picture

FileSize
92.57 KB

So i think i have a fix for this. I check to see if a drush function is available, and if it is, i skip over the hook_boot command.

  if (function_exists('drush_verify_cli')) {
    return;
  }

That code goes before anything else in the function 'mobile_tools_boot'.

I attached a patch... not sure if i did it right.

kbalderson’s picture

Status: Active » Needs review
twom’s picture

Assigned: Unassigned » twom
Status: Needs review » Fixed

I replaced the reference from SERVER_NAME to HTTP_HOST with an exra check if this variable is set...

Can you test the dev version (that contains multple changes, so be aware that it is a dev release)

Tom

kbalderson’s picture

I tested the -dev and it worked great for me. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

ricardoamaro’s picture

Hi,

This is still not resolved.

If you enable "mobile_tools" and check this option:
"Enable automatic redirection of the mobile user"

Now try to run Drush and it will fail:

drush -v status
Initialized Drupal 6.19 root directory at ..../public_html [notice]
Initialized Drupal site default at sites/default [notice]
session_start(): Cannot send session cookie - headers already sent by (output started at [warning]
drush.inc:871) bootstrap.inc:1162
session_start(): Cannot send session cache limiter - headers already sent (output started at [warning]
drush/includes/drush.inc:871) bootstrap.inc:1162
Undefined index: SERVER_NAME mobile_tools.module:728 [notice]
Cannot modify header information - headers already sent by (output started at [warning]
drush/includes/drush.inc:871) mobile_tools.module:410
Cannot modify header information - headers already sent by (output started at [warning]
drush/includes/drush.inc:871) mobile_tools.module:906
Drush command could not be completed. [error]

This is happening with the latest version of drush (3.3) and mobile_tools stable 6.x-1.12 and dev

Could the maintainers of mobile_tools please help us here??

Thanks!

ricardoamaro’s picture

Priority: Normal » Critical
Status: Closed (fixed) » Needs work

bump??

jimbox’s picture

had to disable mobile_tools to facilitate using drush again.

twom’s picture

I am working on this issue.

The strange thing is that it works fine in my install.

What configuration are you using (php version, apache/IIS, ... )?

twom’s picture

Status: Needs work » Needs review

I have added an extra check to see if the $_SERVER variable is set.

Mainly it comes down that if you run drush, you use php from the command line. Of course no SERVER_NAME or HTTP_HOST is set then.

If you have error_reporting E_STRICT enabled, it will give an error message.

Can you try the new dev version?

twom’s picture

Status: Needs review » Closed (fixed)
silvio’s picture

Status: Closed (fixed) » Active

Still having this problem even with the 6.x dev version. Seems that solution proposed at #1139540: drush incompatibility is the way to go.

twom’s picture

Status: Active » Fixed

I have added the fix in the dev version! Thx for the feedback.

sterndata’s picture

The solution is easy:

drush -l http://my.website.address [drush commands]

If you tell drush the site name, it's not confused by the redirection.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

bkosborne’s picture

I'm still getting this problem with 2.3 (which was released after this was supposedly fixed?). I see the fixed code is in current dev for 6.x but not 6.x-2.3.

Could we get a new release for this?