Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command cache clears itself and doesn't rebuild #79

Closed
joachim-n opened this issue Sep 11, 2013 · 19 comments
Closed

command cache clears itself and doesn't rebuild #79

joachim-n opened this issue Sep 11, 2013 · 19 comments

Comments

@joachim-n
Copy link
Contributor

joachim-n commented Sep 11, 2013

It seems that various operations cause drush to forget its commands.

See https://drupal.org/node/1653222 for various user experiences with this.

@weitzman
Copy link
Member

weitzman commented Sep 11, 2013

We need 'Steps to Reproduce'. Feel free to attach an archive-dump of a Drupal site if thats needed to reproduce this.

@joachim-n
Copy link
Contributor Author

joachim-n commented Sep 11, 2013

It seems to happen intermittently, but I'll try and monitor it more carefully.

I'm afraid I can't really upload a DB dump of a client site!

@deviantintegral
Copy link
Contributor

deviantintegral commented Oct 21, 2013

This appears to be a problem with Drush 6.0+ as reverting to Drush 5.8 solved the problem.

@kostajh
Copy link
Contributor

kostajh commented Nov 13, 2013

This also happens intermittently for me.

I run into this problem with:

$ drush @mysite.local features-list 
# drush command 'features-list' could not be found
$ drush use @mysite.local
# Site set to @mysite.local
$ drush features-list
# drush command 'features-list' could not be found
$ drush cc drush
$ drush features-list 
# works as expected

@weitzman
Copy link
Member

weitzman commented Nov 15, 2013

If someone can reliably reproduce this, it would be great if they could also create a drush archive-dump and either post that online or send it to me personally. Thats needed to get to the bottom of this.

@BarisW
Copy link

BarisW commented Nov 27, 2013

I'm having the same issues.

$ drush fra
# Command fra needs the following module(s) enabled to run: features.                                                                                                                                                                                                                                                                                                                                                            # The drush command 'fra' could not be executed. 

$ drush cc drush
# 'drush' cache was cleared

$ drush fra
# Current state already matches defaults, aborting.

I'm using 6.1.0 and features 2.0. I haven't found a way to reliable reproduce this.

@BarisW
Copy link

BarisW commented Nov 27, 2013

Can it be related to https://drupal.org/comment/4673100#comment-4673100 ?

@weitzman
Copy link
Member

weitzman commented Dec 2, 2013

Even if it takes a few tries, I'd be interested in someone archiving their site and sending it to me (or posting here). Just use the archive-dump command. I will keep trying to reproduce the bug and then fixing it.

@juampynr
Copy link
Contributor

juampynr commented Jan 6, 2014

I thought I could reproduce it by installing features module and a custom feature in the profiles directory, but it did not work. I will see if I can find the minimum requirements in a bare Drupal installation to reproduce it.

@deviantintegral
Copy link
Contributor

deviantintegral commented Jan 13, 2014

I've got a site I can reproduce this on with Drush 6.2.0, but it's not a bare Drupal install (but, pretty close).

It looks like what's happening is that the md5 for the cache files isn't matching. For example, grepping for drush.features.inc shows:

  • default/6.2.0-commandfiles-2-1508cc2cc633410d80743e65b40a0299.cache
  • default/6.2.0-commandfiles-2-281ab7c4869cc86ec72d28451d54f685.cache

As files that match. drush -dv features shows:

$> drush -dv features 2>&1 | grep Cache
Cache HIT cid: 6.2.0-commandfiles-0-2ce0deef1ee68fb232ba5b87485c574e     [debug]
Cache HIT cid: 6.2.0-commandfiles-0-b27ddd2239ad8861a930fc9d4b464f4c     [debug]
Cache HIT cid: 6.2.0-install_profile-8e7d2f47afb9092055e61ebcb2455b0c    [debug]
Cache HIT cid: 6.2.0-commandfiles-2-0de10dca6fa91c0c74ca3c0ccfbd3d9d     [debug]
Cache HIT cid: 6.2.0-install_profile-8e7d2f47afb9092055e61ebcb2455b0c    [debug]
Cache HIT cid: 6.2.0-commandfiles-5-4c3ed3633ba69dcffb4d19aafae27a57     [debug]
Cache HIT cid: 6.2.0-install_profile-8e7d2f47afb9092055e61ebcb2455b0c    [debug]
Cache HIT cid: 6.2.0-commandfiles-2-cc22f5d7292caeb74af809309fedcbb7     [debug]

