83dae63 fix: remove invalid db kwarg from process_files_batch call
📊 Changes
1 file changed (+0 additions, -1 deletions)
View changed files
📝backend/open_webui/routers/knowledge.py (+0 -1)
📄 Description
Summary
process_files_batch() does not accept a db keyword argument, but add_files_to_knowledge_batch passes db=db when calling it, which raises a TypeError at runtime.
Root cause: The function signature in routers/retrieval.py intentionally omits db because it makes long-running external embedding API calls (5–60+ seconds) and manages its own short-lived DB sessions internally.
Fix: Remove the db=db line from the call in knowledge.py.
Call POST /api/v1/knowledge/{id}/files/batch with a valid collection — should no longer raise TypeError: process_files_batch() got an unexpected keyword argument 'db'
Verify files are still processed and added to the knowledge collection correctly
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/23238
**Author:** [@IgnazioDS](https://github.com/IgnazioDS)
**Created:** 3/30/2026
**Status:** ❌ Closed
**Base:** `main` ← **Head:** `fix/process-files-batch-db-kwarg`
---
### 📝 Commits (1)
- [`83dae63`](https://github.com/open-webui/open-webui/commit/83dae63b69c18bff1fc652cecd00cebcd553df2b) fix: remove invalid db kwarg from process_files_batch call
### 📊 Changes
**1 file changed** (+0 additions, -1 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/routers/knowledge.py` (+0 -1)
</details>
### 📄 Description
## Summary
`process_files_batch()` does not accept a `db` keyword argument, but `add_files_to_knowledge_batch` passes `db=db` when calling it, which raises a `TypeError` at runtime.
**Root cause:** The function signature in `routers/retrieval.py` intentionally omits `db` because it makes long-running external embedding API calls (5–60+ seconds) and manages its own short-lived DB sessions internally.
**Fix:** Remove the `db=db` line from the call in `knowledge.py`.
Fixes #23137
## Change
```python
# Before
result = await process_files_batch(
request=request,
form_data=BatchProcessFilesForm(files=files, collection_name=id),
user=user,
db=db, # ← TypeError: unexpected keyword argument
)
# After
result = await process_files_batch(
request=request,
form_data=BatchProcessFilesForm(files=files, collection_name=id),
user=user,
)
```
## Test plan
- [ ] Call `POST /api/v1/knowledge/{id}/files/batch` with a valid collection — should no longer raise `TypeError: process_files_batch() got an unexpected keyword argument 'db'`
- [ ] Verify files are still processed and added to the knowledge collection correctly
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/23238
Author: @IgnazioDS
Created: 3/30/2026
Status: ❌ Closed
Base:
main← Head:fix/process-files-batch-db-kwarg📝 Commits (1)
83dae63fix: remove invalid db kwarg from process_files_batch call📊 Changes
1 file changed (+0 additions, -1 deletions)
View changed files
📝
backend/open_webui/routers/knowledge.py(+0 -1)📄 Description
Summary
process_files_batch()does not accept adbkeyword argument, butadd_files_to_knowledge_batchpassesdb=dbwhen calling it, which raises aTypeErrorat runtime.Root cause: The function signature in
routers/retrieval.pyintentionally omitsdbbecause it makes long-running external embedding API calls (5–60+ seconds) and manages its own short-lived DB sessions internally.Fix: Remove the
db=dbline from the call inknowledge.py.Fixes #23137
Change
Test plan
POST /api/v1/knowledge/{id}/files/batchwith a valid collection — should no longer raiseTypeError: process_files_batch() got an unexpected keyword argument 'db'🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.