mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[GH-ISSUE #10211] Unable to edit knowledge uploaded file #15809
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 @5t0x2fH1z on GitHub (Feb 17, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/10211
Bug Report
Installation Method
Installed via "Development Methods" - git clone. main branch
Environment
Open WebUI Version: [v0.5.11]
Ollama (if applicable): [no]
Operating System: [macOS 15.3]
Browser (if applicable): [Safari 18.3, Chrome 133.0.6943.55]
Confirmation:
Expected Behavior:
Edited file saved to vectorstore
Actual Behavior:
Error rices: Expected metadata value to be a str, int, float or bool, got {} which is a dict in add.
And file disappears from vector store but remain in admin panel under knowledge menu. It breaks RAG functionality as model unable to get context
Description
Bug Summary:
Any of knowledge files can't be edited
Reproduction Details
Steps to Reproduce:
Logs and Screenshots
Docker Container Logs:
INFO: 127.0.0.1:56903 - "POST /api/v1/files/e10878f0-8fde-4e19-bc86-224736d8c422/data/content/update HTTP/1.1" 200 OK
DEBUG [open_webui.routers.retrieval] text_content: some test content
INFO [open_webui.routers.retrieval] save_docs_to_vector_db: document Untitled1.txt 71cc6194-1f2d-44b3-adfa-9ca2893917fd
INFO [open_webui.routers.retrieval] collection 71cc6194-1f2d-44b3-adfa-9ca2893917fd already exists
INFO [open_webui.routers.retrieval] adding to collection 71cc6194-1f2d-44b3-adfa-9ca2893917fd
ERROR [open_webui.routers.retrieval] Expected metadata value to be a str, int, float or bool, got {} which is a dict in add.
Traceback (most recent call last):
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/models/CollectionCommon.py", line 90, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/models/CollectionCommon.py", line 207, in _validate_and_prepare_add_request
validate_insert_record_set(record_set=add_records)
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/types.py", line 230, in validate_insert_record_set
validate_metadatas(record_set["metadatas"])
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/types.py", line 592, in validate_metadatas
validate_metadata(metadata)
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/types.py", line 558, in validate_metadata
raise ValueError(
ValueError: Expected metadata value to be a str, int, float or bool, got {} which is a dict
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/5t0x2fh1z/Dev/ai/open-webui/backend/open_webui/routers/retrieval.py", line 811, in save_docs_to_vector_db
VECTOR_DB_CLIENT.insert(
File "/Users/5t0x2fh1z/Dev/ai/open-webui/backend/open_webui/retrieval/vector/dbs/chroma.py", line 141, in insert
collection.add(*batch)
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/models/Collection.py", line 82, in add
add_request = self._validate_and_prepare_add_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/models/CollectionCommon.py", line 93, in wrapper
raise type(e)(msg).with_traceback(e.traceback)
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/models/CollectionCommon.py", line 90, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/models/CollectionCommon.py", line 207, in _validate_and_prepare_add_request
validate_insert_record_set(record_set=add_records)
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/types.py", line 230, in validate_insert_record_set
validate_metadatas(record_set["metadatas"])
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/types.py", line 592, in validate_metadatas
validate_metadata(metadata)
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/types.py", line 558, in validate_metadata
raise ValueError(
ValueError: Expected metadata value to be a str, int, float or bool, got {} which is a dict in add.
ERROR [open_webui.routers.retrieval] Expected metadata value to be a str, int, float or bool, got {} which is a dict in add.
Traceback (most recent call last):
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/models/CollectionCommon.py", line 90, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/models/CollectionCommon.py", line 207, in _validate_and_prepare_add_request
validate_insert_record_set(record_set=add_records)
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/types.py", line 230, in validate_insert_record_set
validate_metadatas(record_set["metadatas"])
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/types.py", line 592, in validate_metadatas
validate_metadata(metadata)
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/types.py", line 558, in validate_metadata
raise ValueError(
ValueError: Expected metadata value to be a str, int, float or bool, got {} which is a dict
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/5t0x2fh1z/Dev/ai/open-webui/backend/open_webui/routers/retrieval.py", line 974, in process_file
raise e
File "/Users/5t0x2fh1z/Dev/ai/open-webui/backend/open_webui/routers/retrieval.py", line 946, in process_file
result = save_docs_to_vector_db(
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/5t0x2fh1z/Dev/ai/open-webui/backend/open_webui/routers/retrieval.py", line 819, in save_docs_to_vector_db
raise e
File "/Users/5t0x2fh1z/Dev/ai/open-webui/backend/open_webui/routers/retrieval.py", line 811, in save_docs_to_vector_db
VECTOR_DB_CLIENT.insert(
File "/Users/5t0x2fh1z/Dev/ai/open-webui/backend/open_webui/retrieval/vector/dbs/chroma.py", line 141, in insert
collection.add(*batch)
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/models/Collection.py", line 82, in add
add_request = self._validate_and_prepare_add_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/models/CollectionCommon.py", line 93, in wrapper
raise type(e)(msg).with_traceback(e.traceback)
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/models/CollectionCommon.py", line 90, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/models/CollectionCommon.py", line 207, in _validate_and_prepare_add_request
validate_insert_record_set(record_set=add_records)
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/types.py", line 230, in validate_insert_record_set
validate_metadatas(record_set["metadatas"])
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/types.py", line 592, in validate_metadatas
validate_metadata(metadata)
File "/opt/homebrew/Caskroom/miniconda/base/envs/open-webui/lib/python3.11/site-packages/chromadb/api/types.py", line 558, in validate_metadata
raise ValueError(
ValueError: Expected metadata value to be a str, int, float or bool, got {} which is a dict in add.
INFO: 127.0.0.1:56904 - "POST /api/v1/knowledge/71cc6194-1f2d-44b3-adfa-9ca2893917fd/file/update HTTP/1.1" 400 Bad Request
Screenshots/Screen Recordings (if applicable):
@tjbck commented on GitHub (Feb 17, 2025):
This should be resolved in dev!
@rgaricano commented on GitHub (Feb 17, 2025):
in ver 0.5.12 i can't edit name, only content & work properly,
but i found other issue: when click over name (linked to https://xxxxx/api/v1/files/26aecb16-b733-4d88-9a9f-9bbcd57f7d89/content ) I have not content, only an {"detail":"[ERROR: Error getting file content]"}