I'm not familiar with what drush is using exactly to generate those hashes, but it seems like a good place to start.

@deviantintegral
Copy link
Contributor

deviantintegral commented Jan 13, 2014

I figured this out at least for our specific case.

We're using a patch from https://drupal.org/node/1617860 that adds support for profiles/all. In includes/command.inc, on an empty cache, "profiles" is scanned for files:

https://github.com/drush-ops/drush/blob/master/includes/command.inc#L1413

However, once we have a cache file, we don't scan /profiles, causing a different cache key to be generated, and losing features.drush.inc.

Can anyone reproduce this without patching in support for profiles/all?

@mcjim
Copy link

mcjim commented Feb 3, 2014

I've yet to test this on a clean install, but on the site I'm working on at the moment we had ldap_authentication module enabled but not configured. This was raising a PHP notice. Disabling ldap_authentication appears to have resolved the issue for now.

$ drush fl --debug
Bootstrap to phase 0. [0.01 sec, 2.4 MB]                             [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.01 sec, 2.53 MB] [bootstrap]
Loading drushrc "/Users/mcjim/.drush/drushrc.php" into "home.drush" scope. [0.02 sec, 2.54 [bootstrap]
MB]
Cache HIT cid: 7.0-dev-commandfiles-0-cec351e93e857dff62a50a3e4f0c7a17 [0.02 sec, 2.55 MB]     [debug]
Bootstrap to phase 0. [0.15 sec, 6.63 MB]                                                  [bootstrap]
Bootstrap to phase 5. [0.29 sec, 6.63 MB]                                                  [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.29 sec, 6.63 MB]                 [bootstrap]
Initialized Drupal 7.26 root directory at                                                     [notice]
/some_project/code/www [0.31 sec, 7.68 MB]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.31 sec, 7.68 MB]                 [bootstrap]
Initialized Drupal site default at sites/default [0.31 sec, 7.69 MB]                          [notice]
Cache HIT cid: 7.0-dev-install_profile-66ecfeb9791a023150773849f1550c5d [0.32 sec, 7.69 MB]    [debug]
Cache HIT cid: 7.0-dev-commandfiles-2-699657487b88e8b0c2ede2984aa12913 [0.32 sec, 7.69 MB]     [debug]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.32 sec, 7.71 MB]        [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.33 sec, 7.73 MB]             [bootstrap]
Successfully connected to the Drupal database. [0.33 sec, 7.73 MB]                         [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.34 sec, 8.3 MB]                  [bootstrap]
Trying to get property of non-object ldap_authentication.module:223 [0.66 sec, 40.38 MB]      [notice]
Cache HIT cid: 7.0-dev-install_profile-66ecfeb9791a023150773849f1550c5d [0.67 sec, 40.55       [debug]
MB]
Cache HIT cid: 7.0-dev-commandfiles-5-4dbe966ba2dd8bbb3bd7c7326c9c5121 [0.67 sec, 40.59 MB]    [debug]
Cache HIT cid: 7.0-dev-install_profile-66ecfeb9791a023150773849f1550c5d [0.79 sec, 40.96       [debug]
MB]
Cache HIT cid: 7.0-dev-commandfiles-2-5ae707b49cab741d0deaf738a6ac8e5f [0.8 sec, 40.97 MB]     [debug]
Command fl needs the following module(s) enabled to run: features. [0.99 sec, 42.17 MB]    [error]
The drush command 'fl' could not be executed. [0.99 sec, 42.17 MB]                         [error]

@ohthehugemanatee
Copy link
Contributor

ohthehugemanatee commented Mar 12, 2014

