[GH-ISSUE #9964] The internet search function I want to enable in open-webui is encountering the following error. It has been verified in Postman that the content was returned normally. May I ask how to handle it? #54381

Closed
opened 2026-05-05 16:11:36 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @cookdrinker on GitHub (Feb 14, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/9964

The internet search function I want to enable in open-webui is encountering the following error. It has been verified in Postman that the content was returned normally. May I ask how to handle it? Thank you very much to the authors for supporting this issue

open-webui | INFO: 192.168.8.68:0 - "POST /api/v1/tasks/auto/completions HTTP/1.1" 200 OK
open-webui | INFO: 192.168.8.68:0 - "GET /api/v1/chats/61c595a7-b486-4b35-8f8e-f327a727d13d HTTP/1.1" 200 OK
open-webui | INFO: 192.168.8.68:0 - "GET /api/v1/chats/all/tags HTTP/1.1" 200 OK
open-webui | INFO: 192.168.8.68:0 - "POST /api/v1/tasks/auto/completions HTTP/1.1" 200 OK
open-webui | INFO [open_webui.routers.retrieval] save_docs_to_vector_db: document 北京 二月, 2025 天气 ⋆ 北京 (中国) 二月 天气 预报 ⋆ METEOPROG , 今明天北京晴暖当道继续升温 后天冷空气搅扰气温再度下滑 - 西部网(陕西新闻网), 北京2月份天气|北京2月份气温|北京2025年2月份历史天气—全球天气网 web-search-04453728508e0cb0ec1ba71737b948831d6a7f71a03fa2dd9057
open-webui | INFO [open_webui.routers.retrieval] adding to collection web-search-04453728508e0cb0ec1ba71737b948831d6a7f71a03fa2dd9057
open-webui | ERROR [open_webui.routers.retrieval] 'NoneType' object has no attribute 'encode'
open-webui | Traceback (most recent call last):
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 797, in save_docs_to_vector_db
open-webui | embeddings = embedding_function(
open-webui | ^^^^^^^^^^^^^^^^^^^
open-webui | File "/app/backend/open_webui/retrieval/utils.py", line 265, in
open-webui | return lambda query, user=None: embedding_function.encode(query).tolist()
open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui | AttributeError: 'NoneType' object has no attribute 'encode'
open-webui | ERROR [open_webui.routers.retrieval] 'NoneType' object has no attribute 'encode'
open-webui | Traceback (most recent call last):
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 1319, in process_web_search
open-webui | save_docs_to_vector_db(
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 819, in save_docs_to_vector_db
open-webui | raise e
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 797, in save_docs_to_vector_db
open-webui | embeddings = embedding_function(
open-webui | ^^^^^^^^^^^^^^^^^^^
open-webui | File "/app/backend/open_webui/retrieval/utils.py", line 265, in
open-webui | return lambda query, user=None: embedding_function.encode(query).tolist()
open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui | AttributeError: 'NoneType' object has no attribute 'encode'
open-webui | ERROR [open_webui.utils.middleware] 400: [ERROR: 'NoneType' object has no attribute 'encode']
open-webui | Traceback (most recent call last):
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 1319, in process_web_search
open-webui | save_docs_to_vector_db(
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 819, in save_docs_to_vector_db
open-webui | raise e
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 797, in save_docs_to_vector_db
open-webui | embeddings = embedding_function(
open-webui | ^^^^^^^^^^^^^^^^^^^
open-webui | File "/app/backend/open_webui/retrieval/utils.py", line 265, in
open-webui | return lambda query, user=None: embedding_function.encode(query).tolist()
open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui | AttributeError: 'NoneType' object has no attribute 'encode'
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 340, 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 342, in
open-webui | lambda: process_web_search(
open-webui | ^^^^^^^^^^^^^^^^^^^
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 1330, in process_web_search
open-webui | raise HTTPException(
open-webui | fastapi.exceptions.HTTPException: 400: [ERROR: 'NoneType' object has no attribute 'encode']
open-webui | INFO: 192.168.8.68:0 - "POST /api/chat/completions HTTP/1.1" 200 OK
open-webui | INFO: 192.168.8.68:0 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | INFO: 192.168.8.68:0 - "POST /api/chat/completed HTTP/1.1" 200 OK
open-webui | INFO: 192.168.8.68:0 - "POST /api/v1/chats/61c595a7-b486-4b35-8f8e-f327a727d13d HTTP/1.1" 200 OK
open-webui | INFO: 192.168.8.68:0 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK

Image

Image

Originally created by @cookdrinker on GitHub (Feb 14, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/9964 The internet search function I want to enable in open-webui is encountering the following error. It has been verified in Postman that the content was returned normally. May I ask how to handle it? Thank you very much to the authors for supporting this issue open-webui | INFO: 192.168.8.68:0 - "POST /api/v1/tasks/auto/completions HTTP/1.1" 200 OK open-webui | INFO: 192.168.8.68:0 - "GET /api/v1/chats/61c595a7-b486-4b35-8f8e-f327a727d13d HTTP/1.1" 200 OK open-webui | INFO: 192.168.8.68:0 - "GET /api/v1/chats/all/tags HTTP/1.1" 200 OK open-webui | INFO: 192.168.8.68:0 - "POST /api/v1/tasks/auto/completions HTTP/1.1" 200 OK open-webui | INFO [open_webui.routers.retrieval] save_docs_to_vector_db: document 北京 二月, 2025 天气 ⋆ 北京 (中国) 二月 天气 预报 ⋆ METEOPROG , 今明天北京晴暖当道继续升温 后天冷空气搅扰气温再度下滑 - 西部网(陕西新闻网), 北京2月份天气|北京2月份气温|北京2025年2月份历史天气—全球天气网 web-search-04453728508e0cb0ec1ba71737b948831d6a7f71a03fa2dd9057 open-webui | INFO [open_webui.routers.retrieval] adding to collection web-search-04453728508e0cb0ec1ba71737b948831d6a7f71a03fa2dd9057 open-webui | ERROR [open_webui.routers.retrieval] 'NoneType' object has no attribute 'encode' open-webui | Traceback (most recent call last): open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 797, in save_docs_to_vector_db open-webui | embeddings = embedding_function( open-webui | ^^^^^^^^^^^^^^^^^^^ open-webui | File "/app/backend/open_webui/retrieval/utils.py", line 265, in <lambda> open-webui | return lambda query, user=None: embedding_function.encode(query).tolist() open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | AttributeError: 'NoneType' object has no attribute 'encode' open-webui | ERROR [open_webui.routers.retrieval] 'NoneType' object has no attribute 'encode' open-webui | Traceback (most recent call last): open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 1319, in process_web_search open-webui | save_docs_to_vector_db( open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 819, in save_docs_to_vector_db open-webui | raise e open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 797, in save_docs_to_vector_db open-webui | embeddings = embedding_function( open-webui | ^^^^^^^^^^^^^^^^^^^ open-webui | File "/app/backend/open_webui/retrieval/utils.py", line 265, in <lambda> open-webui | return lambda query, user=None: embedding_function.encode(query).tolist() open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | AttributeError: 'NoneType' object has no attribute 'encode' open-webui | ERROR [open_webui.utils.middleware] 400: [ERROR: 'NoneType' object has no attribute 'encode'] open-webui | Traceback (most recent call last): open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 1319, in process_web_search open-webui | save_docs_to_vector_db( open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 819, in save_docs_to_vector_db open-webui | raise e open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 797, in save_docs_to_vector_db open-webui | embeddings = embedding_function( open-webui | ^^^^^^^^^^^^^^^^^^^ open-webui | File "/app/backend/open_webui/retrieval/utils.py", line 265, in <lambda> open-webui | return lambda query, user=None: embedding_function.encode(query).tolist() open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | AttributeError: 'NoneType' object has no attribute 'encode' 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 340, 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 342, in <lambda> open-webui | lambda: process_web_search( open-webui | ^^^^^^^^^^^^^^^^^^^ open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 1330, in process_web_search open-webui | raise HTTPException( open-webui | fastapi.exceptions.HTTPException: 400: [ERROR: 'NoneType' object has no attribute 'encode'] open-webui | INFO: 192.168.8.68:0 - "POST /api/chat/completions HTTP/1.1" 200 OK open-webui | INFO: 192.168.8.68:0 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK open-webui | INFO: 192.168.8.68:0 - "POST /api/chat/completed HTTP/1.1" 200 OK open-webui | INFO: 192.168.8.68:0 - "POST /api/v1/chats/61c595a7-b486-4b35-8f8e-f327a727d13d HTTP/1.1" 200 OK open-webui | INFO: 192.168.8.68:0 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK ![Image](https://github.com/user-attachments/assets/8538fa24-72c9-4679-8a25-fd05b5e3f6fa) ![Image](https://github.com/user-attachments/assets/07de98e0-1b2d-4c01-bfa2-adea5f4e3dd7)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#54381