mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[GH-ISSUE #22959] issue: upsert_message_to_chat_by_id_and_message_id() unexpected keyword argument 'db' #35382
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 @DefaultUser1606 on GitHub (Mar 23, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/22959
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
v0.8.10
Ollama Version (if applicable)
No response
Operating System
windows 10
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
Calling endpoint api/v1/chats/{id}/messages/{messageId} upserts a new message in chat
Actual Behavior
Internal server error due to function update_chat_message_by_id calling Chats.upsert_message_to_chat_by_id_and_message_id with an unexpected keyword argument db=db, which isn't defined in the function signature
Steps to Reproduce
with body
{
"content": "I am a new message"
}
Logs & Screenshots
File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 416, in run_asgi
File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in call
File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1138, in call
File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 107, in call
File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in call
File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in call
File "/usr/local/lib/python3.11/site-packages/starlette/middleware/sessions.py", line 85, in call
File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 87, in call
File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in call
File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 87, in collapse_excgroups
File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 193, in call
Additional Information
No response
@BillionClaw commented on GitHub (Mar 24, 2026):
Investigating now. The traceback shows
upsert_message_to_chat_by_id_and_message_idbeing called with adbkwarg that doesn't exist in its signature — likely a call site mismatch from theupdate_chat_message_by_idfunction.@BillionClaw commented on GitHub (Mar 24, 2026):
Fixed in PR #22973 — removed the errant
db=dbargument from the call inupdate_chat_message_by_id.@BillionClaw commented on GitHub (Mar 24, 2026):
Looking into this unexpected 'db' argument error — will submit a fix.
@tjbck commented on GitHub (Mar 24, 2026):
Addressed.
@DefaultUser1606 commented on GitHub (Mar 24, 2026):
What changed? There appears to be no changes in relevant lines of code. The call to get_chat_by_id_and_user_id
https://github.com/open-webui/open-webui/blob/main/backend/open_webui/routers/chats.py#L1021
still passes unexpected kwarg db and the called function
https://github.com/open-webui/open-webui/blob/main/backend/open_webui/models/chats.py#L481
still does not expect said argument
@Classic298 commented on GitHub (Mar 24, 2026):
70285fb6ca@DefaultUser1606 commented on GitHub (Mar 24, 2026):
Oh it's in another branch. My bad