6.0.0-beta1
7/15/25

[#12416] Can't change app-level access perms without disabling or manually clearing cache
Summary Can't change app-level access perms without disabling or manually clearing cache
Queue Horde Base
Queue Version 5.1.1
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester simon (at) simonandkate (dot) net
Created 06/28/2013 (4400 days ago)
Due
Updated 07/18/2013 (4380 days ago)
Assigned 07/02/2013 (4396 days ago)
Resolved 07/15/2013 (4383 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
07/18/2013 11:09:28 AM simon (at) simonandkate (dot) net Comment #10 Reply to this comment
The changes as released in the latest HashTable have removed the error 
presented from running horde-clear-cache.

It has also resolved the original issue - changes to permissions are 
applied immediately.

Thanks.


07/15/2013 11:19:06 PM simon (at) simonandkate (dot) net Comment #9 Reply to this comment

[Show Quoted Text - 14 lines]
And what I should have said already - thank you Michael, I will give 
the git changes a try and see what they do. :)
07/15/2013 11:17:45 PM simon (at) simonandkate (dot) net Comment #8 Reply to this comment
No, not using a Redis cluster. Just a very simple Redis install, then
started with app defaults.
You are SOL then.
?? Huh?
Your version of redis is probably too old.  There is no reason 
keys() should not work (and I can't reproduce).
2.4.10, released March 2012, so not very old. Pear redis is up to date.
Regardless, as has been said multiple times before - you can't be 
using memcache-like caching mechanisms and expect to clear the 
cache.  This is not how those backends were designed.  If you have a 
redis backend that doesn't support keys(), you will have to manually 
purge the backend yourself through some other mechanism.
So, some questions please:

1. A google search for memcache horde clear cache came back with 
nothing that I could see as relevant. Could you please point me in the 
direction of the discussion, or summarise?

2. Can you clarify your statement that I can't "expect to clear the 
cache". I have no issues at all clearing the cache, as I stated 
earlier: "...if I run "redis-cli flushall" after making the 
permissions change it works." That runs without error, and clears the 
redis cache, as I would expect. The issue is that I am having to do 
that manually when I make a change in Horde, rather than Horde doing 
it automatically when I make a change that results in stale cache.

3. If Horde is configured to use redis, does running horde-clear-cache 
call a redis-cli flushall? What redis mechanism is called to clear the 
cache?

4. Does making a change in Horde that is likely to be impacted by 
stale cache (e.g. a permissions change such as that described here) 
automatically attempt to clear the cache? In other words, if redis 
cache was working correctly (i.e. supports keys()), would a change in 
permissions such as I have done in this ticket automatically clear the 
cache, thus not requiring me to "manually purge the backend..."?

If a newer version of redis will result in automatic cache clearing, 
then I will happily upgrade it. If not, then my reasoning behind this 
ticket still stands -

"If it is too complex to automate a cache-clear with permissions 
changes, perhaps an Apply button that does a cache-clear? Or at the 
very least commentary on the permissions page that changes may not 
take effect until cache is cleared."
07/15/2013 08:17:47 PM Michael Slusarz Comment #7
State ⇒ Resolved
Assigned to Michael Slusarz
Reply to this comment
No, not using a Redis cluster. Just a very simple Redis install, 
then started with app defaults.
You are SOL then.  Your version of redis is probably too old.  There 
is no reason keys() should not work (and I can't reproduce).

Regardless, as has been said multiple times before - you can't be 
using memcache-like caching mechanisms and expect to clear the cache.   
This is not how those backends were designed.  If you have a redis 
backend that doesn't support keys(), you will have to manually purge 
the backend yourself through some other mechanism.
07/15/2013 08:17:37 PM Git Commit Comment #6 Reply to this comment
Changes have been made in Git (master):

commit f47d1533998d3c270f2d4beb1de266e423a0411f
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Mon Jul 15 14:06:32 2013 -0600

     [mms] Workaround broken redis installations that don't support 
the keys() command (Bug #12416).

  framework/HashTable/lib/Horde/HashTable/Predis.php |   14 ++++++++------
  framework/HashTable/package.xml                    |    4 ++--
  2 files changed, 10 insertions(+), 8 deletions(-)

http://git.horde.org/horde-git/-/commit/f47d1533998d3c270f2d4beb1de266e423a0411f
07/09/2013 11:28:59 PM simon (at) simonandkate (dot) net Comment #5 Reply to this comment

[Show Quoted Text - 11 lines]
No, not using a Redis cluster. Just a very simple Redis install, then 
started with app defaults.

Re Jan's question, I have not had time to test with other caching 
backends at this stage.
07/09/2013 11:04:57 PM Michael Slusarz Comment #4 Reply to this comment
07/09/2013 11:04:28 PM Michael Slusarz Comment #3 Reply to this comment
Fatal Error:
Cannot use KEYS with a cluster of connections
In /usr/share/pear/Predis/Connection/PredisCluster.php on line 135
For some reason are you using a Redis cluster?  That's a fairly 
uncommon use case and most likely indicates your configuration is 
incorrect.  (Not to mention this limitation is mentioned nowhere in 
the API).

Even so, it looks like we will have to keep a list of Horde related 
cache keys in order to clear them.
07/02/2013 10:28:36 PM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
Do you see this with other caching backends too?
06/28/2013 04:12:06 AM simon (at) simonandkate (dot) net Comment #1
Milestone ⇒
State ⇒ Unconfirmed
Patch ⇒ No
Queue ⇒ Horde Base
Summary ⇒ Can't change app-level access perms without disabling or manually clearing cache
Type ⇒ Bug
Priority ⇒ 1. Low
Reply to this comment
I have Horde setup to use hash table and Redis.

If I change application level access permissions, the changes are not visible

If I disable Horde Cache, any changes to permissions apply 
immediately. Also if I run "redis-cli flushall" after making the 
permissions change it works.


It would appear that caching is not being notified of the changes.

If it is too complex to automate a cache-clear with permissions 
changes, perhaps an Apply button that does a cache-clear? Or at the 
very least commentary on the permissions page that changes may not 
take effect until cache is cleared.

I found this issue applied while setting / unsetting Guest permissions 
to Ansel and also to Wicked.

Whilst chasing down this one I also came on this:

horde-clear-cache
Are you sure you want to expire all cached data?
     (y) Yes
     (n) No

Type your choice [n]: y

====================

Fatal Error:
Cannot use KEYS with a cluster of connections
In /usr/share/pear/Predis/Connection/PredisCluster.php on line 135

1. Horde_Cache->clear() /usr/bin/horde-clear-cache:50
2. Horde_Cache_Storage_Hashtable->clear() /usr/share/pear/Horde/Cache.php:164
3. Horde_HashTable_Predis->clear() 
/usr/share/pear/Horde/Cache/Storage/Hashtabl
4. Predis\Client->keys() /usr/share/pear/Horde/HashTable/Predis.php:142
5. Predis\Client->__call() /usr/share/pear/Horde/HashTable/Predis.php:142
6. Predis\Connection\PredisCluster->executeCommand() 
/usr/share/pear/Predis/Cli
7. Predis\Connection\PredisCluster->getConnection() 
/usr/share/pear/Predis/Conn

====================



Saved Queries