mirror of
https://github.com/open-webui/oikb.git
synced 2026-11-05 01:27:25 +00:00
[GH-ISSUE #106] Bug : Failed Open WebUI ingestion causes repeated uploads and disk exhaustion during Google Drive sync #65
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/oikb#65
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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 @ShraddhanandKhot on GitHub (Aug 13, 2026).
Original GitHub issue: https://github.com/open-webui/oikb/issues/106
Bug Summary
When using oikb with the Google Drive connector to sync files into an Open WebUI Knowledge Base, a file that fails during Open WebUI ingestion can be uploaded repeatedly on every sync cycle.
The source file remains unchanged in Google Drive, but because the corresponding Open WebUI file is not successfully attached/processed in the Knowledge Base, the next sync can incorrectly treat the same source file as new and upload it again.
In my case, this resulted in 1,300+ copies of the same file, several GB of unnecessary storage usage, and eventually an Open WebUI backend crash loop caused by repeated processing/embedding attempts.
Environment
What happened
The problem occurs when a source file is downloaded from Google Drive and uploaded to Open WebUI, but Open WebUI fails while extracting/indexing/embedding the file.
For example:
With a one-minute sync interval, this can quickly create hundreds or thousands of duplicate Open WebUI file records.
Observed impact
One problematic file named:
AUDIT NOTE_Contingent Liabilities...pdfwas uploaded 1,314 times.
This caused:
No space left on deviceerrorsIn one incident, the Open WebUI backend was restarting approximately every 61 seconds, with more than 76 restarts observed.
The ChromaDB database eventually had to be rebuilt manually.
Expected behavior
If a file has already been uploaded to Open WebUI but its processing fails, oikb should not continuously re-upload the same unchanged source file on every sync cycle.
A failed ingestion should result in one of the following behaviors:
Most importantly:
Additional issue: failed files accumulate
There is also a secondary cleanup problem.
Failed Open WebUI file records remain on disk even when they are no longer successfully linked to a Knowledge Base.
In my environment, there were approximately:
failedstatusThese failed/orphaned files continue consuming storage.
A mechanism for cleaning up failed/orphaned files, or at least preventing them from accumulating indefinitely, would help prevent gradual disk exhaustion.
Why this is particularly dangerous
The issue is not limited to duplicate database rows.
Every repeated upload can trigger Open WebUI's extraction and embedding pipeline again.
For a problematic document, this means:
This can consume:
and potentially destabilize or crash the Open WebUI backend.
Reproduction
A simplified reproduction would be:
Configure oikb with a Google Drive source and a short sync interval.
Create a Knowledge Base in Open WebUI.
Place a problematic document in the Google Drive folder.
Allow oikb to synchronize the file.
Allow Open WebUI's extraction/embedding process to fail.
Do not modify the source file.
Wait for the next oikb sync cycle.
Observe that the same source file is uploaded again.
Repeat for several sync cycles.
Observe multiple Open WebUI file records for the same source document.
Possible root cause
The failure appears to be caused by a mismatch between oikb's source-side diff state and Open WebUI's successful file/Knowledge Base state.
The source file remains unchanged, but the failed Open WebUI ingestion does not leave the system in a state where the next synchronization can reliably identify the source file as already handled.
This creates a loop:
There may also be an interaction with folder-less/root-level files and Open WebUI's file matching/diff behavior.
I would appreciate confirmation of the exact root cause from the maintainers.
Mitigations currently used
I implemented two temporary mitigations in my environment:
1. Open WebUI-side duplicate detection
I added a fallback that uses content hashing to recognize files that already exist even when the normal folder/filename matching does not identify them correctly.
2. oikb client-side duplicate guard
Before uploading, my oikb client checks the existing Open WebUI files and skips a file when the same filename + content hash already exists.
This currently prevents repeated uploads and the sync reports unchanged files instead of uploading them again.
However, these are workarounds rather than a complete solution because a new problematic file can still be uploaded and fail on its first ingestion attempt.
Suggested improvements
Potential improvements could include:
A. Persist failed ingestion state
Track the source file's content hash and ingestion status:
On the next sync:
B. Retry with backoff
Instead of retrying every minute:
use something such as:
C. Avoid re-uploading known failed content
Use a stable source identifier/content hash so that an unchanged failed document is not uploaded repeatedly.
D. Cleanup failed/orphaned files
Provide a safe mechanism to identify and remove files that:
E. Alerting
Expose sync/ingestion failures through the existing notification mechanism so operators know that a document failed instead of discovering the problem only after the server becomes unavailable.
Additional context
The official oikb documentation describes the project as an incremental synchronization system that should upload only new and modified files.
The current documentation also notes that indexing happens server-side in Open WebUI after oikb uploads a file.
That separation is important here: oikb can successfully upload a file while Open WebUI subsequently fails during extraction or embedding. The synchronization layer therefore needs a reliable way to distinguish:
from:
Logs / evidence
I can provide:
if required.
Impact
This can cause severe operational problems for unattended scheduled synchronization:
Unchanged bad source file → repeated uploads → disk exhaustion → repeated embedding attempts → vector DB corruption/resource exhaustion → Open WebUI crash loop.
This makes the issue particularly important for production deployments using scheduled Google Drive synchronization.
@julianlucks commented on GitHub (Aug 24, 2026):
Confirming this for the local directory connector as well — the loop is connector-agnostic. In our environment, files rejected during ingestion (duplicate content per the KB's content-hash dedup, or no extractable text) were re-uploaded on every sync cycle, accumulating orphaned file records and disk usage server-side.
One additional observation: the dominant channel here is asynchronous. Uploads return HTTP 200 while ingestion runs in the background, and processing errors are swallowed (
_process_handlerlogs the error and sets the file status tofailedwithout re-raising), so oikb never sees the failure synchronously. A client-side guard therefore can't rely on 4xx fromPOST /api/v1/files/alone — checkingGET /api/v1/files/{id}/process/statusafter the fact (or tracking uploads and verifying on the next cycle) is needed to detect these rejections.I've opened #110 with a fix that covers both channels: permanent 4xx rejections are recorded and skipped until the source checksum changes, and accepted uploads are tracked so the next sync checks their server-side status instead of re-uploading. Happy to adjust based on your review.
@m63h17 commented on GitHub (Sep 21, 2026):
Experiencing the same issue. Is there anything one can do?
@ShraddhanandKhot commented on GitHub (Sep 22, 2026):