mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[GH-ISSUE #7029] Search fails with 500 Internal server error #14574
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 @jakerdy on GitHub (Nov 19, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/7029
Bug Report
Installation Method
It works as python application without docker.
I just created venv, installed open_webui and setup systemd service so that it starts automatically.
Environment
Expected Behavior:
Search should work without errors.
Actual Behavior:
Browser shows 500 Error in Network tab of Dev-Tools. Console logged that fetch failed. In ui just infinitly spinning spinner, and nothing happens.
Description
Bug Summary:
I don't know what exactly breaks search but it not working for me. Maybe it some nasty characters in titles that returned from sketchy ollama models, maybe something else.
I also tried creating new user, that has no history. Made 2 new chats with OpenAI, that returns valid titles. But still, 500 Internal Server Error.
Logs and Screenshots
Browser Console Logs:

Python Server Logs:
@jakerdy commented on GitHub (Nov 19, 2024):
Some insights from ChatGPT:
The error you are encountering is due to the use of
>>in your SQL query, which is not valid syntax for SQLite. In the query, this syntax is being used in the expressionmessage.value->>'content'which is a PostgreSQL-specific operator for querying JSON data.SQLite does not support the
->>operator. Instead, SQLite uses its own set of functions to work with JSON data. If you need to query JSON content in SQLite, you should use thejson_extract()function.Here’s how you can modify your query to be compatible with SQLite:
Explanation:
message.value->>'content'withjson_extract(message.value, '$.content'). This function extracts the content of the JSON fieldcontentfrommessage.value.Points to Consider:
@jakerdy commented on GitHub (Nov 19, 2024):
Ok, I found exact place where it breaks:
96c865404d/backend/open_webui/apps/webui/models/chats.py (L477)I changed it from:
WHERE LOWER(message.value->>'content')toWHERE LOWER(json_extract(message.value, '$.content'))and it stats working.