When I attempt to clear cache on one of my sites via drush, the clear never completes. With drush cc, i went down the list of caches and found that it was the metatag cc that was causing the hang. Using drush @alias cc metatag --d, i see that the process stops at:

Calling drush_metatag_cache_clear_token_info() [2.47 sec, 41.3 MB]

It's been sitting there for 30 minutes now.

Has anyone encountered this before, and if so, what's the cause of the hang up?

Thanks!

Comments

mulderjoe created an issue. See original summary.

DamienMcKenna’s picture

What version of Drush are you using? What does the "--d" argument do? I don't see it in the version of Drush I'm using (8.x branch from a few weeks ago).

mulderjoe’s picture

Hi Damian,

Thank you for responding. I'm on drupal 7.52 and using drush version 6.0-dev.

--d is the debug output for drush. Got that from here: https://www.drupal.org/drush-faq

DamienMcKenna’s picture

Ah, thanks. Here's what I get:

20161128 14:06:07 > drush cc metatag --debug
Using the Drush script found at /Users/dmckenna/Sites/drupal/drush/drush.launcher using proc_open
Loading drushrc "/Users/dmckenna/.drush/drushrc.php" into "home.drush" scope. [0.02 sec, 2.92 MB]            [bootstrap]
Cache HIT cid: 8.2-dev-commandfiles-0-10ccac04830aa9d3e12df2d3a21e1ab6 [0.02 sec, 2.98 MB]                       [debug]
Loading drushrc "/Users/dmckenna/Sites/drupal/7/sites/all/drush/drushrc.php" into "drupal" scope. [0.12 sec, [bootstrap]
7.2 MB]
Bootstrap to phase 0. [0.44 sec, 11.99 MB]                                                                   [bootstrap]
Trying to bootstrap as far as we can. [0.44 sec, 12 MB]                                                          [debug]
Drush bootstrap phase : bootstrap_drupal_root() [0.45 sec, 12.38 MB]                                         [bootstrap]
Loading drushrc "/Users/dmckenna/Sites/drupal/7/sites/all/drush/drushrc.php" into "drupal" scope. [0.45 sec, [bootstrap]
12.38 MB]
Initialized Drupal 7.52-dev root directory at /Users/dmckenna/Sites/drupal/7 [0.45 sec, 12.38 MB]            [bootstrap]
Find command files for phase 1 (max=7) [0.46 sec, 8.54 MB]                                                       [debug]
Cache HIT cid: 8.2-dev-commandfiles-1-a9501cc5cd299dff11021442027216d4 [0.46 sec, 8.54 MB]                       [debug]
Cache HIT cid: 8.2-dev-annotationfiles-1-66ab48b896b8eee0ab9ec8cfd878f805 [0.46 sec, 8.54 MB]                    [debug]
Drush bootstrap phase : bootstrap_drupal_site() [0.46 sec, 8.55 MB]                                          [bootstrap]
Initialized Drupal site d7.dev at sites/default [0.46 sec, 8.55 MB]                                          [bootstrap]
Find command files for phase 2 (max=7) [0.46 sec, 8.55 MB]                                                       [debug]
Drush bootstrap phase : bootstrap_drupal_configuration() [0.46 sec, 8.55 MB]                                 [bootstrap]
Find command files for phase 3 (max=7) [0.47 sec, 8.57 MB]                                                       [debug]
sql-query: SELECT 1; [0.47 sec, 8.69 MB]                                                                        [notice]
Executing: mysql --defaults-extra-file=/private/tmp/drush_1F2Yy8 --database=drupal7 --host=localhost --silent  < /private/tmp/drush_Prsaak
  1
