issue: WebSearch does not work - 'NoneType' object has no attribute 'encode' #5364

Closed
opened 2025-11-11 16:18:51 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @yazon on GitHub (May 28, 2025).

Check Existing Issues

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

Installation Method

Pip Install

Open WebUI Version

0.6.11

Ollama Version (if applicable)

No response

Operating System

Windows 10

Browser (if applicable)

Chrome

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 provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

When WebSearch is activated the web pages should be searched/scraped and output should be provided to LLM.

Actual Behavior

It seems that webpages are properly searched/scraped but LLM does not receive the output.

Steps to Reproduce

  1. Start Open WebUI
  2. Set Web Search provider (I testes on Goolge PSE and Firecrawl).
  3. Enter prompt "Weather in Paris now"
  4. Enable WebSerach
  5. Send prompt to LLM

Logs & Screenshots

Image

2025-05-28 08:51:21.714 | INFO     | open_webui.routers.retrieval:process_web_search:1661 - trying to web search with ('google_pse', ['current weather in Paris', 'Paris weather forecast for today', 'Paris weather updates 2025-05-28']) - {}
Fetching pages: 100%|####################################################################################################################################| 7/7 [00:02<00:00,  2.46it/s]
2025-05-28 08:51:26.137 | INFO     | open_webui.routers.retrieval:save_docs_to_vector_db:969 - save_docs_to_vector_db: document Kentucky Lake Levels, Conditions, Water Temperatures, Suresnes - Weather Forecast Maps | Ventusky, Flight Status | Port of Seattle, Paris, Ville de Paris, France Weather Forecast | AccuWeather, Weather Forecast and Conditions for Paris, France - The Weather Channel | Weather.com, 10-Day Weather Forecast for Paris, France - The Weather Channel | weather.com, Weather Forecast and Conditions for Invalides, Île-de-France, France - The Weather Channel | Weather.com web-search-4c0d3ebe16b2ec0906cf4bc850eb01ceac58bef8d2aadca7cd26 - {}
2025-05-28 08:51:26.148 | INFO     | open_webui.routers.retrieval:save_docs_to_vector_db:1052 - adding to collection web-search-4c0d3ebe16b2ec0906cf4bc850eb01ceac58bef8d2aadca7cd26 - {}
2025-05-28 08:51:26.149 | ERROR    | open_webui.routers.retrieval:save_docs_to_vector_db:1093 - 'NoneType' object has no attribute 'encode' - {}
Traceback (most recent call last):

  File "C:\anaconda3\Lib\threading.py", line 1032, in _bootstrap
    self._bootstrap_inner()
    │    └ <function Thread._bootstrap_inner at 0x0000021E6A2F0540>
    └ <WorkerThread(AnyIO worker thread, started 18656)>
  File "C:\anaconda3\Lib\threading.py", line 1075, in _bootstrap_inner
    self.run()
    │    └ <function WorkerThread.run at 0x0000021E467E4860>
    └ <WorkerThread(AnyIO worker thread, started 18656)>
  File "C:\ai\venv\Lib\site-packages\anyio\_backends\_asyncio.py", line 962, in run
    result = context.run(func, *args)
             │       │   │      └ ()
             │       │   └ functools.partial(<function save_docs_to_vector_db at 0x0000021E1C8C7F60>, <starlette.requests.Request object at 0x0000021E4E...
             │       └ <method 'run' of '_contextvars.Context' objects>
             └ <_contextvars.Context object at 0x0000021E4699F740>
> File "C:\ai\venv\Lib\site-packages\open_webui\routers\retrieval.py", line 1070, in save_docs_to_vector_db
    embeddings = embedding_function(
                 └ <function get_embedding_function.<locals>.<lambda> at 0x0000021E6D0C7EC0>
  File "C:\ai\venv\Lib\site-packages\open_webui\retrieval\utils.py", line 405, in <lambda>
    return lambda query, prefix=None, user=None: embedding_function.encode(
                  │                              └ None
                  └ ['10-Day Weather Forecast for Paris, France - The Weather Channel | weather.com         AdvertisementAdvertisementSkip to Mai...

AttributeError: 'NoneType' object has no attribute 'encode'
2025-05-28 08:51:26.216 | INFO     | open_webui.routers.openai:get_all_models:391 - get_all_models() - {}
2025-05-28 08:51:28.745 | ERROR    | open_webui.retrieval.utils:get_sources_from_files:584 - 'NoneType' object has no attribute 'encode' - {}
Traceback (most recent call last):

  File "C:\anaconda3\Lib\threading.py", line 1032, in _bootstrap
    self._bootstrap_inner()
    │    └ <function Thread._bootstrap_inner at 0x0000021E6A2F0540>
    └ <Thread(ThreadPoolExecutor-4_0, started 29192)>
  File "C:\anaconda3\Lib\threading.py", line 1075, in _bootstrap_inner
    self.run()
    │    └ <function Thread.run at 0x0000021E6A2F0220>
    └ <Thread(ThreadPoolExecutor-4_0, started 29192)>
  File "C:\anaconda3\Lib\threading.py", line 1012, in run
    self._target(*self._args, **self._kwargs)
    │    │        │    │        │    └ {}
    │    │        │    │        └ <Thread(ThreadPoolExecutor-4_0, started 29192)>
    │    │        │    └ (<weakref at 0x0000021E4D0F62A0; to 'ThreadPoolExecutor' at 0x0000021E49643800>, <_queue.SimpleQueue object at 0x0000021E4EE6...
    │    │        └ <Thread(ThreadPoolExecutor-4_0, started 29192)>
    │    └ <function _worker at 0x0000021E7F907A60>
    └ <Thread(ThreadPoolExecutor-4_0, started 29192)>
  File "C:\anaconda3\Lib\concurrent\futures\thread.py", line 92, in _worker
    work_item.run()
    │         └ <function _WorkItem.run at 0x0000021E7F907BA0>
    └ <concurrent.futures.thread._WorkItem object at 0x0000021E4EE30650>
  File "C:\anaconda3\Lib\concurrent\futures\thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             │    │   │    │       │    └ {}
             │    │   │    │       └ <concurrent.futures.thread._WorkItem object at 0x0000021E4EE30650>
             │    │   │    └ ()
             │    │   └ <concurrent.futures.thread._WorkItem object at 0x0000021E4EE30650>
             │    └ <function chat_completion_files_handler.<locals>.<lambda> at 0x0000021E469DDEE0>
             └ <concurrent.futures.thread._WorkItem object at 0x0000021E4EE30650>
  File "C:\ai\venv\Lib\site-packages\open_webui\utils\middleware.py", line 635, in <lambda>
    lambda: get_sources_from_files(
            └ <function get_sources_from_files at 0x0000021E1C8C5A80>
> File "C:\ai\venv\Lib\site-packages\open_webui\retrieval\utils.py", line 577, in get_sources_from_files
    context = query_collection(
              └ <function query_collection at 0x0000021E1C8C4E00>
  File "C:\ai\venv\Lib\site-packages\open_webui\retrieval\utils.py", line 293, in query_collection
    query_embeddings = embedding_function(queries, prefix=RAG_EMBEDDING_QUERY_PREFIX)
                       │                  │               └ None
                       │                  └ ['current weather in Paris 2025', 'Paris weather forecast 2025-05-28', 'Paris weather updates 2025']
                       └ <function chat_completion_files_handler.<locals>.<lambda>.<locals>.<lambda> at 0x0000021E469DC040>
  File "C:\ai\venv\Lib\site-packages\open_webui\utils\middleware.py", line 639, in <lambda>
    embedding_function=lambda query, prefix: request.app.state.EMBEDDING_FUNCTION(
                              │      │       │       └ <property object at 0x0000021E6F9CD5D0>
                              │      │       └ <starlette.requests.Request object at 0x0000021E4EED69C0>
                              │      └ None
                              └ ['current weather in Paris 2025', 'Paris weather forecast 2025-05-28', 'Paris weather updates 2025']
  File "C:\ai\venv\Lib\site-packages\open_webui\retrieval\utils.py", line 405, in <lambda>
    return lambda query, prefix=None, user=None: embedding_function.encode(
                  │                              └ None
                  └ ['current weather in Paris 2025', 'Paris weather forecast 2025-05-28', 'Paris weather updates 2025']

AttributeError: 'NoneType' object has no attribute 'encode'

### Additional Information

Tested on two machines with Open WebUI installed.
Originally created by @yazon on GitHub (May 28, 2025). ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Pip Install ### Open WebUI Version 0.6.11 ### Ollama Version (if applicable) _No response_ ### Operating System Windows 10 ### Browser (if applicable) Chrome ### 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 **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior When WebSearch is activated the web pages should be searched/scraped and output should be provided to LLM. ### Actual Behavior It seems that webpages are properly searched/scraped but LLM does not receive the output. ### Steps to Reproduce 1. Start Open WebUI 2. Set Web Search provider (I testes on Goolge PSE and Firecrawl). 3. Enter prompt "Weather in Paris now" 4. Enable WebSerach 5. Send prompt to LLM ### Logs & Screenshots ![Image](https://github.com/user-attachments/assets/94f0afaa-0e8a-4dc6-9ac8-49627e195a02) ``` 2025-05-28 08:51:21.714 | INFO | open_webui.routers.retrieval:process_web_search:1661 - trying to web search with ('google_pse', ['current weather in Paris', 'Paris weather forecast for today', 'Paris weather updates 2025-05-28']) - {} Fetching pages: 100%|####################################################################################################################################| 7/7 [00:02<00:00, 2.46it/s] 2025-05-28 08:51:26.137 | INFO | open_webui.routers.retrieval:save_docs_to_vector_db:969 - save_docs_to_vector_db: document Kentucky Lake Levels, Conditions, Water Temperatures, Suresnes - Weather Forecast Maps | Ventusky, Flight Status | Port of Seattle, Paris, Ville de Paris, France Weather Forecast | AccuWeather, Weather Forecast and Conditions for Paris, France - The Weather Channel | Weather.com, 10-Day Weather Forecast for Paris, France - The Weather Channel | weather.com, Weather Forecast and Conditions for Invalides, Île-de-France, France - The Weather Channel | Weather.com web-search-4c0d3ebe16b2ec0906cf4bc850eb01ceac58bef8d2aadca7cd26 - {} 2025-05-28 08:51:26.148 | INFO | open_webui.routers.retrieval:save_docs_to_vector_db:1052 - adding to collection web-search-4c0d3ebe16b2ec0906cf4bc850eb01ceac58bef8d2aadca7cd26 - {} 2025-05-28 08:51:26.149 | ERROR | open_webui.routers.retrieval:save_docs_to_vector_db:1093 - 'NoneType' object has no attribute 'encode' - {} Traceback (most recent call last): File "C:\anaconda3\Lib\threading.py", line 1032, in _bootstrap self._bootstrap_inner() │ └ <function Thread._bootstrap_inner at 0x0000021E6A2F0540> └ <WorkerThread(AnyIO worker thread, started 18656)> File "C:\anaconda3\Lib\threading.py", line 1075, in _bootstrap_inner self.run() │ └ <function WorkerThread.run at 0x0000021E467E4860> └ <WorkerThread(AnyIO worker thread, started 18656)> File "C:\ai\venv\Lib\site-packages\anyio\_backends\_asyncio.py", line 962, in run result = context.run(func, *args) │ │ │ └ () │ │ └ functools.partial(<function save_docs_to_vector_db at 0x0000021E1C8C7F60>, <starlette.requests.Request object at 0x0000021E4E... │ └ <method 'run' of '_contextvars.Context' objects> └ <_contextvars.Context object at 0x0000021E4699F740> > File "C:\ai\venv\Lib\site-packages\open_webui\routers\retrieval.py", line 1070, in save_docs_to_vector_db embeddings = embedding_function( └ <function get_embedding_function.<locals>.<lambda> at 0x0000021E6D0C7EC0> File "C:\ai\venv\Lib\site-packages\open_webui\retrieval\utils.py", line 405, in <lambda> return lambda query, prefix=None, user=None: embedding_function.encode( │ └ None └ ['10-Day Weather Forecast for Paris, France - The Weather Channel | weather.com AdvertisementAdvertisementSkip to Mai... AttributeError: 'NoneType' object has no attribute 'encode' 2025-05-28 08:51:26.216 | INFO | open_webui.routers.openai:get_all_models:391 - get_all_models() - {} 2025-05-28 08:51:28.745 | ERROR | open_webui.retrieval.utils:get_sources_from_files:584 - 'NoneType' object has no attribute 'encode' - {} Traceback (most recent call last): File "C:\anaconda3\Lib\threading.py", line 1032, in _bootstrap self._bootstrap_inner() │ └ <function Thread._bootstrap_inner at 0x0000021E6A2F0540> └ <Thread(ThreadPoolExecutor-4_0, started 29192)> File "C:\anaconda3\Lib\threading.py", line 1075, in _bootstrap_inner self.run() │ └ <function Thread.run at 0x0000021E6A2F0220> └ <Thread(ThreadPoolExecutor-4_0, started 29192)> File "C:\anaconda3\Lib\threading.py", line 1012, in run self._target(*self._args, **self._kwargs) │ │ │ │ │ └ {} │ │ │ │ └ <Thread(ThreadPoolExecutor-4_0, started 29192)> │ │ │ └ (<weakref at 0x0000021E4D0F62A0; to 'ThreadPoolExecutor' at 0x0000021E49643800>, <_queue.SimpleQueue object at 0x0000021E4EE6... │ │ └ <Thread(ThreadPoolExecutor-4_0, started 29192)> │ └ <function _worker at 0x0000021E7F907A60> └ <Thread(ThreadPoolExecutor-4_0, started 29192)> File "C:\anaconda3\Lib\concurrent\futures\thread.py", line 92, in _worker work_item.run() │ └ <function _WorkItem.run at 0x0000021E7F907BA0> └ <concurrent.futures.thread._WorkItem object at 0x0000021E4EE30650> File "C:\anaconda3\Lib\concurrent\futures\thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) │ │ │ │ │ └ {} │ │ │ │ └ <concurrent.futures.thread._WorkItem object at 0x0000021E4EE30650> │ │ │ └ () │ │ └ <concurrent.futures.thread._WorkItem object at 0x0000021E4EE30650> │ └ <function chat_completion_files_handler.<locals>.<lambda> at 0x0000021E469DDEE0> └ <concurrent.futures.thread._WorkItem object at 0x0000021E4EE30650> File "C:\ai\venv\Lib\site-packages\open_webui\utils\middleware.py", line 635, in <lambda> lambda: get_sources_from_files( └ <function get_sources_from_files at 0x0000021E1C8C5A80> > File "C:\ai\venv\Lib\site-packages\open_webui\retrieval\utils.py", line 577, in get_sources_from_files context = query_collection( └ <function query_collection at 0x0000021E1C8C4E00> File "C:\ai\venv\Lib\site-packages\open_webui\retrieval\utils.py", line 293, in query_collection query_embeddings = embedding_function(queries, prefix=RAG_EMBEDDING_QUERY_PREFIX) │ │ └ None │ └ ['current weather in Paris 2025', 'Paris weather forecast 2025-05-28', 'Paris weather updates 2025'] └ <function chat_completion_files_handler.<locals>.<lambda>.<locals>.<lambda> at 0x0000021E469DC040> File "C:\ai\venv\Lib\site-packages\open_webui\utils\middleware.py", line 639, in <lambda> embedding_function=lambda query, prefix: request.app.state.EMBEDDING_FUNCTION( │ │ │ └ <property object at 0x0000021E6F9CD5D0> │ │ └ <starlette.requests.Request object at 0x0000021E4EED69C0> │ └ None └ ['current weather in Paris 2025', 'Paris weather forecast 2025-05-28', 'Paris weather updates 2025'] File "C:\ai\venv\Lib\site-packages\open_webui\retrieval\utils.py", line 405, in <lambda> return lambda query, prefix=None, user=None: embedding_function.encode( │ └ None └ ['current weather in Paris 2025', 'Paris weather forecast 2025-05-28', 'Paris weather updates 2025'] AttributeError: 'NoneType' object has no attribute 'encode' ### Additional Information Tested on two machines with Open WebUI installed.
GiteaMirror added the bug label 2025-11-11 16:18:51 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#5364