Originally created by @ProjectMoon on GitHub (Feb 20, 2025).
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).
# 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.
Also, not using full context injection. When full context is enabled, search works. So this only affects the vector search.
@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.
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
@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
If full context mode is enabled, this issue does not occur; if disabled, this issue arises.
@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.**
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.
@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.
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
@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
I'm also having this issue. I don't have web search enabled. Docker and debian host.
Issue with vector search as a whole?
@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?
@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.
@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.
diff--gita/backend/open_webui/retrieval/utils.pyb/backend/open_webui/retrieval/utils.pyindex5f181fba0..5ee628799100644---a/backend/open_webui/retrieval/utils.py+++b/backend/open_webui/retrieval/utils.py@@-187,7+187,7@@defmerge_and_sort_query_results(# DISTINCT(chunk_id,file_id) - in case if id (chunk_ids) become ordinalscombined_ids.extend([-f"{id}-{meta['file_id']}"+f"{id}-{meta.get('file_id','')}"forid,metainzip(data["ids"][0],data["metadatas"][0])])
@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])
]
)
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @ProjectMoon on GitHub (Feb 20, 2025).
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:
This happens right after seeing
INFO [open_webui.retrieval.utils] query_doc:resultin 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.
@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.
@907739769 commented on GitHub (Feb 20, 2025):
I am the same too.
@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
@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.
@krittaprot commented on GitHub (Feb 20, 2025):
+1 for this issue, I got the same error using SearXNG.
@eaiu commented on GitHub (Feb 20, 2025):
The same issue, can't use vector search.
@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.
@EMjetrot commented on GitHub (Feb 20, 2025):
Struggling as well and using Azure Bing Search API for websearch, which worked before.
@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.
@EMjetrot commented on GitHub (Feb 20, 2025):
@Classic298 - Yes, docker on ubuntu here.
@karuko24 commented on GitHub (Feb 20, 2025):
Same issue, running on Kubernetes
@cdmusic2019 commented on GitHub (Feb 20, 2025):
And me, too. PIP
@Haervwe commented on GitHub (Feb 20, 2025):
On Ubuntu, dockerized, searnxg and facing the same issue.
@DamilolaDecarls commented on GitHub (Feb 20, 2025):
I'm also having this issue. I don't have web search enabled. Docker and debian host.
@ProjectMoon commented on GitHub (Feb 20, 2025):
Issue with vector search as a whole?
@DamilolaDecarls commented on GitHub (Feb 20, 2025):
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.
@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_ids.Current we are using this as a hotfix:
@tjbck commented on GitHub (Feb 20, 2025):
@mkhludnev
@tjbck commented on GitHub (Feb 20, 2025):
The entire deduplication logic should be replaced and is faulty, 0.5.16 will be released soon.
@tjbck commented on GitHub (Feb 20, 2025):
Should be resolved with 0.5.16, Thanks everyone!
@mkhludnev commented on GitHub (Feb 20, 2025):
pardon