mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-11 08:15:00 -05:00
Bug: Model fails to detect files in a private collection #6358
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 @chayaziv on GitHub (Sep 10, 2025).
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
v0.6.27
Ollama Version (if applicable)
No response
Operating System
Windows 10
Browser (if applicable)
Chrome 100.0
Confirmation
README.md.Expected Behavior
Users should be able to ask questions about content in their private collection
When using
#collection_namecommand or when the model is linked to the collection, the model should have access to the contentQuestions like "How many sections are in the file?" should work with private collection
The model should be able to retrieve and reference content from private collection owned by the user
Actual Behavior
The model cannot find any relevant information from private collection
Questions about file content return no results
The system only works for:
Admin users
Public Collection
Collection where the user is a member of a group that has access permissions
Steps to Reproduce
Create a new collection with USER permission level
Set it to Private
Upload files to the collection
Attach the collection to the chat using the “#” selector or create a model and link it to the collection
Try to ask questions about the content in chat:
The model will not find any relevant information
Logs & Screenshots
Additional Information
Bug Description
When a user creates a private collection and tries to use it in chat, the model cannot access the content from the collection, even though:
The user is the owner of the collection
The collection is visible in the knowledge tab
The collection is properly attached to the model
Root Cause Analysis
The issue is in
backend/open_webui/retrieval/utils.pyat lines 582-585:The
has_accessfunction doesn't include the owner in the permitted users list for private knowledge bases.Comparison with Working Code
In
backend/open_webui/models/knowledge.py(lines 171-174), the correct pattern is used:Proposed Fix
Add the missing owner check in
backend/open_webui/retrieval/utils.py:@tjbck commented on GitHub (Sep 10, 2025):
How many sections are in the file?will not work as metadata isn't injected in the context.@chayaziv commented on GitHub (Sep 11, 2025):
Hi, just a quick clarification
The example question "How many sections are in the file?" was not the best choice. But the bug itself is still valid, regardless of the exact phrasing.
The core problem is that the model has no access to the file content in a private collection (even when the user is the owner). As a result, it always responds with no information or says the data is missing.
Instead of the example question, take any other question, for example: "Which design library should be used according to the requirements in the file?"
React Homework Assignment Requirements.pdf
I would be happy to see the issue reopened.
@rgaricano commented on GitHub (Sep 11, 2025):
as user & as admin:
(added file to a collection with private access, added collection with # command)
@chayaziv commented on GitHub (Sep 11, 2025):
If you define a group for the collection it should really work because defining a group includes the creator
I'm talking about:
@rgaricano commented on GitHub (Sep 11, 2025):
I removed the group,
same results, for user & admin....also tested creating the collection as private & with no group from the beginning.
@chayaziv commented on GitHub (Sep 11, 2025):
I need to check how this makes sense,
because I had the problem, and after I added the missing line in the code, everything worked!
Maybe I have a different issue.
I need to investigate, and it will take me a few days.
But in the meantime, how does this fit with what I see in the code, black on white, as I demonstrated above?
I really want to understand,
so I would appreciate an answer.
@rgaricano commented on GitHub (Sep 11, 2025):
In backend/open_webui/retrieval/utils.py at lines 582-585:
Yes, is a check, but inside of a IF condition, in here it retrieve FULL FILE CONTENT, getting the full content directly from the file...
In
backend/open_webui/models/knowledge.py (lines 171-174):
is inside the get_knowledge_bases_by_user_id function.
@chayaziv commented on GitHub (Sep 12, 2025):
You're right that the condition (lines 582–585) is inside a condition on the environment variable
BYPASS_EMBEDDING_AND_RETRIEVAL.
And now I understand why it works for you but not for me, because on my side the variable BYPASS_EMBEDDING_AND_RETRIEVAL = TRUE.
In such a case, a problematic condition is checked where a line is missing.
Please change the variable to TRUE and then again:
Log in with USER permission
Create a private collection without a group
Add the attached file to the collection
Add the collection to the chat with #
And ask: "Which design library should be used according to the instructions in the file?"
I’m curious to hear what happens.