Also experiencing this issue. Unfortunately the site is large, complex, and confidential - so I can't give you a sample DB. Still, here's my debug output in case it helps:

ubuntu-VirtualBox /var/www/html $ drush fr --force -y uwc_users uwc_permissions --debug
Bootstrap to phase 0. [0 sec, 2.55 MB]                               [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.01 sec, 2.69 MB] [bootstrap]
Loading drushrc "/home/ubuntu/personalize/.drush/drushrc.php" into "home.drush" scope. [0.01 sec, 2.69 MB]                    [bootstrap]
Cache HIT cid: 6.3-dev-commandfiles-0-769cc76ce667a0a4dd9e37cf1d0026c1 [0.02 sec, 2.7 MB]                                         [debug]
Bootstrap to phase 0. [0.09 sec, 6.52 MB]                                                                                     [bootstrap]
Bootstrap to phase 5. [0.15 sec, 6.52 MB]                                                                                     [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.15 sec, 6.52 MB]                                                    [bootstrap]
Initialized Drupal 7.23 root directory at /var/www/uwonline/public [0.16 sec, 7.56 MB]                                           [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.16 sec, 7.56 MB]                                                    [bootstrap]
Initialized Drupal site default at sites/default [0.16 sec, 7.56 MB]                                                             [notice]
Cache HIT cid: 6.3-dev-install_profile-66ecfeb9791a023150773849f1550c5d [0.17 sec, 7.57 MB]                                       [debug]
Cache HIT cid: 6.3-dev-commandfiles-2-699657487b88e8b0c2ede2984aa12913 [0.17 sec, 7.57 MB]                                        [debug]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.17 sec, 7.59 MB]                                           [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.18 sec, 7.6 MB]                                                 [bootstrap]
Successfully connected to the Drupal database. [0.18 sec, 7.6 MB]                                                             [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.19 sec, 8.11 MB]                                                    [bootstrap]
Cache HIT cid: 6.3-dev-install_profile-66ecfeb9791a023150773849f1550c5d [0.6 sec, 44.77 MB]                                       [debug]
Cache HIT cid: 6.3-dev-commandfiles-5-bb21780019fbac0d274b1a957286cd71 [0.6 sec, 44.82 MB]                                        [debug]
Cache HIT cid: 6.3-dev-install_profile-66ecfeb9791a023150773849f1550c5d [0.67 sec, 45.2 MB]                                       [debug]
Cache HIT cid: 6.3-dev-commandfiles-2-5ae707b49cab741d0deaf738a6ac8e5f [0.68 sec, 45.21 MB]                                       [debug]
Command fr needs the following module(s) enabled to run: features. [0.79 sec, 46.47 MB]                                       [error]
The drush command 'fr uwc_users uwc_permissions' could not be executed. [0.79 sec, 46.47 MB]                                  [error]

