[GH-ISSUE #12832] issue: Web Search Feature Fails When Encountering Empty Content #55393

Closed
opened 2026-05-05 17:30:57 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @belugaming on GitHub (Apr 14, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/12832

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Git Clone

Open WebUI Version

v0.6.4

Ollama Version (if applicable)

Not applicable

Operating System

macos sequoia

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 listed steps to reproduce the bug in detail.

Expected Behavior

When encountering empty content during a web search:

  1. The system should log the issue but skip the problematic resource
  2. The search should continue processing other valid resources
  3. The user should receive partial results from the successfully processed pages
  4. At minimum, provide a more helpful error message that doesn't terminate the entire request

Actual Behavior

When performing a web search and one of the retrieved pages returns empty content:

  1. The system raises a ValueError: The content provided is empty. Please ensure that there is text or data present before proceeding. exception
  2. The entire web search functionality fails with HTTP 400 error
  3. The user receives no results, even from successfully retrieved and processed pages
  4. The API request fails completely instead of returning partial results

Steps to Reproduce

  1. Send a chat message that triggers web search (with a query like "托福词汇记忆方法")
  2. Observe that the search attempts to fetch multiple resources
  3. When one of the resources returns empty content, the entire search fails
  4. No search results are returned despite some resources being successfully retrieved

Logs & Screenshots

2025-04-14 04:33:24.278 | INFO | open_webui.routers.retrieval:save_docs_to_vector_db:821 - save_docs_to_vector_db: document https://m.ease100.com/toefl/vocabulary/631.html web-search-260deb2eb1113a0545a9112e9d642238a8fb233195726e7d6624 - {}
2025-04-14 04:33:24.278 | ERROR | open_webui.routers.retrieval:process_web_search:1545 - The content provided is empty. Please ensure that there is text or data present before proceeding. - {}
Traceback (most recent call last):
...
ValueError: The content provided is empty. Please ensure that there is text or data present before proceeding.
...
File "/app/backend/open_webui/routers/retrieval.py", line 1546, in process_web_search
raise HTTPException(
└ <class 'fastapi.exceptions.HTTPException'>
fastapi.exceptions.HTTPException: 400: [ERROR: The content provided is empty. Please ensure that there is text or data present before proceeding.]

Additional Information

The error occurs in the save_docs_to_vector_db function in retrieval.py. Instead of raising a ValueError when encountering empty content, the function should log the issue and continue processing other resources.

Specifically, at line 863 in retrieval.py, a more robust error handling approach is needed to skip empty resources rather than failing the entire search process.

This issue severely impacts the reliability of the web search feature, as any search query that happens to include an empty resource will fail completely, leaving users without any results despite other valid resources being available.

Originally created by @belugaming on GitHub (Apr 14, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/12832 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Git Clone ### Open WebUI Version v0.6.4 ### Ollama Version (if applicable) Not applicable ### Operating System macos sequoia ### 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 listed steps to reproduce the bug in detail. ### Expected Behavior When encountering empty content during a web search: 1. The system should log the issue but skip the problematic resource 2. The search should continue processing other valid resources 3. The user should receive partial results from the successfully processed pages 4. At minimum, provide a more helpful error message that doesn't terminate the entire request ### Actual Behavior When performing a web search and one of the retrieved pages returns empty content: 1. The system raises a `ValueError: The content provided is empty. Please ensure that there is text or data present before proceeding.` exception 2. The entire web search functionality fails with HTTP 400 error 3. The user receives no results, even from successfully retrieved and processed pages 4. The API request fails completely instead of returning partial results ### Steps to Reproduce 1. Send a chat message that triggers web search (with a query like "托福词汇记忆方法") 2. Observe that the search attempts to fetch multiple resources 3. When one of the resources returns empty content, the entire search fails 4. No search results are returned despite some resources being successfully retrieved ### Logs & Screenshots 2025-04-14 04:33:24.278 | INFO | open_webui.routers.retrieval:save_docs_to_vector_db:821 - save_docs_to_vector_db: document https://m.ease100.com/toefl/vocabulary/631.html web-search-260deb2eb1113a0545a9112e9d642238a8fb233195726e7d6624 - {} 2025-04-14 04:33:24.278 | ERROR | open_webui.routers.retrieval:process_web_search:1545 - The content provided is empty. Please ensure that there is text or data present before proceeding. - {} Traceback (most recent call last): ... ValueError: The content provided is empty. Please ensure that there is text or data present before proceeding. ... File "/app/backend/open_webui/routers/retrieval.py", line 1546, in process_web_search raise HTTPException( └ <class 'fastapi.exceptions.HTTPException'> fastapi.exceptions.HTTPException: 400: [ERROR: The content provided is empty. Please ensure that there is text or data present before proceeding.] ### Additional Information The error occurs in the `save_docs_to_vector_db` function in `retrieval.py`. Instead of raising a `ValueError` when encountering empty content, the function should log the issue and continue processing other resources. Specifically, at line 863 in `retrieval.py`, a more robust error handling approach is needed to skip empty resources rather than failing the entire search process. This issue severely impacts the reliability of the web search feature, as any search query that happens to include an empty resource will fail completely, leaving users without any results despite other valid resources being available.
GiteaMirror added the bug label 2026-05-05 17:30:57 -05:00
Author
Owner

@tjbck commented on GitHub (Apr 14, 2025):

PR welcome.

<!-- gh-comment-id:2800474698 --> @tjbck commented on GitHub (Apr 14, 2025): PR welcome.
Author
Owner

@tjbck commented on GitHub (Apr 14, 2025):

70718dda90 might've addressed, testing wanted here.

<!-- gh-comment-id:2800516582 --> @tjbck commented on GitHub (Apr 14, 2025): 70718dda90af07370414dea28f9a93058623a33b might've addressed, testing wanted here.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#55393