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 < /tmp/drush_erased
sql-query: SHOW TABLES;
Executing: mysql --defaults-extra-file=/tmp/drush_erased --database=dune --host=localhost --silent < /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
  • You should post the output of drush status. That does provide some more information and we can tell what "work" really means.
    – hansfn
    Nov 7, 2018 at 18:46
  • I just added output for drush status
    – Muskateer
    Nov 7, 2018 at 19:08
  • Does this only happen with the varnish module? (You probably have some other module that you can enable and disable for testing.)
    – hansfn
    Nov 8, 2018 at 8:05

1 Answer 1


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.

  • Neither of those are working for me.
    – Muskateer
    Nov 7, 2018 at 18:26
  • drush status and drush updb work though.
    – Muskateer
    Nov 7, 2018 at 18:29
  • Hmm, I'd check the logs for errors. This might indicate an error in the varnish uninstall script. Also, does varnish show up in a drush pml list? Another way to make sure you're using the right site.
    – CG Monroe
    Nov 7, 2018 at 23:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.