[GH-ISSUE #10428] Web search broken on 0.5.15? #54556

Closed
opened 2026-05-05 16:24:32 -05:00 by GiteaMirror · 21 comments
Owner

Originally created by @ProjectMoon on GitHub (Feb 20, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/10428

Bug Report

Installation Method

Docker

Environment

  • Open WebUI Version: 0.5.15

  • Ollama (if applicable): 0.5.11

  • Operating System: Linux

  • Browser (if applicable): Firefox

Expected Behavior:

Web search works.

Actual Behavior:

OpenWebUI goes through the whole search process, but the results are never given to the LLM for context.

I assume it's because of this error:

Traceback (most recent call last):
  File "/app/backend/open_webui/retrieval/utils.py", line 436, in get_sources_from_files
    context = query_collection(
              ^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/retrieval/utils.py", line 275, in query_collection
    return merge_and_sort_query_results(results, k=k, reverse=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/retrieval/utils.py", line 189, in merge_and_sort_query_results
    [
  File "/app/backend/open_webui/retrieval/utils.py", line 190, in <listcomp>
    f"{id}-{meta['file_id']}"
            ~~~~^^^^^^^^^^^
KeyError: 'file_id'

This happens right after seeing INFO [open_webui.retrieval.utils] query_doc:result in the logs.

Description

Bug Summary:
Web search results are not delivered to the LLM.

Reproduction Details

Steps to Reproduce:
Toggle on search when chatting with LLM. SearxNG was used in this case.

Originally created by @ProjectMoon on GitHub (Feb 20, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/10428 # Bug Report ## Installation Method Docker ## Environment - **Open WebUI Version:** 0.5.15 - **Ollama (if applicable):** 0.5.11 - **Operating System:** Linux - **Browser (if applicable):** Firefox ## Expected Behavior: Web search works. ## Actual Behavior: OpenWebUI goes through the whole search process, but the results are never given to the LLM for context. I assume it's because of this error: ``` Traceback (most recent call last): File "/app/backend/open_webui/retrieval/utils.py", line 436, in get_sources_from_files context = query_collection( ^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/retrieval/utils.py", line 275, in query_collection return merge_and_sort_query_results(results, k=k, reverse=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/retrieval/utils.py", line 189, in merge_and_sort_query_results [ File "/app/backend/open_webui/retrieval/utils.py", line 190, in <listcomp> f"{id}-{meta['file_id']}" ~~~~^^^^^^^^^^^ KeyError: 'file_id' ``` This happens right after seeing `INFO [open_webui.retrieval.utils] query_doc:result` in the logs. ## Description **Bug Summary:** Web search results are not delivered to the LLM. ## Reproduction Details **Steps to Reproduce:** Toggle on search when chatting with LLM. SearxNG was used in this case.
Author
Owner

@ProjectMoon commented on GitHub (Feb 20, 2025):

Also, not using full context injection. When full context is enabled, search works. So this only affects the vector search.

<!-- gh-comment-id:2671428316 --> @ProjectMoon commented on GitHub (Feb 20, 2025): Also, not using full context injection. When full context is enabled, search works. So this only affects the vector search.
Author
Owner

@907739769 commented on GitHub (Feb 20, 2025):

I am the same too.

<!-- gh-comment-id:2671486610 --> @907739769 commented on GitHub (Feb 20, 2025): I am the same too.
Author
Owner

@Classic298 commented on GitHub (Feb 20, 2025):

For me it works. Odd. I use google-pse btw. Works both in full context mode ON and OFF. Works always for me.

Debian 12, pip installation

<!-- gh-comment-id:2671532673 --> @Classic298 commented on GitHub (Feb 20, 2025): For me it works. Odd. I use google-pse btw. Works both in full context mode ON and OFF. Works always for me. Debian 12, pip installation
Author
Owner

@ProjectMoon commented on GitHub (Feb 20, 2025):

Is it a new installation? Or did you reset vector storage? Wondering if it's related to that.

<!-- gh-comment-id:2671554629 --> @ProjectMoon commented on GitHub (Feb 20, 2025): Is it a new installation? Or did you reset vector storage? Wondering if it's related to that.
Author
Owner

@krittaprot commented on GitHub (Feb 20, 2025):

+1 for this issue, I got the same error using SearXNG.

<!-- gh-comment-id:2671554825 --> @krittaprot commented on GitHub (Feb 20, 2025): +1 for this issue, I got the same error using SearXNG.
Author
Owner

@eaiu commented on GitHub (Feb 20, 2025):

The same issue, can't use vector search.

<!-- gh-comment-id:2671573214 --> @eaiu commented on GitHub (Feb 20, 2025): The same issue, can't use vector search.
Author
Owner

@karllee830 commented on GitHub (Feb 20, 2025):

Same problem with using DuckDuckGo.

If full context mode is enabled, this issue does not occur; if disabled, this issue arises.

<!-- gh-comment-id:2671660154 --> @karllee830 commented on GitHub (Feb 20, 2025): Same problem with using DuckDuckGo. ### **If full context mode is enabled, this issue does not occur; if disabled, this issue arises.**
Author
Owner

@EMjetrot commented on GitHub (Feb 20, 2025):

Struggling as well and using Azure Bing Search API for websearch, which worked before.

<!-- gh-comment-id:2671666443 --> @EMjetrot commented on GitHub (Feb 20, 2025): Struggling as well and using Azure Bing Search API for websearch, which worked before.
Author
Owner

@Classic298 commented on GitHub (Feb 20, 2025):

Is everyone here using docker, who is struggling with it? I am, from the comments so far, the only one using pip installation. And for me it works perfectly fine with full context on or off.

<!-- gh-comment-id:2671671302 --> @Classic298 commented on GitHub (Feb 20, 2025): Is everyone here using docker, who is struggling with it? I am, from the comments so far, the only one using pip installation. And for me it works perfectly fine with full context on or off.
Author
Owner

@EMjetrot commented on GitHub (Feb 20, 2025):

@Classic298 - Yes, docker on ubuntu here.

<!-- gh-comment-id:2671675114 --> @EMjetrot commented on GitHub (Feb 20, 2025): @Classic298 - Yes, docker on ubuntu here.
Author
Owner

@karuko24 commented on GitHub (Feb 20, 2025):

Same issue, running on Kubernetes

<!-- gh-comment-id:2671679277 --> @karuko24 commented on GitHub (Feb 20, 2025): Same issue, running on Kubernetes
Author
Owner

@cdmusic2019 commented on GitHub (Feb 20, 2025):

Is everyone here using docker, who is struggling with it? I am, from the comments so far, the only one using pip installation. And for me it works perfectly fine with full context on or off.

And me, too. PIP

<!-- gh-comment-id:2671700534 --> @cdmusic2019 commented on GitHub (Feb 20, 2025): > Is everyone here using docker, who is struggling with it? I am, from the comments so far, the only one using pip installation. And for me it works perfectly fine with full context on or off. And me, too. PIP
Author
Owner

@Haervwe commented on GitHub (Feb 20, 2025):

On Ubuntu, dockerized, searnxg and facing the same issue.

<!-- gh-comment-id:2671715532 --> @Haervwe commented on GitHub (Feb 20, 2025): On Ubuntu, dockerized, searnxg and facing the same issue.
Author
Owner

@DamilolaDecarls commented on GitHub (Feb 20, 2025):

I'm also having this issue. I don't have web search enabled. Docker and debian host.

<!-- gh-comment-id:2671787193 --> @DamilolaDecarls commented on GitHub (Feb 20, 2025): I'm also having this issue. I don't have web search enabled. Docker and debian host.
Author
Owner

@ProjectMoon commented on GitHub (Feb 20, 2025):

I'm also having this issue. I don't have web search enabled. Docker and debian host.

Issue with vector search as a whole?

<!-- gh-comment-id:2671922751 --> @ProjectMoon commented on GitHub (Feb 20, 2025): > I'm also having this issue. I don't have web search enabled. Docker and debian host. Issue with vector search as a whole?
Author
Owner

@DamilolaDecarls commented on GitHub (Feb 20, 2025):

I'm also having this issue. I don't have web search enabled. Docker and debian host.

Issue with vector search as a whole?

I just carried out further checks. It works on the local host. It seems to only break when I forward it to a nginx webserver. Accessing vial local host works as expected.

<!-- gh-comment-id:2671957587 --> @DamilolaDecarls commented on GitHub (Feb 20, 2025): > > I'm also having this issue. I don't have web search enabled. Docker and debian host. > > Issue with vector search as a whole? I just carried out further checks. It works on the local host. It seems to only break when I forward it to a nginx webserver. Accessing vial local host works as expected.
Author
Owner

@xmcp commented on GitHub (Feb 20, 2025):

It seems that 925bfe840b is causing this trouble, since documents in RAG mode don't have file_ids.

Current we are using this as a hotfix:

diff --git a/backend/open_webui/retrieval/utils.py b/backend/open_webui/retrieval/utils.py
index 5f181fba0..5ee628799 100644
--- a/backend/open_webui/retrieval/utils.py
+++ b/backend/open_webui/retrieval/utils.py
@@ -187,7 +187,7 @@ def merge_and_sort_query_results(
         # DISTINCT(chunk_id,file_id) - in case if id (chunk_ids) become ordinals
         combined_ids.extend(
             [
-                f"{id}-{meta['file_id']}"
+                f"{id}-{meta.get('file_id', '')}"
                 for id, meta in zip(data["ids"][0], data["metadatas"][0])
             ]
         )
<!-- gh-comment-id:2671961450 --> @xmcp commented on GitHub (Feb 20, 2025): It seems that https://github.com/open-webui/open-webui/commit/925bfe840b46df424360f230a93e748289df0139 is causing this trouble, since documents in RAG mode don't have `file_id`s. Current we are using this as a hotfix: ```python diff --git a/backend/open_webui/retrieval/utils.py b/backend/open_webui/retrieval/utils.py index 5f181fba0..5ee628799 100644 --- a/backend/open_webui/retrieval/utils.py +++ b/backend/open_webui/retrieval/utils.py @@ -187,7 +187,7 @@ def merge_and_sort_query_results( # DISTINCT(chunk_id,file_id) - in case if id (chunk_ids) become ordinals combined_ids.extend( [ - f"{id}-{meta['file_id']}" + f"{id}-{meta.get('file_id', '')}" for id, meta in zip(data["ids"][0], data["metadatas"][0]) ] ) ```
Author
Owner

@tjbck commented on GitHub (Feb 20, 2025):

@mkhludnev

<!-- gh-comment-id:2672410878 --> @tjbck commented on GitHub (Feb 20, 2025): @mkhludnev
Author
Owner

@tjbck commented on GitHub (Feb 20, 2025):

The entire deduplication logic should be replaced and is faulty, 0.5.16 will be released soon.

<!-- gh-comment-id:2672412416 --> @tjbck commented on GitHub (Feb 20, 2025): The entire deduplication logic should be replaced and is faulty, 0.5.16 will be released soon.
Author
Owner

@tjbck commented on GitHub (Feb 20, 2025):

Should be resolved with 0.5.16, Thanks everyone!

<!-- gh-comment-id:2672474485 --> @tjbck commented on GitHub (Feb 20, 2025): Should be resolved with 0.5.16, Thanks everyone!
Author
Owner

@mkhludnev commented on GitHub (Feb 20, 2025):

pardon

<!-- gh-comment-id:2672592727 --> @mkhludnev commented on GitHub (Feb 20, 2025): pardon
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#54556