Why do I get "Command pm-disable needs a higher bootstrap level to run"? Running drush dis varnish in the Drupal directory gives give me this message.


  Command pm-disable needs a higher bootstrap level to run.


Running drush --debug dis varnish -y gives the following output.


  Phar detected. Proceeding to drush_main().
  Loading drushrc "/home/user/.drush/drushrc.php" into "home.drush" scope.     > Cache HIT cid: 8.1.14-commandfiles-0-erased
  Bootstrap to phase 0.
  Bootstrap to phase 6.
  Drush bootstrap phase: bootstrap_drupal_root()
  Initialized Drupal 7.59 root directory at /usr/share/www/Drupal
  Find command files for phase 1 (max=6)
  Cache HIT cid: 8.1.14-commandfiles-1-erased
  Cache HIT cid: 8.1.14-annotationfiles-1-erased
  Drush bootstrap phase: bootstrap_drupal_site()
  Initialized Drupal site default at sites/default
  Find command files for phase 2 (max=6)
  Drush bootstrap phase: bootstrap_drupal_configuration()
  Find command files for phase 3 (max=6)
  sql-query: SELECT 1;
  Executing: mysql --defaults-extra-file=/tmp/drush_erased --database=dune --host=localhost --silent  &lt; /tmp/drush_erased
  sql-query: SHOW TABLES;
  Executing: mysql --defaults-extra-file=/tmp/drush_erased --database=dune --host=localhost --silent  &lt; /tmp/drush_erased
  Bootstrap to phase 1.
  Bootstrap to phase 6.
  Bootstrap to phase 5.
  Command pm-disable needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command.
  The drush command 'dis varnish' could not be executed.


drush status and drush updb work. The output of the first command is the following one.

Drupal version         :  7.59
Site URI               :  http://default
Database driver        :  mysql
Database hostname      :  localhost
Database port          :
Database username      :  drupaluser
Database name          :  dune
PHP configuration      :  /etc/php.ini /home/user/.drush/drush.ini
PHP OS                 :  Linux
Drush script           :  /usr/local/bin/drush
Drush version          :  8.1.14
Drush temp directory   :  /tmp
Drush configuration    :
Drush alias files      :  /home/user/.drush/aliases.drushrc.php
Drupal root            :  /usr/share/www/Drupal
Drupal Settings File   :  sites/default/settings.php
Site path              :  sites/default
This generally means that drush can't identify the site information, e.g. which settings.php to use.

A quick fix is to cd into the directory with the setting.php file for the site.

A more permanent fix is to create a site specific drush alias for the site and use it.  E.g. drush @mysite dis varnish. See this Drupal page.