mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-23 10:02:10 -05:00
[GH-ISSUE #8888] Many orphaned files in system after removed from knowledge base via web interface #69912
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 @cwthomas-llu on GitHub (Jan 24, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/8888
Bug Report
Installation Method
docker container
Environment
Open WebUI Version: v0.5.4
Operating System: Rocky Linux - N.A. since Open-WebUI is running in a container
Expected Behavior:
[Describe what you expected to happen.]
When an item is removed from the knowledge base using the web interface, the file should be deleted from the open-webui filesystem. Currently the file stays around and is accessible using the web API.
Actual Behavior:
[Describe what actually happened.]
The file still exists in open-webui and not associated with any knowledge base, thus an orphan file.
Description
Bug Summary:
[Provide a brief but clear summary of the bug]
When an item is removed from the knowledge base web interface, it still remains in the system.
Reproduction Details
Steps to Reproduce:
[Outline the steps to reproduce the bug. Be as detailed as possible.]
/api/v1/knowledge.{id}to list files in knowledge base and get thefile_idof the file uploaded/api/v1/files/{file_id}endpoint/api/v1/knowledge.{id}/api/v1/files/{file_id}Logs and Screenshots
None
Additional Information
There is no way to see orphaned files from the web user interface. The only way is to build a custom program that uses the web API to compare the files in all the knowledge bases vs the files endpoint. There should be a way to see orphaned files or when a user removes a file from the knowledge base, it should also delete the file from open-webui (given there isn't another collection using it).
We have used open-webui for a short amount of time, but have added and deleted a lot of items from collections for testing purposes. Over time, this will become a lot and we might run out of disk space when all this could be avoided by removing orphaned files.
@tjbck commented on GitHub (Jan 25, 2025):
Intended behaviour, for now but PR welcome here.