[GH-ISSUE #8888] Many orphaned files in system after removed from knowledge base via web interface #118619

Closed
opened 2026-05-20 19:57:30 -05:00 by GiteaMirror · 1 comment
Owner

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.]

  • Upload file to the knowledge base using the web interface
  • Note the knowledge base id in the url of the browser
  • Use the web API and go to /api/v1/knowledge.{id} to list files in knowledge base and get the file_id of the file uploaded
  • Use the web API to verify that the file_id returns a file when hitting the /api/v1/files/{file_id} endpoint
  • Delete file from knowledge base using the web interface
  • Confirm that the file is no longer associated with knowledge base by using the web API endpoint /api/v1/knowledge.{id}
  • Confirm the file still exists by hitting the web API endpoint /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.

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.] - Upload file to the knowledge base using the web interface - Note the knowledge base id in the url of the browser - Use the web API and go to `/api/v1/knowledge.{id}` to list files in knowledge base and get the `file_id` of the file uploaded - Use the web API to verify that the file_id returns a file when hitting the `/api/v1/files/{file_id}` endpoint - Delete file from knowledge base using the web interface - Confirm that the file is no longer associated with knowledge base by using the web API endpoint `/api/v1/knowledge.{id}` - Confirm the file still exists by hitting the web API endpoint `/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.
Author
Owner

@tjbck commented on GitHub (Jan 25, 2025):

Intended behaviour, for now but PR welcome here.

<!-- gh-comment-id:2613718193 --> @tjbck commented on GitHub (Jan 25, 2025): Intended behaviour, for now but PR welcome here.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#118619