mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[GH-ISSUE #20206] issue: /api/v1/chats/all fails with HTTP 500 #57789
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 @ppeterka on GitHub (Dec 27, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20206
Check Existing Issues
Installation Method
Docker
Open WebUI Version
0.6.43, 0.6.42
Ollama Version (if applicable)
N/A
Operating System
Irrelevant, Python error
Browser (if applicable)
Irrelevant, server side
Confirmation
README.md.Expected Behavior
Should return all chats, and not a HTTP 500 by all means I believe.
Actual Behavior
HTTP 500, Internal server error.
Steps to Reproduce
Open /api/v1/chats/all endpoint in browser.
Logs & Screenshots
This is logged in Docker.
Additional Information
This is due to the refactoring of chats: after the refactor, the Chats.get_chats_by_user_id(user.id) function returns a tuple containing a list and an int, and the downstream code only needs the list.
Function return part (models/chats.py,get_chats_by_user_id(), from line 771):
Invoking code (routers/chats.py around line 385):
@owui-terminator[bot] commented on GitHub (Dec 27, 2025):
🔍 Similar Issues Found
I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:
#20059 issue: Chat response is not working
by navilg • Dec 20, 2025 •
bug#19755 issue: Error: 404, message='Not Found', url='http://ollama:11434/api/embed'
by stevewillett • Dec 04, 2025 •
bug#19987 issue: There is a lack of visual consistency between the home page and the chat interface.
by i-iooi-i • Dec 16, 2025 •
bug#19127 issue: /api/v1/chats/ keeps getting called
by HelifeWasTaken • Nov 11, 2025 •
bug#19496 issue: 500 internal server error appears in v0.6.40
by cloudtuotuo • Nov 26, 2025 •
bugShow 5 more related issues
#18975 issue: 500: Internal Error
by nurb2kea • Nov 06, 2025 •
bug#19533 issue: Frontend infinite loading caused by malformed "500 Error" node in chat history
by GSAlex • Nov 27, 2025 •
bug#15688 issue: /api/v1/chats endpoint stops functioning on Production after about 5-6 chat messages (403 for each request)
by G1anduin • Jul 13, 2025 •
bug#15760 issue: OOB large chat page number causes Exception and 500
by jakehlee • Jul 16, 2025 •
bug#13192 issue: 500 internal error on loading old chats
by discostur • Apr 24, 2025 •
bug💡 Tips:
This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
@silentoplayz commented on GitHub (Dec 27, 2025):
I am able to reproduce this error on the latest
devcommit upon visiting the/api/v1/chats/allendpoint of my Open WebUi instance in browser.@rgaricano commented on GitHub (Dec 27, 2025):
@silentoplayz, could you try a fix?
replacing:
6f1486ffd0/backend/open_webui/routers/chats.py (L256-L261)with:
@rgaricano commented on GitHub (Dec 27, 2025):
Another possible fix with better error handling when dealing with methods that have changing return types & future compatibility.
The alternative pattern involves manually destructuring tuple returns.
This approach is already used elsewhere in the codebase for handling SQLAlchemy query results that return tuples instead of model objects.
@Classic298 commented on GitHub (Dec 28, 2025):
fixed by https://github.com/open-webui/open-webui/pull/20212