ubuntu-VirtualBox /var/www/html $ drush cc drush --debug
Bootstrap to phase 0. [0.01 sec, 2.55 MB]                            [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.01 sec, 2.68 MB] [bootstrap]
Loading drushrc "/home/ubuntu/personalize/.drush/drushrc.php" into "home.drush" scope. [0.01 sec, 2.69 MB]                    [bootstrap]
Cache HIT cid: 6.3-dev-commandfiles-0-769cc76ce667a0a4dd9e37cf1d0026c1 [0.02 sec, 2.7 MB]                                         [debug]
Bootstrap to phase 0. [0.09 sec, 6.52 MB]                                                                                     [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.15 sec, 6.52 MB]                                                    [bootstrap]
Initialized Drupal 7.23 root directory at /var/www/uwonline/public [0.16 sec, 7.56 MB]                                           [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.17 sec, 7.57 MB]                                                    [bootstrap]
Initialized Drupal site default at sites/default [0.17 sec, 7.57 MB]                                                             [notice]
Cache HIT cid: 6.3-dev-install_profile-66ecfeb9791a023150773849f1550c5d [0.17 sec, 7.57 MB]                                       [debug]
Cache HIT cid: 6.3-dev-commandfiles-2-699657487b88e8b0c2ede2984aa12913 [0.17 sec, 7.57 MB]                                        [debug]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.17 sec, 7.59 MB]                                           [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.18 sec, 7.6 MB]                                                 [bootstrap]
Successfully connected to the Drupal database. [0.18 sec, 7.61 MB]                                                            [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.19 sec, 8.12 MB]                                                    [bootstrap]
Cache HIT cid: 6.3-dev-install_profile-66ecfeb9791a023150773849f1550c5d [0.59 sec, 44.77 MB]                                      [debug]
Cache HIT cid: 6.3-dev-commandfiles-5-bb21780019fbac0d274b1a957286cd71 [0.59 sec, 44.82 MB]                                       [debug]
Drush bootstrap phase : _drush_bootstrap_drupal_login() [0.59 sec, 45.01 MB]                                                  [bootstrap]
Successfully logged into Drupal as Anonymous (uid=0) [0.76 sec, 54.99 MB]                                                     [bootstrap]
Found command: cache-clear (commandfile=cache) [0.76 sec, 54.99 MB]                                                           [bootstrap]
Calling hook drush_cache_command_clear [0.9 sec, 55.22 MB]                                                                        [debug]
Calling drush_cache_clear_drush() [0.9 sec, 55.25 MB]                                                                             [debug]
'drush' cache was cleared. [0.9 sec, 55.25 MB]                                                                                [success]
Returned from hook drush_cache_command_clear [0.9 sec, 55.25 MB]                                                                  [debug]
Command dispatch complete [0.9 sec, 55.23 MB]                                                                                    [notice]
 Timer  Cum (sec)  Count  Avg (msec) 
 page   0.726      1      726.26
Peak memory usage was 56.93 MB [0.9 sec, 55.22 MB]                                                                               [memory]

