Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When running a 'drush cache clear' the CLI should output the user cache is not cleared and how to properly clear this.
Comment | File | Size | Author |
---|---|---|---|
#20 | drupal_apc_cache.inc_.patch | 1.01 KB | sirviejo |
Comments
Comment #1
Refineo CreditAttribution: Refineo commentedsubscribe
Comment #2
R.Muilwijk CreditAttribution: R.Muilwijk commentedThe webserver and the client run in different memory segments. So it's not possible to clear the APC cache using drush. You can use different methods for clearing the cache.
1) Use the clear all caches in the Drupal website.
2) Setup the apc.php script somewhere on your webserver to clear the cache. Use `locate apc.php` to find it on *nix.
Comment #3
R.Muilwijk CreditAttribution: R.Muilwijk commentedComitted to dev.
Comment #5
a7 CreditAttribution: a7 commentedComment #6
okeedoak CreditAttribution: okeedoak commentedThis has to be one of the most annoying error messages ever. Most Drush commands return the error multiple times. How do I turn OFF the message?
Comment #7
bforchhammer CreditAttribution: bforchhammer commentedI agree. When I run
drush cc all
I get the message like 60 times...Edit: Opened new issue for fixing this behavior: #1565716: Make "drush cc" clear cache on the webnode itself
Comment #8
kalabroDoes it mean that I can't use Drush successfully on the site with APC cache?
Comment #9
jeremyclassic CreditAttribution: jeremyclassic commentedNo, you can use Drush on APC enabled sites. However, the messages produced by the Drush / APC combo are annoying and only point back to this post, not a solution.
Note: despite the annoyance of the messages, APC really is the best working caching solution for me and Drush is the best way to get monotonous maintenance tasks done with Drupal, so, a little inconvenience in a "best of breed solution" is, unfortunately, acceptable.
Comment #10
mgiffordSo no solution yet, but where is this problem getting worked on?
Is it with the memcache module? drush? memcache itself? php?
Would be good to have some hope that in a few months we won't have to deal with these annoying messages.
Comment #11
Orkut Murat Yılmazsubscribing.
Comment #12
MrHaroldA CreditAttribution: MrHaroldA commented@Orkut: the 7.x-1.0-beta4 already includes this (very annoying) message.
See #1565716: Make "drush cc" clear cache on the webnode itself for the follow-up.
Comment #13
Orkut Murat YılmazSorry for the wrong comment. I've edited it.
Comment #14
fgmThe problem is with the fact that the Drush (CLI) PHP instance does not address the same memory segment as the one used by the PHP server SAPI in use, so any action it can take, assuming apc.enable_cli is on (it is off by default) only affects its own segment and not the one in use by the PHP server. So the only way to really perform a cache clear from the CLI is to connect to the webserver, assuming proper credentials (which cannot be guessed, since the password is hashed), and trigger a server-side clear.
Comment #15
jeffreycai CreditAttribution: jeffreycai commentedSeems like there is no way to solve it.
Maybe there is a way to mute the warning? It is very disturbing.
Comment #16
MrHaroldA CreditAttribution: MrHaroldA commented@jeffreycai, the warning is there for a reason: your cache isn't cleared. The only way to clear your cache (atm) is by clearing it from your website (admin/config/development/performance).
This will be addressed somewhere in the future, hopfully soon.
Comment #17
dan2k3k4 CreditAttribution: dan2k3k4 commentedComment #18
dan2k3k4 CreditAttribution: dan2k3k4 commentedI'm getting the same as others but for every drush command I do.
So performing an install of a new module causes the output of 100+ lines of just:
Any way to fix this or mute/move the warning elsewhere?
Comment #19
steveoriolsubscribing.
Comment #20
sirviejo CreditAttribution: sirviejo commentedHere is a patch to show warning message only the first time.
Comment #21
fgmJust an idea: maybe the built-in server in PHP 5.4 is using the same APC segment and could be used in that case ? Just an idea before I forget it.
Comment #22
NenadP CreditAttribution: NenadP commentedI applied patch, now message feed has gone which is very useful for readibility (and I accepted that cache is not cleared :) )
Comment #23
fgmRethought this, and we have a way to make it work, I think:
That way, the drush cc could indeed flush the web APC.
Comment #24
MrHaroldA CreditAttribution: MrHaroldA commented> Drush commands have access to the URL of the current instance
I tried that already, but when a site is in maintenance mode, Drush has no access (HTTP Error 503 - Service unavailable). That's why I use XMLRPC instead of a menu callback.
Comment #25
fgmGood point, but it does not change the general logic (and need for the token or dynamic enabling).
Comment #26
MrHaroldA CreditAttribution: MrHaroldA commentedPlease use this issue for clearing cache from Drush/CLI: #1565716: Make "drush cc" clear cache on the webnode itself
Comment #27
R.Muilwijk CreditAttribution: R.Muilwijk commentedDiscussion moved to #1565716
Comment #28
szymon.l CreditAttribution: szymon.l commentedapplying #20 leads to :
https://drupal.org/node/1587110
in my case, and this is not recoverable after apc upgrade...