[GH-ISSUE #17032] feat: Add REDIS_KEY_PREFIX to ALL redis calls #18144

Closed
opened 2026-04-20 00:18:00 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @AlbertDoesProgramming on GitHub (Aug 29, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/17032

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

Following the change here issue-16979, I've tried to use the REDIS_KEY_PREFIX and ACLs to gate permissions for a given open-webui instance behind the key prefix. For example, the pseudo code below

REDIS_KEY_PREFIX = "openwebui-special"

redis-cli -u redis://redis-password@redis-host:redis-port 
                ACL SETUSER openwebuispecial 
                on 
                ~openwebui-special:* 
                +@all 
                ">openwebuispecial-password"

The issue, is there are other places where redis is used in openwebui not covered by the previous change. For example, in tools.py:

if request.app.state.redis is not None:
    await request.app.state.redis.set(
        "tool_servers", json.dumps(request.app.state.TOOL_SERVERS)
    )

and

tool_servers = json.loads(await request.app.state.redis.get("tool_servers"))

These keys are not prefixed and so, openwebui will throw a permissions error like the following:

2025-08-29 09:54:29.646 | ERROR    | open_webui.utils.tools:get_tool_servers:494 - Error fetching tool_servers from Redis: No permissions to access a key
...
redis.exceptions.NoPermissionError: No permissions to access a key

Desired Solution you'd like

Please ensure that these keys are also prefixed. I am not sure if there are any others which also may need prefixing - I have searched for all instances of Redis use in the codebase, and these seem to be the only ones left - but might be worth a sanity check.

Alternatives Considered

I can add this tool_servers key to my ACL but I don't think that's in the spirit of the previous changes. If there are any others I'd also have to keep adding these which again feels out of the spirit of the previous changes.

Additional Context

No response

Originally created by @AlbertDoesProgramming on GitHub (Aug 29, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/17032 ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description Following the change here [issue-16979](https://github.com/open-webui/open-webui/issues/16979#issuecomment-3232664106), I've tried to use the REDIS_KEY_PREFIX and ACLs to gate permissions for a given open-webui instance behind the key prefix. For example, the pseudo code below ``` REDIS_KEY_PREFIX = "openwebui-special" redis-cli -u redis://redis-password@redis-host:redis-port ACL SETUSER openwebuispecial on ~openwebui-special:* +@all ">openwebuispecial-password" ``` The issue, is there are other places where redis is used in openwebui not covered by the previous change. For example, in [tools.py](https://github.com/open-webui/open-webui/blob/main/backend/open_webui/utils/tools.py): ```python if request.app.state.redis is not None: await request.app.state.redis.set( "tool_servers", json.dumps(request.app.state.TOOL_SERVERS) ) ``` and ```python tool_servers = json.loads(await request.app.state.redis.get("tool_servers")) ``` These keys are not prefixed and so, openwebui will throw a permissions error like the following: ``` 2025-08-29 09:54:29.646 | ERROR | open_webui.utils.tools:get_tool_servers:494 - Error fetching tool_servers from Redis: No permissions to access a key ... redis.exceptions.NoPermissionError: No permissions to access a key ``` ### Desired Solution you'd like Please ensure that these keys are also prefixed. I am not sure if there are any others which also may need prefixing - I have searched for all instances of Redis use in the codebase, and these seem to be the only ones left - but might be worth a sanity check. ### Alternatives Considered I can add this tool_servers key to my ACL but I don't think that's in the spirit of the previous changes. If there are any others I'd also have to keep adding these which again feels out of the spirit of the previous changes. ### Additional Context _No response_
Author
Owner

@tjbck commented on GitHub (Aug 29, 2025):

PR welcome!

<!-- gh-comment-id:3237500785 --> @tjbck commented on GitHub (Aug 29, 2025): PR welcome!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#18144