[GH-ISSUE #22959] issue: upsert_message_to_chat_by_id_and_message_id() unexpected keyword argument 'db' #35382

Closed
opened 2026-04-25 09:35:42 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @DefaultUser1606 on GitHub (Mar 23, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/22959

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
  • I am using the latest version of Open WebUI.

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

  • 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

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

  1. Start latest OWU
  2. Create chat
  3. call http://localhost:3000/api/v1/chats/{new chat id}/messages/{new message guid}
    with body
    {
    "content": "I am a new message"
    }

Logs & Screenshots

Image Traceback (most recent call last):

File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 416, in run_asgi

result = await app(  # type: ignore[func-returns-value]

         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in call

return await self.app(scope, receive, send)

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1138, in call

await super().__call__(scope, receive, send)

File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 107, in call

await self.middleware_stack(scope, receive, send)

File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in call

raise exc

File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in call

await self.app(scope, receive, _send)

File "/usr/local/lib/python3.11/site-packages/starlette/middleware/sessions.py", line 85, in call

await self.app(scope, receive, send_wrapper)

File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 87, in call

await self.app(scope, receive, send)

File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in call

with recv_stream, send_stream, collapse_excgroups():

File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit

self.gen.throw(typ, value, traceback)

File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 87, in collapse_excgroups

raise exc

File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 193, in call

Additional Information

No response

Originally created by @DefaultUser1606 on GitHub (Mar 23, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/22959 ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!). - [x] I am using the latest version of Open WebUI. ### 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 - [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 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 1) Start latest OWU 2) Create chat 3) call http://localhost:3000/api/v1/chats/{new chat id}/messages/{new message guid} with body { "content": "I am a new message" } ### Logs & Screenshots <img width="879" height="92" alt="Image" src="https://github.com/user-attachments/assets/51cfa6f3-dd0b-4d25-89e7-ed28da21c20e" /> Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 416, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1138, in __call__ await super().__call__(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 107, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ await self.app(scope, receive, _send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/sessions.py", line 85, in __call__ await self.app(scope, receive, send_wrapper) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 87, in __call__ await self.app(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ with recv_stream, send_stream, collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 87, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 193, in __call__ ### Additional Information _No response_
GiteaMirror added the bug label 2026-04-25 09:35:42 -05:00
Author
Owner

@BillionClaw commented on GitHub (Mar 24, 2026):

Investigating now. The traceback shows upsert_message_to_chat_by_id_and_message_id being called with a db kwarg that doesn't exist in its signature — likely a call site mismatch from the update_chat_message_by_id function.

<!-- gh-comment-id:4115573739 --> @BillionClaw commented on GitHub (Mar 24, 2026): Investigating now. The traceback shows `upsert_message_to_chat_by_id_and_message_id` being called with a `db` kwarg that doesn't exist in its signature — likely a call site mismatch from the `update_chat_message_by_id` function.
Author
Owner

@BillionClaw commented on GitHub (Mar 24, 2026):

Fixed in PR #22973 — removed the errant db=db argument from the call in update_chat_message_by_id.

<!-- gh-comment-id:4115601274 --> @BillionClaw commented on GitHub (Mar 24, 2026): Fixed in PR #22973 — removed the errant `db=db` argument from the call in `update_chat_message_by_id`.
Author
Owner

@BillionClaw commented on GitHub (Mar 24, 2026):

Looking into this unexpected 'db' argument error — will submit a fix.

<!-- gh-comment-id:4115747655 --> @BillionClaw commented on GitHub (Mar 24, 2026): Looking into this unexpected 'db' argument error — will submit a fix.
Author
Owner

@tjbck commented on GitHub (Mar 24, 2026):

Addressed.

<!-- gh-comment-id:4116826588 --> @tjbck commented on GitHub (Mar 24, 2026): Addressed.
Author
Owner

@DefaultUser1606 commented on GitHub (Mar 24, 2026):

Addressed.

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

<!-- gh-comment-id:4116960758 --> @DefaultUser1606 commented on GitHub (Mar 24, 2026): > Addressed. 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
Author
Owner

@Classic298 commented on GitHub (Mar 24, 2026):

70285fb6ca

<!-- gh-comment-id:4116966236 --> @Classic298 commented on GitHub (Mar 24, 2026): https://github.com/open-webui/open-webui/commit/70285fb6cad26b50d783583b68be5227ace16055
Author
Owner

@DefaultUser1606 commented on GitHub (Mar 24, 2026):

70285fb

Oh it's in another branch. My bad

<!-- gh-comment-id:4116973309 --> @DefaultUser1606 commented on GitHub (Mar 24, 2026): > [70285fb](https://github.com/open-webui/open-webui/commit/70285fb6cad26b50d783583b68be5227ace16055) Oh it's in another branch. My bad
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#35382