ubuntu-VirtualBox /var/www/html $ drush fr --force -y uwc_users uwc_permissions --debug
Bootstrap to phase 0. [0 sec, 2.55 MB]                               [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.01 sec, 2.69 MB] [bootstrap]
Loading drushrc "/home/ubuntu/personalize/.drush/drushrc.php" into "home.drush" scope. [0.01 sec, 2.69 MB]                    [bootstrap]
Cache MISS cid: 6.3-dev-commandfiles-0-769cc76ce667a0a4dd9e37cf1d0026c1 [0.02 sec, 2.69 MB]                                       [debug]
Cache SET cid: 6.3-dev-commandfiles-0-769cc76ce667a0a4dd9e37cf1d0026c1 [0.02 sec, 2.71 MB]                                        [debug]
Bootstrap to phase 0. [0.1 sec, 6.52 MB]                                                                                      [bootstrap]
Bootstrap to phase 5. [0.16 sec, 6.52 MB]                                                                                     [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.16 sec, 6.53 MB]                                                    [bootstrap]
Initialized Drupal 7.23 root directory at /var/www/uwonline/public [0.18 sec, 7.56 MB]                                           [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.18 sec, 7.57 MB]                                                    [bootstrap]
Initialized Drupal site default at sites/default [0.18 sec, 7.57 MB]                                                             [notice]
Cache MISS cid: 6.3-dev-install_profile-66ecfeb9791a023150773849f1550c5d [0.19 sec, 7.57 MB]                                      [debug]
Cache MISS cid: 6.3-dev-commandfiles-2-90b5571ff64221f80c3320ec33b2ed28 [0.19 sec, 7.57 MB]                                       [debug]
Cache SET cid: 6.3-dev-commandfiles-2-90b5571ff64221f80c3320ec33b2ed28 [0.27 sec, 7.58 MB]                                        [debug]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.28 sec, 8.51 MB]                                           [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.29 sec, 8.52 MB]                                                [bootstrap]
Successfully connected to the Drupal database. [0.29 sec, 8.52 MB]                                                            [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.3 sec, 9.04 MB]                                                     [bootstrap]
Cache MISS cid: 6.3-dev-install_profile-66ecfeb9791a023150773849f1550c5d [0.72 sec, 45.69 MB]                                     [debug]
Cache SET cid: 6.3-dev-install_profile-66ecfeb9791a023150773849f1550c5d [0.72 sec, 45.69 MB]                                      [debug]
Cache MISS cid: 6.3-dev-commandfiles-5-bb21780019fbac0d274b1a957286cd71 [0.72 sec, 45.75 MB]                                      [debug]
Cache SET cid: 6.3-dev-commandfiles-5-bb21780019fbac0d274b1a957286cd71 [0.81 sec, 45.76 MB]                                       [debug]
Bootstrap to phase 6. [0.92 sec, 46.66 MB]                                                                                    [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_login() [0.92 sec, 46.66 MB]                                                  [bootstrap]
Successfully logged into Drupal as Anonymous (uid=0) [1.02 sec, 51.37 MB]                                                     [bootstrap]
Found command: features-revert (commandfile=features) [1.02 sec, 51.37 MB]                                                    [bootstrap]
Calling hook drush_features_revert [1.26 sec, 51.42 MB]  

ubuntu-VirtualBox /var/www/html/sites/all/modules/custom/uwc_misc $ drush fr --force -y uwc_users uwc_permissions --debug
Bootstrap to phase 0. [0 sec, 2.55 MB]                               [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.01 sec, 2.69 MB] [bootstrap]
Loading drushrc "/home/ubuntu/personalize/.drush/drushrc.php" into "home.drush" scope. [0.01 sec, 2.69 MB]                    [bootstrap]
Cache HIT cid: 6.3-dev-commandfiles-0-769cc76ce667a0a4dd9e37cf1d0026c1 [0.02 sec, 2.7 MB]                                         [debug]
Bootstrap to phase 0. [0.1 sec, 6.52 MB]                                                                                      [bootstrap]
Bootstrap to phase 5. [0.15 sec, 6.52 MB]                                                                                     [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.15 sec, 6.52 MB]                                                    [bootstrap]
Initialized Drupal 7.23 root directory at /var/www/uwonline/public [0.16 sec, 7.56 MB]                                           [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.17 sec, 7.56 MB]                                                    [bootstrap]
Initialized Drupal site default at sites/default [0.17 sec, 7.56 MB]                                                             [notice]
Cache HIT cid: 6.3-dev-install_profile-66ecfeb9791a023150773849f1550c5d [0.17 sec, 7.57 MB]                                       [debug]
Cache MISS cid: 6.3-dev-commandfiles-2-699657487b88e8b0c2ede2984aa12913 [0.17 sec, 7.57 MB]                                       [debug]
Cache SET cid: 6.3-dev-commandfiles-2-699657487b88e8b0c2ede2984aa12913 [0.18 sec, 7.57 MB]                                        [debug]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.19 sec, 7.59 MB]                                           [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.19 sec, 7.6 MB]                                                 [bootstrap]
Successfully connected to the Drupal database. [0.19 sec, 7.6 MB]                                                             [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.2 sec, 8.11 MB]                                                     [bootstrap]
Cache HIT cid: 6.3-dev-install_profile-66ecfeb9791a023150773849f1550c5d [6.94 sec, 99.5 MB]                                       [debug]
Cache HIT cid: 6.3-dev-commandfiles-5-bb21780019fbac0d274b1a957286cd71 [6.94 sec, 99.56 MB]                                       [debug]
Cache HIT cid: 6.3-dev-install_profile-66ecfeb9791a023150773849f1550c5d [7.07 sec, 99.97 MB]                                      [debug]
Cache MISS cid: 6.3-dev-commandfiles-2-5ae707b49cab741d0deaf738a6ac8e5f [7.07 sec, 99.97 MB]                                      [debug]
Cache SET cid: 6.3-dev-commandfiles-2-5ae707b49cab741d0deaf738a6ac8e5f [7.16 sec, 99.99 MB]                                       [debug]
Command fr needs the following module(s) enabled to run: features. [7.28 sec, 101.21 MB]                                      [error]
The drush command 'fr uwc_users uwc_permissions' could not be executed. [7.28 sec, 101.21 MB]                                 [error]

