mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-15 21:19:39 -05:00
[GH-ISSUE #24807] issue: Knowledge upload can leave processed files unlinked if the user navigates away before final linking #123716
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 @hytg on GitHub (May 16, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24807
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.9.5
Ollama Version (if applicable)
not used
Operating System
macOS Tahoe 26.5(25F71)
Browser (if applicable)
Chromium via Playwright-automated reproduction
Also reproducible manually in Chrome-based browsers
Confirmation
README.md.Summary
This issue describes two related navigation-timing modes:
/file/addis sent. The file is processed successfully, but it is never linked to the Knowledge Collection. This creates a persistent inconsistent state with no recovery./file/addis sent, but before it completes. The backend eventually links the file, but the UI temporarily shows an empty Knowledge Collection and provides no indication that linking is still running.Both modes appear to come from the same fragile flow: the final Knowledge linking step depends on frontend code that runs only after file processing completes and the original page is still mounted.
Timing model
Mode A:
Mode B:
Expected Behavior
When a file is uploaded to a Knowledge Collection, it should be reliably linked to that Knowledge Collection after backend processing completes.
This should remain true even if the user:
At minimum, Open WebUI should not enter a state where:
completedThe correctness of the file → Knowledge Collection linking step should not depend on the original browser page remaining mounted until all processing and linking work has finished.
A durable behavior would be:
The user should not need to keep the original upload page open for the final Knowledge Collection association to succeed.
Actual Behavior
Uploading a file to a Knowledge Collection currently appears to depend on a frontend-driven final linking step.
Observed flow:
This creates two navigation-sensitive modes.
Mode A — primary correctness bug
Mode A occurs when the user navigates away before the frontend sends:
In this mode:
completed/file/addrequest is ever sentObserved final state:
This is the primary correctness issue: a successfully processed file can be permanently left unlinked from the Knowledge Collection it was uploaded into.
Mode B — related UX / state-visibility bug
Mode B occurs when the user navigates away after
/file/addhas been sent, but before it returns200.In this mode, the backend eventually links the file to the Knowledge Collection. However, the UI state is misleading while that backend work is still running.
Observed behavior:
ERR_ABORTED/file/addObserved final state:
Mode B is not the same as Mode A: the backend eventually succeeds. But it exposes the same underlying fragility and leaves the user looking at an empty Knowledge Collection with no actionable status.
Steps to Reproduce
Environment used:
ghcr.io/open-webui/open-webui:devv0.9.5359590ca9d06ee89f616b8a3caebdade93f6228bsha256:4cfb1bc021aa25e2831625b38c4a91aa0c2da5720e52c247555d1116e946482e2026-05-15T00:35:19ZSteps:
Start Open WebUI using Docker.
Log in as an admin user.
Go to:
Create a new Knowledge Collection.
Open the Knowledge Collection detail page.
Upload a PDF file that keeps backend processing running long enough for navigation to happen before linking completes.
The root trigger is navigation timing.
File byte size, extracted text density, chunk count, and embedding latency only affect the length of the vulnerable windows. They make the issue easier or harder to reproduce, but they are not the underlying cause.
To reproduce Mode A, navigate away to:
while the upload spinner is still shown and before the SSE status stream completes.
To reproduce Mode B, navigate away shortly after the spinner disappears, after
/file/addhas been sent, but before:receives a
200response.Navigate back to the same Knowledge Collection page.
Observe the result.
Expected:
Actual:
completed, but the Knowledge Collection remains empty indefinitely.Logs & Screenshots
Exact API sequence observed for Mode A
Navigation occurred approximately 30 seconds after upload started.
Backend processing completed approximately 37 seconds after navigation, for a total of approximately 67 seconds from upload start.
The log contains both
1540 itemsand220 itemsmessages. These appear to refer to different internal units, likely split vector items versus pre-split documents/pages. The important point is that backend file-level processing completed successfully and populatedfile-{file_id}.Backend log highlights for Mode A
No
/api/v1/knowledge/{knowledge_id}/file/addrequest appears anywhere in the backend log for this Mode A reproduction.Important clarification
In these logs,
collection file-{file_id}refers to the file-level vector collection, not the user-created Knowledge Collection.The file itself is processed successfully. The failed part is the final file → Knowledge Collection linking step.
Mode B observation
In another reproduction,
/file/addwas sent after file-level processing completed, but the user navigated away while the request was still in-flight.The browser reported
ERR_ABORTED. However, backend logs confirm that the backend continued processing/file/addafter the client disconnected and eventually completed the Knowledge Collection embedding.The Knowledge Collection appears empty when the user first returns to the page, because the backend embedding work is still in progress.
Once the backend finishes, the file link is present. However, the UI does not update automatically. A manual reload is required to see the file.
Additional Information
Observed file size threshold for UI reproduction
In the test environment described above (Open WebUI v0.9.5), both Mode A and Mode B were reproduced via browser UI automation.
A 54-page text-dense synthetic PDF (~55 KB) was the smallest profile that reliably reproduced both modes. A 40-page PDF (~40 KB) frequently completed processing before the navigation window opened and could not reliably reproduce either mode.
File-level processing for the 54-page file took approximately 67 seconds end-to-end. Knowledge collection embedding (
/file/add) also took approximately 67 seconds. These durations depend on text density, chunk count, and embedding provider latency, and will vary across deployments.@owui-terminator[bot] commented on GitHub (May 16, 2026):
🔍 Related Issues Found
I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions:
🟣 #22573 issue: Files Not Linked to Knowledge Collection When Dropped Simultaneously (
FILE_NOT_PROCESSEDRace Condition)This is the closest match: it describes files being uploaded and processed but never linked to the Knowledge Collection, leaving them effectively invisible. The trigger differs (simultaneous drag-drop vs navigation away), but both issues center on the fragile frontend-driven linking step after file processing.
by jannefleischer ·
bug🟢 #19190 issue: Synchronization with Folder Leads to Empty Knowledge Base
This issue reports the UI showing an empty knowledge base after synchronization is interrupted, while the backend state may still contain files. It is related to the same class of stale/empty Knowledge Collection state versus backend reality, though the cause is folder sync rather than upload navigation timing.
by flefevre ·
bug,confirmed issue🟣 #20730 issue: API to knowledge doesn't list files
This issue shows that the knowledge API can return
files: null/ not list files even when the knowledge object exists, which aligns with the symptom of a Knowledge Collection appearing empty despite backend-side data. It is a weaker but relevant state-visibility/listing issue.by sigi77 ·
bug🟢 #10679 Batch add file to knowledge doesn't check for existence
This bug is about the
/knowledge/{id}/files/batch/addpath and how knowledge-file addition behaves inconsistently. It is relevant because the new report also implicates the file-add/linking step as a separate backend operation after upload and processing.by almajo ·
bug,confirmed issue💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead.
This comment was generated automatically. React with 👍 if helpful, 👎 if not.
@hytg commented on GitHub (May 16, 2026):
I think #22573 is the closest related case. Both issues have a similar end result: the file is
completedin Global Files, but is not linked to the Knowledge Collection. However, the failure mode is different.POST /knowledge/{id}/file/addbefore processing has completed → the backend returns400 FILE_NOT_PROCESSED→ the frontend does not recover from that error → the link request remains rejected and the file becomes orphaned./file/addat all. The user navigates away before the SSE stream completes, so backend file-level processing completes successfully, but the final Knowledge Collection link is never created./file/addis sent and the backend eventually succeeds. However, from the browser side the request appears interrupted, the UI does not show that linking is still in progress, and the collection view does not refresh automatically after linking completes.So the trigger and code path are different.
Also, #22573 is already closed, but the author mentioned in the closing comment that closing the browser window early can still lead to unlinked results. That sounds very close to the navigation / page-unmount case described here, but it was not the main subject of #22573 and appears to remain unresolved.
#19190 has a similar symptom in that the UI can show an empty Knowledge Collection while files still exist on the backend, but its trigger is interrupted folder synchronization, not navigation during upload.
#20730, where the Knowledge API returns
files: null, and #10679, about missing duplicate checks in batch add, are both Knowledge/file-related issues, but they seem separate from this navigation-timing / frontend-driven final-linking problem.Based on that, I think this issue is strongly related to #22573, but not an exact duplicate. In particular, the failure mode where the final file-to-Knowledge linking step depends on the original upload page staying mounted seems worth tracking separately.
@hytg commented on GitHub (May 18, 2026):
I opened a design discussion for a possible fix direction here: https://github.com/open-webui/open-webui/discussions/24871
@paulxg12 commented on GitHub (May 18, 2026):
I'd like to work on this issue. Could you clarify what CLA text needs to be included in the PR description?
@Classic298 commented on GitHub (May 18, 2026):
The one that's included by default when you open a PR. Just don't delete it :)
@tjbck commented on GitHub (May 19, 2026):
Should be addressed in dev.