[GH-ISSUE #12403] issue: websearch has error with "'NoneType' object has no attribute 'encode'" #16588

Closed
opened 2026-04-19 22:29:14 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @greatji on GitHub (Apr 3, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/12403

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

v0.5.20

Ollama Version (if applicable)

No response

Operating System

Windows 10 WSL2 Ubuntu 22.04

Browser (if applicable)

Chrome 134.0.6998.118

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

Got the information from the search engine jina.

Actual Behavior

Cannot process the pages fetched from the web.

Image

Steps to Reproduce

  1. choose jina as the web search engine;
  2. choose qwq32B as the model;
  3. run a prompt with web search on;

Logs & Screenshots

2025-04-03 21:46:56.150 | ERROR | open_webui.routers.retrieval:save_docs_to_vector_db:904 - 'NoneType' object has no attribute 'encode' - {}
Traceback (most recent call last):

File "/home/sunji/anaconda3/lib/python3.12/threading.py", line 1032, in _bootstrap
self._bootstrap_inner()
│ └ <function Thread._bootstrap_inner at 0x7f94d282ccc0>
└ <WorkerThread(AnyIO worker thread, started 140272407139904)>
File "/home/sunji/anaconda3/lib/python3.12/threading.py", line 1075, in _bootstrap_inner
self.run()
│ └ <function WorkerThread.run at 0x7f93beb8a980>
└ <WorkerThread(AnyIO worker thread, started 140272407139904)>
File "/home/sunji/anaconda3/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 962, in run
result = context.run(func, *args)
│ │ │ └ ()
│ │ └ functools.partial(<function save_docs_to_vector_db at 0x7f93f82ae8e0>, <starlette.requests.Request object at 0x7f93b4477380>,...
│ └ <method 'run' of '_contextvars.Context' objects>
└ <_contextvars.Context object at 0x7f93b7e85840>

File "/home/sunji/anaconda3/lib/python3.12/site-packages/open_webui/routers/retrieval.py", line 883, in save_docs_to_vector_db
embeddings = embedding_function(
└ <function get_embedding_function.. at 0x7f93b7f69b20>
File "/home/sunji/anaconda3/lib/python3.12/site-packages/open_webui/retrieval/utils.py", line 314, in
return lambda query, user=None: embedding_function.encode(query).tolist()
│ │ └ ['\ufeff 清华大学学生职业发展指导中心 用户登录 English 首页 >学生 招聘信息 职业辅导 手续办理 手续办理 多媒体中心 教师 ...
│ └ None
└ ['\ufeff 清华大学学生职业发展指导中心 用户登录 English 首页 学生 招聘信息 职业辅导 手续办理 手续办理 多媒体中心 教师 ...

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

Additional Information

No response

Originally created by @greatji on GitHub (Apr 3, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/12403 ### 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 v0.5.20 ### Ollama Version (if applicable) _No response_ ### Operating System Windows 10 WSL2 Ubuntu 22.04 ### Browser (if applicable) Chrome 134.0.6998.118 ### 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 Got the information from the search engine jina. ### Actual Behavior Cannot process the pages fetched from the web. ![Image](https://github.com/user-attachments/assets/5afa1076-e9b1-4e0f-8120-c6fc3baf203f) ### Steps to Reproduce 1. choose jina as the web search engine; 2. choose qwq32B as the model; 3. run a prompt with web search on; ### Logs & Screenshots 2025-04-03 21:46:56.150 | ERROR | open_webui.routers.retrieval:save_docs_to_vector_db:904 - 'NoneType' object has no attribute 'encode' - {} Traceback (most recent call last): File "/home/sunji/anaconda3/lib/python3.12/threading.py", line 1032, in _bootstrap self._bootstrap_inner() │ └ <function Thread._bootstrap_inner at 0x7f94d282ccc0> └ <WorkerThread(AnyIO worker thread, started 140272407139904)> File "/home/sunji/anaconda3/lib/python3.12/threading.py", line 1075, in _bootstrap_inner self.run() │ └ <function WorkerThread.run at 0x7f93beb8a980> └ <WorkerThread(AnyIO worker thread, started 140272407139904)> File "/home/sunji/anaconda3/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 962, in run result = context.run(func, *args) │ │ │ └ () │ │ └ functools.partial(<function save_docs_to_vector_db at 0x7f93f82ae8e0>, <starlette.requests.Request object at 0x7f93b4477380>,... │ └ <method 'run' of '_contextvars.Context' objects> └ <_contextvars.Context object at 0x7f93b7e85840> > File "/home/sunji/anaconda3/lib/python3.12/site-packages/open_webui/routers/retrieval.py", line 883, in save_docs_to_vector_db embeddings = embedding_function( └ <function get_embedding_function.<locals>.<lambda> at 0x7f93b7f69b20> File "/home/sunji/anaconda3/lib/python3.12/site-packages/open_webui/retrieval/utils.py", line 314, in <lambda> return lambda query, user=None: embedding_function.encode(query).tolist() │ │ └ ['\ufeff 清华大学学生职业发展指导中心 用户登录 English 首页 >学生 招聘信息 职业辅导 手续办理 手续办理 多媒体中心 教师 ... │ └ None └ ['\ufeff 清华大学学生职业发展指导中心 用户登录 English 首页 学生 招聘信息 职业辅导 手续办理 手续办理 多媒体中心 教师 ... AttributeError: 'NoneType' object has no attribute 'encode' ### Additional Information _No response_
GiteaMirror added the bug label 2026-04-19 22:29:14 -05:00
Author
Owner

@zebulonjones commented on GitHub (Apr 3, 2025):

I am new to all of this, but maybe try changing embedding models? I had a similar issue a few versions back.

<!-- gh-comment-id:2776212160 --> @zebulonjones commented on GitHub (Apr 3, 2025): I am new to all of this, but maybe try changing embedding models? I had a similar issue a few versions back.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#16588