sql-query: SHOW TABLES; [0.5 sec, 8.69 MB]                                                                      [notice]
Executing: mysql --defaults-extra-file=/private/tmp/drush_tHvhs6 --database=drupal7 --host=localhost --silent  < /private/tmp/drush_ofbWHV
[.. list of every table in the database ..]
Drush bootstrap phase : bootstrap_drupal_database() [0.56 sec, 8.89 MB]                                      [bootstrap]
Successfully connected to the Drupal database. [0.57 sec, 9.42 MB]                                           [bootstrap]
Find command files for phase 4 (max=7) [0.57 sec, 9.42 MB]                                                       [debug]
Drush bootstrap phase : bootstrap_drupal_full() [0.57 sec, 9.42 MB]                                          [bootstrap]
Cache HIT cid: 8.2-dev-install_profile-66ecfeb9791a023150773849f1550c5d [0.91 sec, 30.11 MB]                     [debug]
Find command files for phase 5 (max=7) [0.91 sec, 30.11 MB]                                                      [debug]
Cache HIT cid: 8.2-dev-install_profile-66ecfeb9791a023150773849f1550c5d [0.91 sec, 30.11 MB]                     [debug]
Cache HIT cid: 8.2-dev-commandfiles-5-b1625ce8eb3e6bb0436fde6738a527d1 [0.91 sec, 30.13 MB]                      [debug]
Cache HIT cid: 8.2-dev-annotationfiles-5-95d4cc88bbb60f344d372e98e6ad833b [0.93 sec, 30.73 MB]                   [debug]
Drush bootstrap phase : bootstrap_drupal_login() [0.93 sec, 30.71 MB]                                        [bootstrap]
Find command files for phase 6 (max=7) [0.94 sec, 30.86 MB]                                                      [debug]
Found command: cache-clear (commandfile=cache) [0.94 sec, 30.86 MB]                                          [bootstrap]
Calling hook drush_cache_clear_pre_validate [1.09 sec, 35.45 MB]                                                 [debug]
Returned from hook drush_cache_clear_pre_validate [1.1 sec, 35.46 MB]                                            [debug]
Calling hook drush_cache_command_clear [1.1 sec, 35.49 MB]                                                       [debug]
Calling drush_metatag_cache_clear_token_info() [1.1 sec, 35.5 MB]                                                [debug]
'metatag' cache was cleared. [1.1 sec, 35.48 MB]                                                             [success]
Returned from hook drush_cache_command_clear [1.1 sec, 35.48 MB]                                                 [debug]
Command dispatch complete [1.11 sec, 35.42 MB]                                                                  [notice]
 Timer  Cum (sec)  Count  Avg (msec) 
 page   0.641      1      641.07

So it's working out of the box, might there be some custom code installed on your site that's interfering with it? I can't imagine the version of Drush you have would affect it, given that the "cc" command works for other cache bins.

How large is the {cache_metatag} table?

mulderjoe’s picture

I think you're right in that there is some other interference. The cache metatag table is 0.03MB. Basically empty. So that's not the issue.

Is there a way to determine where the hangup is? Here's a copy of my debug output:

Initialized Drupal 7.52 root directory at /var/www/drupal [0.49 sec, 6.52 MB]                                                                        [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.49 sec, 6.52 MB]                                                                        [bootstrap]
Initialized Drupal site 162.209.105.210 at sites/default [0.49 sec, 6.52 MB]                                                                         [notice]
Cache HIT cid: 6.0-dev-install_profile-66ecfeb9791a023150773849f1550c5d [0.52 sec, 6.53 MB]                                                           [debug]
Cache HIT cid: 6.0-dev-commandfiles-2-699657487b88e8b0c2ede2984aa12913 [0.52 sec, 6.53 MB]                                                            [debug]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.52 sec, 6.55 MB]                                                               [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.54 sec, 6.56 MB]                                                                    [bootstrap]
Successfully connected to the Drupal database. [0.54 sec, 6.57 MB]                                                                                [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.56 sec, 7.12 MB]                                                                        [bootstrap]
Cache HIT cid: 6.0-dev-install_profile-66ecfeb9791a023150773849f1550c5d [1.23 sec, 39.14 MB]                                                          [debug]
Cache HIT cid: 6.0-dev-commandfiles-5-f93a52f519e63cd2e81773f53dbac24c [1.24 sec, 39.19 MB]                                                           [debug]
Drush bootstrap phase : _drush_bootstrap_drupal_login() [1.28 sec, 40.24 MB]                                                                      [bootstrap]
Successfully logged into Drupal as Anonymous (uid=0) [1.33 sec, 40.56 MB]                                                                         [bootstrap]
Found command: cache-clear (commandfile=cache) [1.33 sec, 40.56 MB]                                                                               [bootstrap]
Calling hook drush_cache_command_clear [2 sec, 41.3 MB]                                                                                               [debug]
Calling drush_metatag_cache_clear_token_info() [2.01 sec, 41.34 MB]

And there it hangs.

I was hoping someone ran into an issue with this before, or had seen something like it. I'm not sure I'm doing anything too crazy with the metatag setup, but I had noticed that whenever i ran updb or cc all, that it would either take periodically longer times each time or never return. All of my other sites (not multisite) run just fine.

mulderjoe’s picture

okay, it seems to be resolved. I upgraded to drush 8.1.7, which didn't seem to help - at first. I did drush cc metatag, and it hung for > 1 hour. I then ran it in a new shell with debug, and it went through! I've tried several times now, and it seems to work.

I'm not sure what needed to happen, but i guess we can mark this resolved.

Thank you for your help.

mulderjoe’s picture

Status: Active » Closed (works as designed)
DamienMcKenna’s picture

Glad to hear the problem is solved, hopefully this issue will help anyone else who runs into this problem that the solution is to update Drush.