mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-11 00:04:08 -05:00
Failed to add file to knowledge base #3568
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @beargolden on GitHub (Feb 4, 2025).
Installation Method
conda create -n open-webui python=3.11
conda activate open-webui
pip install open-webui
open-webui serve
Environment
Open WebUI Version: v0.5.7
Ollama (if applicable): v0.5.7
Operating System: Ubuntu 24.04.1 LTS
Browser (if applicable): Chromium 131.0.6778.264
Confirmation:
Expected Behavior:
Add files to newly-created knowledge base using the administrator user
Actual Behavior:
Failed to add file to knowledge base
Description
Bug Summary:
WARNI [python_multipart.multipart] Skipping data after last boundary
INFO [open_webui.routers.files] file.content_type: application/pdf
INFO [open_webui.routers.retrieval] save_docs_to_vector_db: document 信号系统-0.pdf file-7ccbe31c-ea30-4a4b-a3fc-6990b6839dde
Collection file-7ccbe31c-ea30-4a4b-a3fc-6990b6839dde does not exist.
INFO [open_webui.routers.retrieval] adding to collection file-7ccbe31c-ea30-4a4b-a3fc-6990b6839dde
ERROR [open_webui.routers.retrieval] 'NoneType' object has no attribute 'encode'
Traceback (most recent call last):
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/routers/retrieval.py", line 777, in save_docs_to_vector_db
embeddings = embedding_function(
^^^^^^^^^^^^^^^^^^^
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/retrieval/utils.py", line 262, in
return lambda query: embedding_function.encode(query).tolist()
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'encode'
ERROR [open_webui.routers.retrieval] 'NoneType' object has no attribute 'encode'
Traceback (most recent call last):
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/routers/retrieval.py", line 953, in process_file
raise e
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/routers/retrieval.py", line 926, in process_file
result = save_docs_to_vector_db(
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/routers/retrieval.py", line 799, in save_docs_to_vector_db
raise e
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/routers/retrieval.py", line 777, in save_docs_to_vector_db
embeddings = embedding_function(
^^^^^^^^^^^^^^^^^^^
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/retrieval/utils.py", line 262, in
return lambda query: embedding_function.encode(query).tolist()
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'encode'
ERROR [open_webui.routers.files] 400: 'NoneType' object has no attribute 'encode'
Traceback (most recent call last):
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/routers/retrieval.py", line 953, in process_file
raise e
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/routers/retrieval.py", line 926, in process_file
result = save_docs_to_vector_db(
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/routers/retrieval.py", line 799, in save_docs_to_vector_db
raise e
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/routers/retrieval.py", line 777, in save_docs_to_vector_db
embeddings = embedding_function(
^^^^^^^^^^^^^^^^^^^
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/retrieval/utils.py", line 262, in
return lambda query: embedding_function.encode(query).tolist()
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'encode'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/routers/files.py", line 74, in upload_file
process_file(request, ProcessFileForm(file_id=id))
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/routers/retrieval.py", line 962, in process_file
raise HTTPException(
fastapi.exceptions.HTTPException: 400: 'NoneType' object has no attribute 'encode'
ERROR [open_webui.routers.files] Error processing file: 7ccbe31c-ea30-4a4b-a3fc-6990b6839dde
INFO: 127.0.0.1:56684 - "POST /api/v1/files/ HTTP/1.1" 200 OK
Collection file-7ccbe31c-ea30-4a4b-a3fc-6990b6839dde does not exist.
INFO [open_webui.routers.retrieval] save_docs_to_vector_db: document 信号系统-0.pdf af9f8aed-2dd3-4ef3-8964-d43a45a60c92
Collection af9f8aed-2dd3-4ef3-8964-d43a45a60c92 does not exist.
INFO [open_webui.routers.retrieval] adding to collection af9f8aed-2dd3-4ef3-8964-d43a45a60c92
ERROR [open_webui.routers.retrieval] 'NoneType' object has no attribute 'encode'
Traceback (most recent call last):
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/routers/retrieval.py", line 777, in save_docs_to_vector_db
embeddings = embedding_function(
^^^^^^^^^^^^^^^^^^^
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/retrieval/utils.py", line 262, in
return lambda query: embedding_function.encode(query).tolist()
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'encode'
ERROR [open_webui.routers.retrieval] 'NoneType' object has no attribute 'encode'
Traceback (most recent call last):
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/routers/retrieval.py", line 953, in process_file
raise e
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/routers/retrieval.py", line 926, in process_file
result = save_docs_to_vector_db(
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/routers/retrieval.py", line 799, in save_docs_to_vector_db
raise e
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/routers/retrieval.py", line 777, in save_docs_to_vector_db
embeddings = embedding_function(
^^^^^^^^^^^^^^^^^^^
File "/home/xw/anaconda3/envs/open-webui/lib/python3.11/site-packages/open_webui/retrieval/utils.py", line 262, in
return lambda query: embedding_function.encode(query).tolist()
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'encode'
INFO: 127.0.0.1:56684 - "POST /api/v1/knowledge/af9f8aed-2dd3-4ef3-8964-d43a45a60c92/file/add HTTP/1.1" 400 Bad Request
Thank you for your consideration~