mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-12 11:04:58 -05:00
[GH-ISSUE #20853] [BUG] RAG reindexing fails with "Duplicate content detected" - cannot update existing documents #122625
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 @dimzon on GitHub (Jan 21, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20853
## Description
The "Reindex" functionality in Knowledge Bases is completely broken due to overly aggressive duplicate content detection. When attempting to reindex documents or upload the same document again (even with different chunking settings), the system throws an error and refuses to proceed.
## Steps to Reproduce
ValueError: Duplicate content detected. Please provide unique content to proceed.## Expected Behavior
## Current Behavior
## Error Logs
## Root Cause
The issue appears to be in
open_webui/routers/retrieval.pyaround line 1420 where duplicate detection raises an exception instead of providing update options:## Impact
## Critical Design Flaw: No Logical Reason to Ban Identical Content
There is no logical reason to prohibit identical content fragments across different documents:
Normal document scenarios:
RAG systems are designed to handle this:
Current implementation harms usability:
## Suggested Fix
Proposed code change:
## Workarounds Users Are Forced to Use
## Environment
## Additional Context
This bug completely breaks the intended use case where documents need periodic updates or reindexing with new settings. The current implementation treats all duplicates as errors rather than providing management options, which goes against standard document management practices in other RAG systems (ChromaDB, Pinecone, etc. all support upsert operations).
Most importantly, there's no valid reason to prohibit identical content across documents. RAG systems should handle this naturally through metadata and search ranking, not by blocking document management operations.
## Priority
This is a BLOCKER bug for any serious use of the Knowledge Base feature, as it prevents basic document maintenance and optimization.
@Classic298 commented on GitHub (Jan 21, 2026):
ah the issue is not that the check is there, it correctly prevents duplicate files but that the check is being done when reindexing.
Will need to see first if I am able to reproduce.
No. Simply no.
Yes there is.
It's to prevent duplicate file uploads by users who don't know any better and spam your backend with many duplicate files. Nobody wants that.
And it sure as hell does not IMPROVE the rag performance if you have many duplicates, even if reranking should catch it.