[Bug]DuckDuckGo Web Search is broken #3555

Closed
opened 2025-11-11 15:33:52 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @zerodegress on GitHub (Feb 3, 2025).

Bug Report

Installation Method

Both Docker and pip.

Environment

  • Open WebUI Version: v0.5.7

  • **Ollama (if applicable):**v0.5.7

  • Operating System: ArchLinux

  • Browser (if applicable): Firefox 135.0b9

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I am on 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 provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.

Expected Behavior:

Web Search should be available, and the search query should be generated correctly.

Actual Behavior:

Errors occured when using duckduckgo as the web searchbackend, which reported 'keywords is mandatory' or more.

Description

Bug Summary:
[Provide a brief but clear summary of the bug]

Reproduction Details

Steps to Reproduce:

  1. start the open-webui 0.5.7 any way.
  2. in web search select the duckduckgo as backend
  3. prompt with web search enabled

Logs and Screenshots

Docker Container Logs:
/app/backend/open_webui/retrieval/web/duckduckgo.py:27: UserWarning: backend='api' is deprecated, using backend='auto'
ddgs_gen = ddgs.text(
ERROR [open_webui.routers.retrieval] keywords is mandatory
Traceback (most recent call last):
File "/app/backend/open_webui/routers/retrieval.py", line 1248, in process_web_search
web_results = search_web(
^^^^^^^^^^^
File "/app/backend/open_webui/routers/retrieval.py", line 1196, in search_web
return search_duckduckgo(
^^^^^^^^^^^^^^^^^^
File "/app/backend/open_webui/retrieval/web/duckduckgo.py", line 27, in search_duckduckgo
ddgs_gen = ddgs.text(
^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/duckduckgo_search/duckduckgo_search.py", line 253, in text
raise DuckDuckGoSearchException(err)
duckduckgo_search.exceptions.DuckDuckGoSearchException: keywords is mandatory
ERROR [open_webui.utils.middleware] 400: keywords is mandatory
Traceback (most recent call last):
File "/app/backend/open_webui/routers/retrieval.py", line 1248, in process_web_search
web_results = search_web(
^^^^^^^^^^^
File "/app/backend/open_webui/routers/retrieval.py", line 1196, in search_web
return search_duckduckgo(
^^^^^^^^^^^^^^^^^^
File "/app/backend/open_webui/retrieval/web/duckduckgo.py", line 27, in search_duckduckgo
ddgs_gen = ddgs.text(
^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/duckduckgo_search/duckduckgo_search.py", line 253, in text
raise DuckDuckGoSearchException(err)
duckduckgo_search.exceptions.DuckDuckGoSearchException: keywords is mandatory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/app/backend/open_webui/utils/middleware.py", line 425, in chat_web_search_handler
results = await loop.run_in_executor(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/backend/open_webui/utils/middleware.py", line 427, in
lambda: process_web_search(
^^^^^^^^^^^^^^^^^^^
File "/app/backend/open_webui/routers/retrieval.py", line 1254, in process_web_search
raise HTTPException(
fastapi.exceptions.HTTPException: 400: keywords is mandatory

Screenshots/Screen Recordings (if applicable):

Image

Originally created by @zerodegress on GitHub (Feb 3, 2025). # Bug Report ## Installation Method Both Docker and pip. ## Environment - **Open WebUI Version:** v0.5.7 - **Ollama (if applicable):**v0.5.7 - **Operating System:** ArchLinux - **Browser (if applicable):** Firefox 135.0b9 **Confirmation:** - [x] I have read and followed all the instructions provided in the README.md. - [x] I am on 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 provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below. ## Expected Behavior: Web Search should be available, and the search query should be generated correctly. ## Actual Behavior: Errors occured when using duckduckgo as the web searchbackend, which reported 'keywords is mandatory' or more. ## Description **Bug Summary:** [Provide a brief but clear summary of the bug] ## Reproduction Details **Steps to Reproduce:** 1. start the open-webui 0.5.7 any way. 2. in web search select the duckduckgo as backend 3. prompt with web search enabled ## Logs and Screenshots **Docker Container Logs:** /app/backend/open_webui/retrieval/web/duckduckgo.py:27: UserWarning: backend='api' is deprecated, using backend='auto' ddgs_gen = ddgs.text( ERROR [open_webui.routers.retrieval] keywords is mandatory Traceback (most recent call last): File "/app/backend/open_webui/routers/retrieval.py", line 1248, in process_web_search web_results = search_web( ^^^^^^^^^^^ File "/app/backend/open_webui/routers/retrieval.py", line 1196, in search_web return search_duckduckgo( ^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/retrieval/web/duckduckgo.py", line 27, in search_duckduckgo ddgs_gen = ddgs.text( ^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/duckduckgo_search/duckduckgo_search.py", line 253, in text raise DuckDuckGoSearchException(err) duckduckgo_search.exceptions.DuckDuckGoSearchException: keywords is mandatory ERROR [open_webui.utils.middleware] 400: keywords is mandatory Traceback (most recent call last): File "/app/backend/open_webui/routers/retrieval.py", line 1248, in process_web_search web_results = search_web( ^^^^^^^^^^^ File "/app/backend/open_webui/routers/retrieval.py", line 1196, in search_web return search_duckduckgo( ^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/retrieval/web/duckduckgo.py", line 27, in search_duckduckgo ddgs_gen = ddgs.text( ^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/duckduckgo_search/duckduckgo_search.py", line 253, in text raise DuckDuckGoSearchException(err) duckduckgo_search.exceptions.DuckDuckGoSearchException: keywords is mandatory During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/app/backend/open_webui/utils/middleware.py", line 425, in chat_web_search_handler results = await loop.run_in_executor( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/utils/middleware.py", line 427, in <lambda> lambda: process_web_search( ^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/routers/retrieval.py", line 1254, in process_web_search raise HTTPException( fastapi.exceptions.HTTPException: 400: keywords is mandatory **Screenshots/Screen Recordings (if applicable):** ![Image](https://github.com/user-attachments/assets/76b6b102-b6cf-4920-832c-86957fb9c710)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#3555