Originally created by @DirkRemmers on GitHub (Sep 2, 2025).
Check Existing Issues
I have searched the existing issues and discussions.
I am using the latest version of Open WebUI.
Installation Method
Docker
Open WebUI Version
v0.6.22
Ollama Version (if applicable)
No response
Operating System
Debian
Browser (if applicable)
No response
Confirmation
I have read and followed all instructions in README.md.
I am using the latest version of both Open WebUI and Ollama.
I have included the browser console logs.
I have included the Docker container logs.
I have provided every relevant configuration, setting, and environment variable used in my setup.
I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
Start with the initial platform/version/OS and dependencies used,
Specify exact install/launch/configure commands,
List URLs visited, user input (incl. example values/emails/passwords if needed),
Describe all options and toggles enabled or changed,
Include any files or environmental changes,
Identify the expected and actual result at each stage,
Ensure any reasonably skilled user can follow and hit the same issue.
Expected Behavior
When using the following API endpoint: POST /api/v1/knowledge/{knowledge_id}/file/remove, the file that is specified in the data should be deleted only from the knowledge collection, not from the entire system.
Actual Behavior
Instead, when I use the following api endpoint: POST /api/v1/knowledge/{knowledge_id}/file/remove, the file is removed from the system entirely
Steps to Reproduce
To reproduce:
add a file to the database (POST /api/v1/files/) and get the id (file_id)
validate the file is added (GET /api/v1/files/{file_id})
create a knowledge collection (POST /api/v1/knowledge/create) and get the id (knowledge_id)
add the file to the knowledge collection (POST /api/v1/knowledge/{knowledge_id}/file/add with data = {"file_id"=file_id})
remove the file from the knowledge collection (POST /api/v1/knowledge/{knowledge_id}/file/remove with `data={"file_id"=file_id})
try and find the file again (GET /api/v1/files/{file_id})
Logs & Screenshots
Additional Information
I don't believe this is the intended behaviour, so I guess this should be fixed?
Cheers,
Dirk
Originally created by @DirkRemmers on GitHub (Sep 2, 2025).
### Check Existing Issues
- [x] I have searched the existing issues and discussions.
- [x] I am using the latest version of Open WebUI.
### Installation Method
Docker
### Open WebUI Version
v0.6.22
### Ollama Version (if applicable)
_No response_
### Operating System
Debian
### Browser (if applicable)
_No response_
### Confirmation
- [x] I have read and followed all instructions in `README.md`.
- [x] I am using the latest version of **both** Open WebUI and Ollama.
- [x] I have included the browser console logs.
- [x] I have included the Docker container logs.
- [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.**
- [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
- [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps:
- Start with the initial platform/version/OS and dependencies used,
- Specify exact install/launch/configure commands,
- List URLs visited, user input (incl. example values/emails/passwords if needed),
- Describe all options and toggles enabled or changed,
- Include any files or environmental changes,
- Identify the expected and actual result at each stage,
- Ensure any reasonably skilled user can follow and hit the same issue.
### Expected Behavior
When using the following API endpoint: `POST /api/v1/knowledge/{knowledge_id}/file/remove`, the file that is specified in the `data` should be deleted only from the knowledge collection, not from the entire system.
### Actual Behavior
Instead, when I use the following api endpoint: `POST /api/v1/knowledge/{knowledge_id}/file/remove`, the file is removed from the system entirely
### Steps to Reproduce
To reproduce:
1. add a file to the database (`POST /api/v1/files/`) and get the id (file_id)
2. validate the file is added (`GET /api/v1/files/{file_id}`)
3. create a knowledge collection (`POST /api/v1/knowledge/create`) and get the id (knowledge_id)
4. add the file to the knowledge collection (`POST /api/v1/knowledge/{knowledge_id}/file/add` with `data = {"file_id"=file_id}`)
5. remove the file from the knowledge collection (`POST /api/v1/knowledge/{knowledge_id}/file/remove` with `data={"file_id"=file_id})
6. try and find the file again (`GET /api/v1/files/{file_id}`)
### Logs & Screenshots
-
### Additional Information
I don't believe this is the intended behaviour, so I guess this should be fixed?
Cheers,
Dirk
GiteaMirror
added the bug label 2025-11-11 16:50:19 -06:00
When using the following API endpoint: POST /api/v1/knowledge/{knowledge_id}/file/remove, the file that is specified in the data should be deleted only from the knowledge collection, not from the entire system.
not from the entire system.
What do you mean by this?
If you remove a file from the knowledge base, of course the file becomes unusable in Open WebUI as there is no longer any active reference to the file.
But the file IS kept on disk and in the vector database for data retention purposes.
But it is unusable from the web ui.
If that is your question, yes it is intended that the file is removed and becomes unusable from the webui after you remove (delete) it from a knowledge collection (and why would it not be?)
@Classic298 commented on GitHub (Sep 2, 2025):
> When using the following API endpoint: POST /api/v1/knowledge/{knowledge_id}/file/remove, the file that is specified in the data should be deleted only from the knowledge collection, not from the entire system.
> **not from the entire system.**
What do you mean by this?
If you remove a file from the knowledge base, of course the file becomes unusable in Open WebUI as there is no longer any active reference to the file.
But the file IS kept on disk and in the vector database for data retention purposes.
But it is unusable from the web ui.
If that is your question, yes it is intended that the file is removed and becomes unusable from the webui after you remove (delete) it from a knowledge collection (and why would it not be?)
@Classic298 , using the API, you can upload files without adding them to any knowledge base. You can then link the file to knowledge bases using the id that the file then gets. This allows you to (for example) link it to multiple knowledge bases.
It should still be possible to remove the file from one knowledge base, and then link it to another knowledge base. For this, the id of the file needs to remain, and therefore the file needs to remain.
Your logic also makes sense in the use case that a document is only added to one knowledge base of course.
I think the fix that @tjbck created is a good one, it will allow users to specify if the entire file needs to be removed or not, providing the user with the possibility to describe what I just explained.
Thanks for the quick fix!
Cheers,
Dirk
@DirkRemmers commented on GitHub (Sep 3, 2025):
@Classic298 , using the API, you can upload files without adding them to any knowledge base. You can then link the file to knowledge bases using the id that the file then gets. This allows you to (for example) link it to multiple knowledge bases.
It should still be possible to remove the file from one knowledge base, and then link it to another knowledge base. For this, the id of the file needs to remain, and therefore the file needs to remain.
Your logic also makes sense in the use case that a document is only added to one knowledge base of course.
I think the fix that @tjbck created is a good one, it will allow users to specify if the entire file needs to be removed or not, providing the user with the possibility to describe what I just explained.
Thanks for the quick fix!
Cheers,
Dirk
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @DirkRemmers on GitHub (Sep 2, 2025).
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.6.22
Ollama Version (if applicable)
No response
Operating System
Debian
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
When using the following API endpoint:
POST /api/v1/knowledge/{knowledge_id}/file/remove, the file that is specified in thedatashould be deleted only from the knowledge collection, not from the entire system.Actual Behavior
Instead, when I use the following api endpoint:
POST /api/v1/knowledge/{knowledge_id}/file/remove, the file is removed from the system entirelySteps to Reproduce
To reproduce:
POST /api/v1/files/) and get the id (file_id)GET /api/v1/files/{file_id})POST /api/v1/knowledge/create) and get the id (knowledge_id)POST /api/v1/knowledge/{knowledge_id}/file/addwithdata = {"file_id"=file_id})POST /api/v1/knowledge/{knowledge_id}/file/removewith `data={"file_id"=file_id})GET /api/v1/files/{file_id})Logs & Screenshots
Additional Information
I don't believe this is the intended behaviour, so I guess this should be fixed?
Cheers,
Dirk
@Classic298 commented on GitHub (Sep 2, 2025):
What do you mean by this?
If you remove a file from the knowledge base, of course the file becomes unusable in Open WebUI as there is no longer any active reference to the file.
But the file IS kept on disk and in the vector database for data retention purposes.
But it is unusable from the web ui.
If that is your question, yes it is intended that the file is removed and becomes unusable from the webui after you remove (delete) it from a knowledge collection (and why would it not be?)
@tjbck commented on GitHub (Sep 2, 2025):
22c4ef4fb0@DirkRemmers commented on GitHub (Sep 3, 2025):
@Classic298 , using the API, you can upload files without adding them to any knowledge base. You can then link the file to knowledge bases using the id that the file then gets. This allows you to (for example) link it to multiple knowledge bases.
It should still be possible to remove the file from one knowledge base, and then link it to another knowledge base. For this, the id of the file needs to remain, and therefore the file needs to remain.
Your logic also makes sense in the use case that a document is only added to one knowledge base of course.
I think the fix that @tjbck created is a good one, it will allow users to specify if the entire file needs to be removed or not, providing the user with the possibility to describe what I just explained.
Thanks for the quick fix!
Cheers,
Dirk