6

We used Drush on our server without any problems up until now. Actually we didn't do / change anything relating to Drush.

But now, on every Drush command we issue, we only get an error like so:

Drush command terminated abnormally due to an unrecoverable error.

Same error also occurs for Drush status. Only drush --version shows "Drush version: 6.6.0".

We installed drush via Composer. And the server is already restarted.

What can we do about this problem, which is a huge problem for us?

1
  • Did you site functioning properly in which you are running drush command? Jun 15, 2015 at 7:41

2 Answers 2

1

Make sure your Drush commands are issued from the appropriate subdirectory of your website (change to the directory where your Drupal site is installed and try again).

Since your question did not specify that, it "might" be the reason why ALL your DRUSH commands are failing ...

Refer to this issue for other possible causes (things you may want to check).

If you recently enabled contributed and/or custom modules, try to temporary disable them to check if the Drush issue gets resolved by doing so.

6
  • We are sure about that ;-) We are using drush massively and know this "problem".
    – deelite
    Jun 15, 2015 at 7:01
  • Could it really be a problem of a module? We are working on 3 Drupal installations at the same time. Different installations with different sets of modules. For all drush isn't working anymore. I'll try your link.
    – deelite
    Jun 15, 2015 at 8:55
  • Oh yes, it was a problem within a module (config). We use drupal.org/project/shield for restricted access to the projects. In this module any of us disabled 'Allow command line access' in the module config...
    – deelite
    Jun 16, 2015 at 11:28
  • Oeps, that's painfull ... but good for you that you did pinpoint the issue. Happy to read my answer somehow seemed to have helped! And thanks for the mention of the Shield module (didn't know about that module, may come in handy)! Jun 16, 2015 at 12:21
  • I thought this issue could only be an generally problem because drush wasn't working in all projects. But the guy disabled it in all these projects where I tested drush. After reading your answer I cloned one of the projects and disabled ALL modules and drush worked. Ok, a module... Then I recovered the db from the backup and disabled 20 modules per step. After drush was working again I filtered by every single module. And so I found shield. But we didn't make any update of this module. So it only could be a configuration issue. You should have a look at the last dev of shield...
    – deelite
    Jun 16, 2015 at 12:43
1

I was getting :

warning Drush command terminated abnormally.

And after long hours, i realized that drush was crashing as a results of

 Allowed memory size of 134217728 bytes exhausted (tried to allocate 40960 bytes)

Had to scroll up to pages and pages of debug info before i saw that.

If this is your problem, you can change the below value in php.ini to 512M and try the drush command again.

memory_limit = 128M

Instead of changing the value in /etc/php.ini, a better solution is to add drush.ini file with the value to your path (see below)

  1. create drush.ini in your path such as (/usr/local/bin/drush.ini) see its contents below. Change permissions so the user running drush can load the file.
  2. add this to your ~/.bashrc (export PHP_INI_SCAN_DIR=:/usr/local/bin) then (source ~/.bashrc) to reload it

content of drush.ini can be

[PHP]

memory_limit = 512M

Note: drush.ini might be ignored even after setting as above so double check.

  • See loaded config files :$ PHP_INI_SCAN_DIR=:/usr/local/bin/ php --ini
  • See memory limit assigned to the script:$ drush php:eval "echo ini_get('memory_limit');"

Background: How to have drush specific config values rather than changing php.ini

https://github.com/drush-ops/drush/issues/3294#issuecomment-618962852

https://github.com/drush-ops/drush/issues/3294

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.