mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[GH-ISSUE #20229] issue: Knowledge Base not visible when shared with multiple groups (SQLite) #19131
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @taka817123 on GitHub (Dec 29, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20229
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
v0.6.43
Ollama Version (if applicable)
No response
Operating System
Windows11
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
A user belonging to both Group B and Group C should be able to see a Knowledge Base that is shared with both Group B and Group C.
Actual Behavior
A user belonging to both Group B and Group C cannot see a Knowledge Base that is shared with both Group B and Group C.
However, if the Knowledge Base is shared only with Group B, the user can see it correctly.
Steps to Reproduce
Create a user (User A).
Create two groups (Group B and Group C).
Add User A to both Group B and Group C (or it can be possible to reproduce only adding to Group B) .
Create a Knowledge Base (e.g., "test3").
Update "test3" access control to share it with both Group B and Group C.
Log in as User A.
Observe that "test3" is not visible in the Knowledge Base list.
Update "test3" access control to share it only with Group B.
Observe that "test3" becomes visible to User A.
Logs & Screenshots
For this setting, Test3 KB is not appeared on UserA KB list.
Additional Information
The issue seems to be located in [access_control.py]. The usage of [.contains()] for JSON columns in SQLite via SQLAlchemy might not be behaving as expected when multiple items are present. Replacing it with [json_extract] and LIKE seems to fix the issue.
DocumentModel.access_control["write"]["group_ids"].contains(
[gid]
)
func.json_extract(
DocumentModel.access_control, "$.write.group_ids"
).like(f'%"{gid}"%')
@owui-terminator[bot] commented on GitHub (Dec 29, 2025):
🔍 Similar Issues Found
I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:
#19752 issue: minor UI Bug: knowledge sharing
by mahenning • Dec 04, 2025 •
bug#19701 issue: knowledge can not multiple upload file
by willy808 • Dec 03, 2025 •
bug#19861 issue:
by QuitHub • Dec 10, 2025 •
bug#19877 issue:
by dotmobo • Dec 11, 2025 •
bug#20046 issue:
by pierrelouisbescond • Dec 19, 2025 •
bugShow 5 more related issues
#19190 issue: Synchronization with Folder Leads to Empty Knowledge Base
by flefevre • Nov 14, 2025 •
bug#20019 issue:
by j63440490 • Dec 17, 2025 •
bug#19491 issue: Referencing Knowledge in chats with '#' no longer shows which knowledge base does the file belong to
by donatas-xyz • Nov 25, 2025 •
bug#19426 issue: Strange Behavior With Groups
by matthew-kusz • Nov 24, 2025 •
bug#19563 issue:
by naruto7g • Nov 28, 2025 •
bug💡 Tips:
This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
@taka817123 commented on GitHub (Dec 29, 2025):
If my assumption is correct, there are 3 points to fix it (FYI).
1. In 'read_only' block - Read permission
2. In 'read_only' block - Write permission (exclusion)
3. In General permission block (end of function)
@Classic298 commented on GitHub (Dec 29, 2025):
@silentoplayz
@silentoplayz commented on GitHub (Dec 29, 2025):
I have thoroughly tested this issue on the latest
devcommit and can confirm that I am able to reproduce it using the provided steps. The issue occurs regardless of whether Group B and Group C both have read access, both have write access, or if one has read access while the other has write access. Adding a third group did not resolve the issue, indicating that the problem arises specifically when a user is a member of more than one group and the Knowledge Base is shared with groups where the user is a member of at least two of them. I tested with the maximum permissions assigned to all user groups.@Classic298 commented on GitHub (Dec 29, 2025):
investigating
@taka817123 commented on GitHub (Dec 29, 2025):
Happy Holidays! Thanks for the quick fix!
@Classic298 commented on GitHub (Dec 30, 2025):
fixed by
61e25dc2dc