Drush Incompatible With Secure Pages Module
Brian@brianpucc... - May 25, 2009 - 16:42
| Project: | Drush |
| Version: | All-Versions-HEAD |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | duplicate |
Jump to:
Description
Clean download of drush results in the following errors:
exampledotcom@server1:~/web $ drush status
Drush command could not be completed. [error]
Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in /home/exampledotcom/web/includes/database.mysqli.inc on line 323
Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in /home/exampledotcom/web/includes/database.mysqli.inc on line 323
Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in /home/exampledotcom/web/includes/database.mysqli.inc on line 323
Warning: mysqli_query() expects parameter 1 to be mysqli, null given in /home/exampledotcom/web/includes/database.mysqli.inc on line 108
Warning: mysqli_errno() expects parameter 1 to be mysqli, null given in /home/exampledotcom/web/includes/database.mysqli.inc on line 122
Warning: mysqli_affected_rows() expects parameter 1 to be mysqli, null given in /home/exampledotcom/web/includes/database.mysqli.inc on line 200
exampledotcom@server1:~/web $This is a fairly new D6.12 install. Everything else on the site works fine. Please let me know if there's anything else I should be looking at.

#1
perhap pass in --root and --uri params. also add --debug to see more messages.
#2
please reopen if needed.
#3
Sorry for not getting back to you sooner.
exampledotcom@server1:~/web $ drush --root=/home/exampledotcom/web/ --uri=http://www.example.com/ --debug statusFound command: status [0.016 sec] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.016 sec] [bootstrap]
Initialized Drupal 6.12 root directory at [notice]
/home/exampledotcom/web/ [0.024 sec]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.024 sec] [bootstrap]
Initialized Drupal site www.example.com at sites/default [notice]
[0.031 sec]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [bootstrap]
[0.031 sec]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.034 [bootstrap]
sec]
Successfully connected to the Drupal database. [0.034 sec] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.04 sec] [bootstrap]
session_start(): Cannot send session cookie - headers already sent by[warning]
(output started at
/home/exampledotcom/drush/includes/drush.inc:439) [0.041 sec]
session_start(): Cannot send session cache limiter - headers already [warning]
sent (output started at
/home/exampledotcom/drush/includes/drush.inc:439) [0.041 sec]
Cannot modify header information - headers already sent by (output [warning]
started at /home/exampledotcom/drush/includes/drush.inc:439)
[0.053 sec]
Drush command could not be completed. [0.055 sec] [error]
mysqli_real_escape_string() expects parameter 1 to be mysqli, null [warning]
given [0.055 sec]
mysqli_real_escape_string() expects parameter 1 to be mysqli, null [warning]
given [0.055 sec]
mysqli_real_escape_string() expects parameter 1 to be mysqli, null [warning]
given [0.055 sec]
mysqli_query() expects parameter 1 to be mysqli, null given [0.055 [warning]
sec]
mysqli_errno() expects parameter 1 to be mysqli, null given [0.055 [warning]
sec]
mysqli_affected_rows() expects parameter 1 to be mysqli, null given [warning]
[0.055 sec]
exampledotcom@server1:~/web $ drush --root=/home/exampledotcom/web/ --uri=http://example.com/ --debug status
Found command: status [0.018 sec] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.018 sec] [bootstrap]
Initialized Drupal 6.12 root directory at [notice]
/home/exampledotcom/web/ [0.027 sec]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.027 sec] [bootstrap]
Initialized Drupal site example.com at sites/default [0.034 [notice]
sec]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [bootstrap]
[0.034 sec]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.037 [bootstrap]
sec]
Successfully connected to the Drupal database. [0.037 sec] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.043 sec] [bootstrap]
session_start(): Cannot send session cookie - headers already sent by[warning]
(output started at
/home/exampledotcom/drush/includes/drush.inc:439) [0.044 sec]
session_start(): Cannot send session cache limiter - headers already [warning]
sent (output started at
/home/exampledotcom/drush/includes/drush.inc:439) [0.044 sec]
Cannot modify header information - headers already sent by (output [warning]
started at /home/exampledotcom/drush/includes/drush.inc:439)
[0.085 sec]
Drush command could not be completed. [0.086 sec] [error]
mysqli_real_escape_string() expects parameter 1 to be mysqli, null [warning]
given [0.086 sec]
mysqli_real_escape_string() expects parameter 1 to be mysqli, null [warning]
given [0.086 sec]
mysqli_real_escape_string() expects parameter 1 to be mysqli, null [warning]
given [0.086 sec]
mysqli_query() expects parameter 1 to be mysqli, null given [0.086 [warning]
sec]
mysqli_errno() expects parameter 1 to be mysqli, null given [0.086 [warning]
sec]
mysqli_affected_rows() expects parameter 1 to be mysqli, null given [warning]
[0.086 sec]
exampledotcom@server1:~/web $
This user has a several other sites that it has access to and drush works just fine on them.
exampledotcom@server1:~/web $ cd ../staging/stagingsite1/exampledotcom@server1:~/staging/stagingsite1 $ drush status
PHP configuration : /etc/php5/cli/php.ini
Drupal Root : /home/exampledotcom/staging/stagingsite1
Drupal version : 6.12
Site Path : sites/default
Site URI : http://default
Database Driver : mysql
Database Hostname : server2.example.com
Database Username : stagingsite1
Database Name : stagingsite1
Database Password : ------------
Database : Connected
Drupal Bootstrap : Successful
Drupal User : Anonymous
exampledotcom@server1:~/staging/stagingsite1 $
#4
I had this exact same problem, and seem to have just fought my way out of it.
This happened to me with secure_pages enabled. Since secure_pages tries to redirect everything to the https version, it probably drives drush crazy. I think that's what happened to me.
To disable secure_pages I had to go to the system table in the database and set status=0:
update system set status=0 where name="securepages";#5
You should be able to fix this (without disabling the module in the database) this by adding the following to your drushrc.php file:
$conf = array(
'securepages_enable' => FALSE,
);
I add this to be settings.php on sandboxes for sites that use securepages module.
#6
@Owen Barton - Thanks for the tip (#5). Just to clarify - Do you add it to settings.php or to drushrc.php?
#7
@rfey - I add it to settings.php on my sandbox (since my sandbox is normally not set up with SSL), in which case adding it to drushrc.php is redundant.
If you use drush on a server where you actually want securepages enabled via the web interface, then you will need to add it to drushrc.php (since you can't add it to settings.php for obvious reasons).
#8
Yes, the secure pages module is the problem. However, adding that code to my drushrc.php file doesn't help. I added it below the "variable overrides" section.
#9
#10
I am flagging this issue as duplicate of #578448: $override in drushrc.php does not work because it gets re-initialized in DRUPAL_BOOTSTRAP_CONFIGURATION.
I got to this issue because of the same SecurePages problem but eventually this is not really a drush issue. I tried to use drushrc.php but it won't work, and I found a problem related to the $override in drush which I reported and submitted a patch in the duplicate issue.
#11
fyi, this is now fixed by #578448: $override in drushrc.php does not work because it gets re-initialized in DRUPAL_BOOTSTRAP_CONFIGURATION. thanks hanoii
#12
Thanks for your work guys - but has anyone got this to work with secure pages ok?
I've installed the lastest Drush - applied the patch from #578448 , and am calling drush with drushrc.php configured as suggested - and still getting the mysqli_real_escape issue...
Have I missed anything?