1

To explain in specifics, when I run any drush command like drush en, drush fl or drush fra or any similar site specific commands, they don't get executed and I get the following output:

The drush command 'fl' could not be found. Run drush cache-clear drush to clear the [error] commandfile cache if you have installed new extensions. Drush was not able to start (bootstrap) the Drupal database. [error] Hint: This may occur when Drush is trying to: * bootstrap a site that has not been installed or does not have a configured database. In this case you can select another site with a working database setup by specifying the URI to use with the --uri parameter on the command line. See drush topic docs-aliases for details. * connect the database through a socket. The socket file may be wrong or the php-cli may have no access to it in a jailed shell.

Drush was attempting to connect to:

 Drupal version    : 7.41
  Site URI          : http:'slash''slash'default
  Database driver   : mysql
  Database hostname : 127.0.0.1
  Database username : bigscreen
  Database name     : bigscreen
  Default theme     : garland
  Administration theme: garland
  PHP configuration : /etc/php/7.0/cli/php.ini
  Drush version     : 5.10.0
  Drush configuration: 
  Drush alias files : /home/zeljko/.drush/bigscreen-vm.aliases.drushrc.php
  Drupal root       : /home/zeljko/MY_PROJECTS
  Site path         : sites/default
  Modules path      : sites/all/modules
  Themes path       : sites/all/themes
  File directory path: sites/default/files
  %paths            : Array

I already searched on google for different possible solution given on the output I got and as one of the tryout steps changed the hostname to 127.0.0.1 instead of localhost as some claimed that would solve the issue, but it did not. I also tried the obviously suggested drush cache-clear drush.

I can add that I installed behat on this website (which btw works) if this is somehow relevant to why this issue came afloat as the drush commands worked for me normally a few days ago.

I tried running drush --debug status which outputted the following if this can somehow help to solve the issue:

Bootstrap to phase 0. [0 sec, 2.09 MB]                               [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0 sec, 2.2 MB]     [bootstrap]
Cache HIT cid: 5.10.0-commandfiles-0-365c7dd2e2c4e12b4b7793c746ad2b63 [0.01 sec, 2.21 MB]     [debug]
Bootstrap to phase 0. [0.02 sec, 4.57 MB]                                                 [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.03 sec, 4.57 MB]                [bootstrap]
Initialized Drupal 7.41 root directory at /home/zeljko/MY_PROJECTS [0.03 sec, 5.57 MB]       [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.04 sec, 5.58 MB]                [bootstrap]
Initialized Drupal site default at sites/default [0.04 sec, 5.58 MB]                         [notice]
Cache HIT cid: 5.10.0-commandfiles-2-c32acd775c18a90c5b41d0fc9accf5ab [0.04 sec, 5.58 MB]     [debug]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.04 sec, 5.58 MB]       [bootstrap]
SQLSTATE[HY000] [1045] Access denied for user 'bigscreen'@'localhost' (using password:    [bootstrap]
YES) [0.04 sec, 5.66 MB]
Found command: core-status (commandfile=core) [0.04 sec, 5.65 MB]                         [bootstrap]
 Drupal version         :  7.41                                                 
 Site URI               :  http:'slash''slash'default                                       
 Database driver        :  mysql                                                
 Database hostname      :  127.0.0.1                                            
 Database username      :  bigscreen                                            
 Database name          :  bigscreen                                            
 Default theme          :  garland                                              
 Administration theme   :  garland                                              
 PHP configuration      :  /etc/php/7.0/cli/php.ini                             
 Drush version          :  5.10.0                                               
 Drush configuration    :                                                       
 Drush alias files      :  /home/zeljko/.drush/bigscreen-vm.aliases.drushrc.php 
 Drupal root            :  /home/zeljko/MY_PROJECTS                             
 Site path              :  sites/default                                        
 File directory path    :  sites/default/files                                  

Command dispatch complete [0.05 sec, 5.66 MB]                                                [notice]
 Timer  Cum (sec)  Count  Avg (msec) 
 page   0.013      1      13.23      

Peak memory usage was 6.13 MB [0.05 sec, 5.66 MB]

I also need to mention that drush dl will download a module to the appropriate folder and all the drush commands that don't work on this website work normally on another locally installed drupal 7 website.

I lost few hours on this and didn't get any actual clues to what I am dealing with here or how to solve it. Hope someone with more experience can help me out here. If you need more information which I might have forgotten to add, pls ask.

ps: few links have 'slash' instead of / because of low reputation limitation of posting links.

  • Is the relevant settings.php in sites/default? Are you executing drush in the root directory for the site (same folder as index.php)? – Alfred Armstrong Jun 8 '16 at 15:41
  • 1
    Are you executing drush in a shell in the virtual machine or in a shell on the host computer? – cilefen Jun 8 '16 at 15:43
  • The first issue is on drush fl (features list). Are you sure that the Features module is enabled? Can you do a drush pml | grep Enabled from the CLI to confirm? – Rick Jun 8 '16 at 16:30
  • -AlfredArmstrong yes -cilefen you mean if I am inside the folder where I have the virtual site set up? if that's the question then yes -rgchi yes and I get the same error posted above when I use the command drush pml | grep Enabled – user3320816 Jun 9 '16 at 7:36
  • sry about the formating, haven't been using much the stackexchange yet, so didn't get to learn how the formating works around here... – user3320816 Jun 9 '16 at 7:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.