When I checkout the 5.x branch it's fine. This is 6.x only.

@tannerjfco
Copy link

tannerjfco commented May 12, 2014

@weitzman , I've contacted you via d.o with an archive-dump as requested. I've experienced the issue with multiple projects when using Drush 6.x. Using 5.9 I do not encounter the issue. Hope the archive helps!

@weitzman
Copy link
Member

weitzman commented May 12, 2014

Thanks @tannerjfco for the archive. In his case, the problem was that he had 3 profiles in /profiles and had modules enabled from each of them. Drupal only recognizes one profile, which is stored as install_profile in the variables table.

A Drush speed opimization is that we sometimes only look for drush commandfiles in the active profile. So drush commands can go missing if they are not in that folder.

So, Drupal supports modules coming from inactive profiles but thats arguably a mistake-feature. If Drush could find a way to support this and stay fast, I'm willing to do so.

Folks sufferring from this bug could disable command caching or move the commandfiles that go missing to sites/ dir or to the active profile dir.

@dmsmidt
Copy link

dmsmidt commented Jun 19, 2014

@weitzman could you explain how to disable drush command caching (preferably only for one site)?

For now I worked around the issue by placing the needed module in the /profiles/standard folder.
(Which isn't great).

me@laptop:/var/www/foo/docroot/sites/bar.net$ drush fl --debug
Bootstrap to phase 0. [0.01 sec, 4.17 MB]                            [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.02 sec, 4.4 MB]  [bootstrap]
Cache HIT cid: 6.3-dev-commandfiles-0-cb9864e34b23ced797038b928b806f3d [0.03 sec, 4.42 MB]                                                                      [debug]
Bootstrap to phase 0. [0.24 sec, 10.93 MB]                                                                                                                  [bootstrap]
Bootstrap to phase 5. [0.39 sec, 10.93 MB]                                                                                                                  [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.4 sec, 10.94 MB]                                                                                  [bootstrap]
Initialized Drupal 7.28 root directory at /var/www/foo/docroot [0.43 sec, 12.59 MB]                                                                            [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.44 sec, 12.6 MB]                                                                                  [bootstrap]
Initialized Drupal site bar.net at sites/bar.net [0.44 sec, 12.6 MB]                                                                             [notice]
Cache HIT cid: 6.3-dev-install_profile-fcf2f286b1ac5feee8c6ee0443794503 [0.45 sec, 12.6 MB]                                                                     [debug]
Cache HIT cid: 6.3-dev-commandfiles-2-bdf0a6729644c71eba163ac82ab3ef57 [0.45 sec, 12.61 MB]                                                                     [debug]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.46 sec, 12.67 MB]                                                                        [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.54 sec, 15.59 MB]                                                                             [bootstrap]
Successfully connected to the Drupal database. [0.54 sec, 15.6 MB]                                                                                          [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.55 sec, 15.6 MB]                                                                                  [bootstrap]
Cache HIT cid: 6.3-dev-install_profile-fcf2f286b1ac5feee8c6ee0443794503 [1.51 sec, 61.11 MB]                                                                    [debug]
Cache HIT cid: 6.3-dev-commandfiles-5-dda5e2308d114fcd7f5dc0596903ba38 [1.51 sec, 61.16 MB]                                                                     [debug]
Cache HIT cid: 6.3-dev-install_profile-fcf2f286b1ac5feee8c6ee0443794503 [1.7 sec, 61.48 MB]                                                                     [debug]
Cache HIT cid: 6.3-dev-commandfiles-2-64b2cb8198f96dbe16efafcab4bf306c [1.7 sec, 61.49 MB]                                                                      [debug]
Command fl needs the following module(s) enabled to run: features. [2.09 sec, 65.38 MB]                                                                     [error]
The drush command 'fl' could not be executed. [2.09 sec, 65.38 MB]                                                                                          [error]

@ohthehugemanatee
Copy link
Contributor

ohthehugemanatee commented Jun 19, 2014

Great! Thank you for the resolution this far.

