Resolve Drush command terminated abnormally due to a unrecoverable error

Source: Internet
Author: User
Tags php cli drupal

Today, when you use Drush, you suddenly find that you cannot use it, prompting for errors:

Drush command terminated abnormally due to a unrecoverable error. [ERROR]

After testing, not drush configuration problem, nor Drupal kernel problem, is that I write a module hook_init () function is jump caused, leading to drush into the dead loop.

To view Drush Debug information:

$ drush-v-D status
Bootstrap to Phase 0.                               [0 sec, 1.86 MB] [Bootstrap]
Drush Bootstrap phase: _drush_bootstrap_drush () [0.01 sec, 1.98 MB] [Bootstrap]
Loading DRUSHRC [Bootstrap]
"/applications/rubystack/apps/drupal/drush/drushrc.php" into "Drush"
Scope. [0.01 sec, 1.98 MB]
Cache MISS cid:6.0-commandfiles-0-b85971c7841e4094247c123114aed123 [Debug]
[0.01 sec, 1.99 MB]
Cache SET cid:6.0-commandfiles-0-b85971c7841e4094247c123114aed123 [Debug]
[0.01 sec, 2.01 MB]
Bootstrap to Phase 0.                            [0.05 sec, 5.34 MB] [Bootstrap]
Drush Bootstrap phase: _drush_bootstrap_drupal_root () [0.07 sec, [Bootstrap]
5.35 MB]
Initialized Drupal 7.26 root directory at [notice]
/applications/rubystack/apps/drupal/htdocs [0.08 sec, 6.21
MB] Www.111cn.net
Drush Bootstrap phase: _drush_bootstrap_drupal_site () [0.08 sec, [Bootstrap]
6.22 MB]
Initialized Drupal site default at Sites/default [0.08 sec, 6.22 MB] [notice]
Cache MISS cid:6.0-install_profile-66ecfeb9791a023150773849f1550c5d [Debug]
[0.08 sec, 6.22 MB]
Cache MISS cid:6.0-commandfiles-2-90b5571ff64221f80c3320ec33b2ed28 [Debug]
[0.08 sec, 6.22 MB]
Cache SET cid:6.0-commandfiles-2-90b5571ff64221f80c3320ec33b2ed28 [Debug]
[0.09 sec, 6.23 MB]
Drush Bootstrap phase: _drush_bootstrap_drupal_configuration () [0.09[bootstrap]
SEC, 6.24 MB]
Drush Bootstrap phase: _drush_bootstrap_drupal_database () [0.1 sec, [Bootstrap]
7.86 MB]
Successfully connected to the Drupal database.    [0.1 sec, 7.86 MB] [Bootstrap]
Drush Bootstrap phase: _drush_bootstrap_drupal_full () [0.1 sec, 7.86[bootstrap]
MB]
Drush command terminated abnormally due to a unrecoverable error. [ERROR]
[0.19 sec, 21.9 MB] Judging from the above debug, Drush No problem, is the hook in Drupal caused.


Solving method
If you're in the same situation, check out a hook in your custom module, such as:

Hook_init
Hook_boot


Drush is run through the PHP CLI command-line mode, and the CLI's PHP configuration environment differs from the php.ini used by Apache. If access to the site is not a problem, there is a problem with access to the CLI, you write the hook code there is a problem.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.