mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[GH-ISSUE #15249] issue: Race condition in opensearch vector db implementation #56173
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 @dlamoris on GitHub (Jun 24, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/15249
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.6.15
Ollama Version (if applicable)
0.9.2
Operating System
macOS
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
I'm using an external custom content extraction engine that returns multiple documents for a single file upload (one reason is to take advantage of metadata.page support in citations), with opensearch vector db.
When I upload a file to a knowledge base (in this case the file is the only file in the kb), then either reference the file or knowledge base in a chat, I expect the citation results to be similar for the same query
Actual Behavior
When referencing the single file, results and citations come up as expected and I see the correct chunks and page number.
When referencing the knowledge base, different chunks and citations are shown and does not match the results of the single file referenced.
Steps to Reproduce
This is due to a race condition in the opensearch implementation when adding a file to a knowledge base - the file is uploaded and processed first, and immediately another call is made to add the file id to the knowledge base.
This does a vector db query to get the indexed documents of the file to add to the knowledge base collection, but if opensearch hasn't made those metadata ready for search yet, nothing is returned and a single document is made as fallback with the contents stored from the db
In open_webui/routers/retrival.py/process_file line 1311 (at the time of this issue)
Logs & Screenshots
calls from browser when uploading a file to a knowledge base
Additional Information
Will make a pr to force opensearch to refresh indexes as collections gets changed, so search queries will work immediately