I have definitely encountered this problem in sites which only use the default install profile, and where nothing to do with the active profile has changed before it started happening. Maybe that needs a separate issue opened. Either way, I'll post back when I find an example.

@weitzman it might help if you lay out how you arrived at that conclusion - ie how you debugged the drush bootstrap - so that others on this thread might be able to self-diagnose?

@bzitzow
Copy link

bzitzow commented Jul 11, 2014

+1

The feature module to be reverted is located in:

profiles/companyname_profile/modules/contrib/companyname_feature_description
drush --version
drush version 5.9

The behavior:

drush @pantheon.website.dev fr companyname_feature_description
Current state already matches defaults, aborting.                           [ok]

Interesting, let's clear the cache - Whoa!

drush @pantheon.website.dev cc all


WD php: DatabaseSchemaObjectExistsException: Cannot add index            [error]
field_base_content_section_fc_revision_id to table
field_data_field_base_content_section_fc: index already exists. in
DatabaseSchema_mysql->addIndex() (line 437 of
/srv/bindings/309395f3d305462a82dbc9eb0caa168b/code/includes/database/mysql/schema.inc).
DatabaseSchemaObjectExistsException: Cannot add index <em class="placeholder">field_base_content_section_fc_revision_id</em> to table <em class="placeholder">field_data_field_base_content_section_fc</em>: index already exists. in DatabaseSchema_mysql->addIndex() (line 437 of /srv/bindings/309395f3d305462a82dbc9eb0caa168b/code/includes/database/mysql/schema.inc).
Drush command terminated abnormally due to an unrecoverable error.       [error]

Let's try again, just for kicks

drush @pantheon.website.dev fr companyname_feature_description
Current state already matches defaults, aborting.                           [ok]

No luck, search the web, find some interesting comments about updb first

drush @pantheon.website.dev updb

No database updates required                                           [success]
WD php: DatabaseSchemaObjectExistsException: Cannot add index            [error]
field_base_content_section_fc_revision_id to table
field_data_field_base_content_section_fc: index already exists. in
DatabaseSchema_mysql->addIndex() (line 437 of
/srv/bindings/309395f3d305462a82dbc9eb0caa168b/code/includes/database/mysql/schema.inc).
DatabaseSchemaObjectExistsException: Cannot add index <em class="placeholder">field_base_content_section_fc_revision_id</em> to table <em class="placeholder">field_data_field_base_content_section_fc</em>: index already exists. in DatabaseSchema_mysql->addIndex() (line 437 of /srv/bindings/309395f3d305462a82dbc9eb0caa168b/code/includes/database/mysql/schema.inc).
Drush command terminated abnormally due to an unrecoverable error.       [error]
Finished performing updates.                                                [ok]

No database updates, an error - yet now cache clear works - hmmmm

drush @pantheon.website.dev cc all
'all' cache was cleared in                                             [success]
/srv/bindings/309395f3d305462a82dbc9eb0caa168b/code#dev.website.com

Voila!

drush @pantheon.website.dev fr companyname_feature_description
Reverted companyname_feature_description.field_group.                                     [ok]

Definitely weird, would love to have this work predictably. Sorry, I can't send you an archive of the site.

weitzman added a commit that referenced this issue Aug 6, 2014
During bootstrap, we guess at which commandfiles to load from /profiles when the current command is not bootstrapping past DRUSH_BOOTSTRAP_DRUPAL_SITE. Unfortunately, we were doing this guessing always, not just for those special commands. This patch moves the guessing to within a conditional as it was before I introduced the bug in ac51e27.

This should also make Drush a bit faster for sites that have big /profile directories that have many disabled modules.

Backports efdd5ac.
@rwam
Copy link

rwam commented Jun 13, 2018

Puh, we ran into the same problem with Drupal 8.5.4, Features 8.x-3.7 and Drush 8.1.14. Annoying.

Doesn't work:

drush updb -y
drush fim team -y
>> Command fim needs the following extension(s) enabled to run: .    [error]

Work:

drush updb --cache-clear=0 -y
drush cr -y
drush fim team -y
>> Current state already matches active config, aborting.            [ok]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests