You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ X ] I have read and followed all the instructions provided in the README.md.
I am on the latest version of both Open WebUI and Ollama.
I have included the browser console logs.
[ X ] I have included the Docker container logs.
[ X ] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.
Expected Behavior:
File deletion from a knowledge base should remove both the UI entry and the corresponding database content
The operation should provide feedback about its success/failure
Re-uploading a previously deleted file should work as if it were a new file
Actual Behavior:
File deletion sometimes only removes the file from the frontend FilesTable
No feedback is provided about whether the database deletion was successful
The vector database can retain the old entries even after file deletion
Attempting to re-upload the same file results in a "duplicate content" error
Description
Bug Summary:
When deleting a processed file from a knowledge base through the frontend, the file appears to be removed from the UI but its content sometimes remains in the vector database. This creates issues when trying to re-upload the same file, as the system detects it as duplicate content.
Reproduction Details
This is frustratingly a "sometimes" error. So my proposed solution would be to add logging to make it easier to reproduce.
Steps to Reproduce:
Upload a file to a knowledge base
Delete the file using the remove button in the FilesTable
Try to upload the same file again
Observe the "duplicate content" error.
Logs and Screenshots
Docker Container Logs:
// When removing a file:
INFO: 10.1.1.4:0 - "POST /api/v1/knowledge/{id}/file/remove HTTP/1.1" 200 OK
// When trying to re-upload (error due to remaining content):
INFO: 10.1.1.4:0 - "GET /api/v1/knowledge/{id} HTTP/1.1" 200 OK
INFO [open_webui.apps.webui.routers.files] file.content_type: text/plain
INFO [open_webui.apps.retrieval.main] save_docs_to_vector_db: document {file} {file_collection_id}
INFO [open_webui.apps.retrieval.main] adding to collection {file_collection_id}
Collection {file_collection_id} does not exist.
INFO: 10.1.1.4:0 - "POST /api/v1/files/ HTTP/1.1" 200 OK
INFO [open_webui.apps.retrieval.main] save_docs_to_vector_db: document {file} {id}
INFO [open_webui.apps.retrieval.main] Document with hash [file hash} already exists
ERROR [open_webui.apps.retrieval.main] Duplicate content detected. Please provide unique content to proceed.
Traceback (most recent call last):
File "/app/backend/open_webui/apps/retrieval/main.py", line 1001, in process_file
raise e
File "/app/backend/open_webui/apps/retrieval/main.py", line 975, in process_file
result = save_docs_to_vector_db(
^^^^^^^^^^^^^^^^^^^^^^^
File "/app/backend/open_webui/apps/retrieval/main.py", line 759, in save_docs_to_vector_db
raise ValueError(ERROR_MESSAGES.DUPLICATE_CONTENT)
ValueError: Duplicate content detected. Please provide unique content to proceed.
INFO: 10.1.1.4:0 - "POST /api/v1/knowledge/{id}/file/add HTTP/1.1" 400 Bad Request
// Compare with Logs when adding a file:
INFO: 10.1.1.222:0 - "POST /api/v1/files/ HTTP/1.1" 200 OK
INFO [open_webui.apps.webui.routers.files] file.content_type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
INFO [open_webui.apps.retrieval.main] save_docs_to_vector_db: document {filename} {collection_id}
INFO [open_webui.apps.retrieval.main] collection {collection_id} already exists
INFO [open_webui.apps.retrieval.main] adding to collection {collection_id}
Additional Information
The issue appears to be in the file removal endpoint (@router.post("/{id}/file/remove") in knowledge.py. Currently:
The deletion operation doesn't verify if the vector database cleanup was successful
The frontend updates regardless of the backend operation's success
The deletion doesn´t give feedback on the new state of the collection
Proposed Solution
Add verification of vector database deletion
Add error handling and user feedback
Only update the frontend UI after confirmed successful deletion
The text was updated successfully, but these errors were encountered:
Would love to investigate more but we'll need a more reliable way to reproduce the issue, definitely continue our troubleshooting journey and keep us posted!
Bug Report
Installation Method
Kubernetes on Azure Kubernetes Service
Environment
**Open WebUI Version: 0.4.0
**Operating System: AKSUbuntu-2204
**Browser: Firefox 132.0.2
Confirmation:
Expected Behavior:
Actual Behavior:
Description
Bug Summary:
When deleting a processed file from a knowledge base through the frontend, the file appears to be removed from the UI but its content sometimes remains in the vector database. This creates issues when trying to re-upload the same file, as the system detects it as duplicate content.
Reproduction Details
This is frustratingly a "sometimes" error. So my proposed solution would be to add logging to make it easier to reproduce.
Steps to Reproduce:
Logs and Screenshots
Docker Container Logs:
// When removing a file:
INFO: 10.1.1.4:0 - "POST /api/v1/knowledge/{id}/file/remove HTTP/1.1" 200 OK
// When trying to re-upload (error due to remaining content):
INFO: 10.1.1.4:0 - "GET /api/v1/knowledge/{id} HTTP/1.1" 200 OK
INFO [open_webui.apps.webui.routers.files] file.content_type: text/plain
INFO [open_webui.apps.retrieval.main] save_docs_to_vector_db: document {file} {file_collection_id}
INFO [open_webui.apps.retrieval.main] adding to collection {file_collection_id}
Collection {file_collection_id} does not exist.
INFO: 10.1.1.4:0 - "POST /api/v1/files/ HTTP/1.1" 200 OK
INFO [open_webui.apps.retrieval.main] save_docs_to_vector_db: document {file} {id}
INFO [open_webui.apps.retrieval.main] Document with hash [file hash} already exists
ERROR [open_webui.apps.retrieval.main] Duplicate content detected. Please provide unique content to proceed.
Traceback (most recent call last):
File "/app/backend/open_webui/apps/retrieval/main.py", line 1001, in process_file
raise e
File "/app/backend/open_webui/apps/retrieval/main.py", line 975, in process_file
result = save_docs_to_vector_db(
^^^^^^^^^^^^^^^^^^^^^^^
File "/app/backend/open_webui/apps/retrieval/main.py", line 759, in save_docs_to_vector_db
raise ValueError(ERROR_MESSAGES.DUPLICATE_CONTENT)
ValueError: Duplicate content detected. Please provide unique content to proceed.
INFO: 10.1.1.4:0 - "POST /api/v1/knowledge/{id}/file/add HTTP/1.1" 400 Bad Request
// Compare with Logs when adding a file:
INFO: 10.1.1.222:0 - "POST /api/v1/files/ HTTP/1.1" 200 OK
INFO [open_webui.apps.webui.routers.files] file.content_type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
INFO [open_webui.apps.retrieval.main] save_docs_to_vector_db: document {filename} {collection_id}
INFO [open_webui.apps.retrieval.main] collection {collection_id} already exists
INFO [open_webui.apps.retrieval.main] adding to collection {collection_id}
Additional Information
The issue appears to be in the file removal endpoint (@router.post("/{id}/file/remove") in knowledge.py. Currently:
Proposed Solution
The text was updated successfully, but these errors were encountered: