web search with google_pse not working as expected
Reproduction Details
Steps to Reproduce:
enable web search then input something
Logs and Screenshots
Browser Console Logs:
[Include relevant browser console logs, if applicable]
Docker Container Logs:
open-webui | ERROR [open_webui.routers.retrieval] 400 Client Error: Bad Request for url: https://www.googleapis.com/customsearch/v1
open-webui | Traceback (most recent call last):
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 1268, in process_web_search
open-webui | web_results = search_web(
open-webui | ^^^^^^^^^^^
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 1136, in search_web
open-webui | return search_google_pse(
open-webui | ^^^^^^^^^^^^^^^^^^
open-webui | File "/app/backend/open_webui/retrieval/web/google_pse.py", line 37, in search_google_pse
open-webui | response.raise_for_status()
open-webui | File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status
open-webui | raise HTTPError(http_error_msg, response=self)
open-webui | requests.exceptions.HTTPError: 400 Client Error: Bad Request for url:
open-webui | Traceback (most recent call last):
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 1268, in process_web_search
open-webui | web_results = search_web(
open-webui | ^^^^^^^^^^^
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 1136, in search_web
open-webui | return search_google_pse(
open-webui | ^^^^^^^^^^^^^^^^^^
open-webui | File "/app/backend/open_webui/retrieval/web/google_pse.py", line 37, in search_google_pse
open-webui | response.raise_for_status()
open-webui | File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status
open-webui | raise HTTPError(http_error_msg, response=self)
open-webui | requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://www.googleapis.com/customsearch/v1
open-webui |
open-webui | During handling of the above exception, another exception occurred:
open-webui |
open-webui | Traceback (most recent call last):
open-webui | File "/app/backend/open_webui/utils/middleware.py", line 429, in chat_web_search_handler
open-webui | results = await loop.run_in_executor(
open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui | File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
open-webui | result = self.fn(*self.args, **self.kwargs)
open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui | File "/app/backend/open_webui/utils/middleware.py", line 431, in <lambda>
open-webui | lambda: process_web_search(
open-webui | ^^^^^^^^^^^^^^^^^^^
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 1274, in process_web_search
open-webui | raise HTTPException(
open-webui | fastapi.exceptions.HTTPException: 400: 400 Client Error: Bad Request for url: https://www.googleapis.com/customsearch/
Screenshots/Screen Recordings (if applicable):
Additional Information
I'm sure the configuration is correct; I think there's some problem with Google's Programmable Search Engine.
Note
Originally created by @homjay on GitHub (Feb 9, 2025).
# Bug Report
---
## Installation Method
docker
## Environment
- **Open WebUI Version:** v0.5.10
- **Ollama (if applicable):**
- **Operating System:** Ubuntu 22.04
- **Browser (if applicable):** Chrome 133.0,
**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 with google pse
## Actual Behavior:
```
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"errors": [
{
"message": "Request contains an invalid argument.",
"domain": "global",
"reason": "badRequest"
}
],
"status": "INVALID_ARGUMENT"
}
}
```
## Description
**Bug Summary:**
web search with google_pse not working as expected
## Reproduction Details
**Steps to Reproduce:**
enable web search then input something
## Logs and Screenshots
**Browser Console Logs:**
[Include relevant browser console logs, if applicable]
**Docker Container Logs:**
```
open-webui | ERROR [open_webui.routers.retrieval] 400 Client Error: Bad Request for url: https://www.googleapis.com/customsearch/v1
open-webui | Traceback (most recent call last):
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 1268, in process_web_search
open-webui | web_results = search_web(
open-webui | ^^^^^^^^^^^
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 1136, in search_web
open-webui | return search_google_pse(
open-webui | ^^^^^^^^^^^^^^^^^^
open-webui | File "/app/backend/open_webui/retrieval/web/google_pse.py", line 37, in search_google_pse
open-webui | response.raise_for_status()
open-webui | File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status
open-webui | raise HTTPError(http_error_msg, response=self)
open-webui | requests.exceptions.HTTPError: 400 Client Error: Bad Request for url:
open-webui | Traceback (most recent call last):
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 1268, in process_web_search
open-webui | web_results = search_web(
open-webui | ^^^^^^^^^^^
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 1136, in search_web
open-webui | return search_google_pse(
open-webui | ^^^^^^^^^^^^^^^^^^
open-webui | File "/app/backend/open_webui/retrieval/web/google_pse.py", line 37, in search_google_pse
open-webui | response.raise_for_status()
open-webui | File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status
open-webui | raise HTTPError(http_error_msg, response=self)
open-webui | requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://www.googleapis.com/customsearch/v1
open-webui |
open-webui | During handling of the above exception, another exception occurred:
open-webui |
open-webui | Traceback (most recent call last):
open-webui | File "/app/backend/open_webui/utils/middleware.py", line 429, in chat_web_search_handler
open-webui | results = await loop.run_in_executor(
open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui | File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
open-webui | result = self.fn(*self.args, **self.kwargs)
open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui | File "/app/backend/open_webui/utils/middleware.py", line 431, in <lambda>
open-webui | lambda: process_web_search(
open-webui | ^^^^^^^^^^^^^^^^^^^
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 1274, in process_web_search
open-webui | raise HTTPException(
open-webui | fastapi.exceptions.HTTPException: 400: 400 Client Error: Bad Request for url: https://www.googleapis.com/customsearch/
```
**Screenshots/Screen Recordings (if applicable):**
## Additional Information
I'm sure the configuration is correct; I think there's some problem with Google's Programmable Search Engine.
## Note
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 @homjay on GitHub (Feb 9, 2025).
Bug Report
Installation Method
docker
Environment
Open WebUI Version: v0.5.10
Ollama (if applicable):
Operating System: Ubuntu 22.04
Browser (if applicable): Chrome 133.0,
Confirmation:
Expected Behavior:
web search with google pse
Actual Behavior:
Description
Bug Summary:
web search with google_pse not working as expected
Reproduction Details
Steps to Reproduce:
enable web search then input something
Logs and Screenshots
Browser Console Logs:
[Include relevant browser console logs, if applicable]
Docker Container Logs:
Screenshots/Screen Recordings (if applicable):
Additional Information
I'm sure the configuration is correct; I think there's some problem with Google's Programmable Search Engine.
Note