[GH-ISSUE #13952] issue: Searxng Queries Often Have Empty q Parameter #32614

Closed
opened 2026-04-25 06:32:11 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @sempervictus on GitHub (May 16, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/13952

Check Existing Issues

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

Installation Method

Docker

Open WebUI Version

0.6.9

Ollama Version (if applicable)

No response

Operating System

Ubuntu

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

Search requests sent to searxng contain some query for which a return is desired

Actual Behavior

Task model (phi4 reasoning) or py code produce an empty query string

Steps to Reproduce

  1. Follow procedures in https://docs.openwebui.com/tutorials/web-search/searxng/
  2. Verify using curl from inside openwebui container that everything works correctly (json output, etc)
  3. Try to use websearch in a chat; throws these errors 4/5 or more times per chat submission (set to return 8 reults)

Logs & Screenshots


requests.exceptions.HTTPError: 400 Client Error: BAD REQUEST for url: http://searxng:8080/search?q=&format=json&pageno=1&safesearch=1&language=en-US&time_range=&categories=&theme=simple&image_proxy=0
2025-05-16 10:00:03.037 | ERROR    | open_webui.utils.middleware:chat_web_search_handler:428 - 400: 400 Client Error: BAD REQUEST for url: http://searxng:8080/search?q=&format=json&pageno=1&safesearch=1&language=en-US&time_range=&categories=&theme=simple&image_proxy=0 - {}
Traceback (most recent call last):

  File "/app/backend/open_webui/routers/retrieval.py", line 1623, in process_web_search
    search_results = await asyncio.gather(*search_tasks)
                           │       │       └ [<coroutine object run_in_threadpool at 0x7fd229d49b70>]
                           │       └ <function gather at 0x7fd2f9e49da0>
                           └ <module 'asyncio' from '/usr/local/lib/python3.11/asyncio/__init__.py'>

  File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 37, in run_in_threadpool
    return await anyio.to_thread.run_sync(func)
                 │     │         │        └ functools.partial(<function search_web at 0x7fd2352951c0>, <starlette.requests.Request object at 0x7fd2031d2410>, 'searxng', '')
                 │     │         └ <function run_sync at 0x7fd2f995ccc0>
                 │     └ <module 'anyio.to_thread' from '/usr/local/lib/python3.11/site-packages/anyio/to_thread.py'>
                 └ <module 'anyio' from '/usr/local/lib/python3.11/site-packages/anyio/__init__.py'>
  File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
                 └ <function get_async_backend at 0x7fd2f9b859e0>
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2470, in run_sync_in_worker_thread
    return await future
                 └ <Future finished exception=HTTPError('400 Client Error: BAD REQUEST for url: http://searxng:8080/search?q=&format=json&pageno...
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 967, in run
    result = context.run(func, *args)

  File "/app/backend/open_webui/routers/retrieval.py", line 1392, in search_web
    return search_searxng(
           └ <function search_searxng at 0x7fd23633e700>

  File "/app/backend/open_webui/retrieval/web/searxng.py", line 79, in search_searxng
    response.raise_for_status()  # Raise an exception for HTTP errors.
    │        └ <function Response.raise_for_status at 0x7fd2f730ef20>
    └ <Response [400]>

  File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
          │         │                        └ <Response [400]>
          │         └ '400 Client Error: BAD REQUEST for url: http://searxng:8080/search?q=&format=json&pageno=1&safesearch=1&language=en-US&time_r...
          └ <class 'requests.exceptions.HTTPError'>

Additional Information

No response

Originally created by @sempervictus on GitHub (May 16, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/13952 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version 0.6.9 ### Ollama Version (if applicable) _No response_ ### Operating System Ubuntu ### 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 Search requests sent to searxng contain _some_ query for which a return is desired ### Actual Behavior Task model (phi4 reasoning) or py code produce an empty query string ### Steps to Reproduce 1. Follow procedures in https://docs.openwebui.com/tutorials/web-search/searxng/ 2. Verify using `curl` from inside openwebui container that everything works correctly (json output, etc) 3. Try to use websearch in a chat; throws these errors 4/5 or more times per chat submission (set to return 8 reults) ### Logs & Screenshots ``` requests.exceptions.HTTPError: 400 Client Error: BAD REQUEST for url: http://searxng:8080/search?q=&format=json&pageno=1&safesearch=1&language=en-US&time_range=&categories=&theme=simple&image_proxy=0 2025-05-16 10:00:03.037 | ERROR | open_webui.utils.middleware:chat_web_search_handler:428 - 400: 400 Client Error: BAD REQUEST for url: http://searxng:8080/search?q=&format=json&pageno=1&safesearch=1&language=en-US&time_range=&categories=&theme=simple&image_proxy=0 - {} Traceback (most recent call last): File "/app/backend/open_webui/routers/retrieval.py", line 1623, in process_web_search search_results = await asyncio.gather(*search_tasks) │ │ └ [<coroutine object run_in_threadpool at 0x7fd229d49b70>] │ └ <function gather at 0x7fd2f9e49da0> └ <module 'asyncio' from '/usr/local/lib/python3.11/asyncio/__init__.py'> File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 37, in run_in_threadpool return await anyio.to_thread.run_sync(func) │ │ │ └ functools.partial(<function search_web at 0x7fd2352951c0>, <starlette.requests.Request object at 0x7fd2031d2410>, 'searxng', '') │ │ └ <function run_sync at 0x7fd2f995ccc0> │ └ <module 'anyio.to_thread' from '/usr/local/lib/python3.11/site-packages/anyio/to_thread.py'> └ <module 'anyio' from '/usr/local/lib/python3.11/site-packages/anyio/__init__.py'> File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( └ <function get_async_backend at 0x7fd2f9b859e0> File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2470, in run_sync_in_worker_thread return await future └ <Future finished exception=HTTPError('400 Client Error: BAD REQUEST for url: http://searxng:8080/search?q=&format=json&pageno... File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 967, in run result = context.run(func, *args) File "/app/backend/open_webui/routers/retrieval.py", line 1392, in search_web return search_searxng( └ <function search_searxng at 0x7fd23633e700> File "/app/backend/open_webui/retrieval/web/searxng.py", line 79, in search_searxng response.raise_for_status() # Raise an exception for HTTP errors. │ └ <function Response.raise_for_status at 0x7fd2f730ef20> └ <Response [400]> File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status raise HTTPError(http_error_msg, response=self) │ │ └ <Response [400]> │ └ '400 Client Error: BAD REQUEST for url: http://searxng:8080/search?q=&format=json&pageno=1&safesearch=1&language=en-US&time_r... └ <class 'requests.exceptions.HTTPError'> ``` ### Additional Information _No response_
GiteaMirror added the bug label 2026-04-25 06:32:11 -05:00
Author
Owner

@tth37 commented on GitHub (May 16, 2025):

Well, maybe we should add an non-empty filter before queries were sent to search engines 🤔. Have you tried other search engines, is this a common problem?

<!-- gh-comment-id:2886343033 --> @tth37 commented on GitHub (May 16, 2025): Well, maybe we should add an non-empty filter before queries were sent to search engines 🤔. Have you tried other search engines, is this a common problem?
Author
Owner

@sempervictus commented on GitHub (May 16, 2025):

No external service APIs are used, duckduckgo is only other option here and that is always blocked in ratelimits anyway

<!-- gh-comment-id:2886471002 --> @sempervictus commented on GitHub (May 16, 2025): No external service APIs are used, duckduckgo is only other option here and that is always blocked in ratelimits anyway
Author
Owner

@tjbck commented on GitHub (May 16, 2025):

dec9dd1ac0 should've addressed, testing wanted here

<!-- gh-comment-id:2886687384 --> @tjbck commented on GitHub (May 16, 2025): dec9dd1ac048df4c349b681f0afdf60dcb78194e should'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#32614