mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #23040] [CLOSED] fix: remove null bytes from metadata to prevent PostgreSQL JSONB errors #65845
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/23040
Author: @yang1002378395-cmyk
Created: 3/25/2026
Status: ❌ Closed
Base:
dev← Head:fix-pdf-null-byte-v2📝 Commits (1)
7972e61fix: remove null bytes from metadata to prevent PostgreSQL JSONB errors📊 Changes
1 file changed (+25 additions, -5 deletions)
View changed files
📝
backend/open_webui/retrieval/vector/utils.py(+25 -5)📄 Description
Summary
Fixes #22992
Removes null bytes and invalid control characters from metadata strings before storing in vector database. This prevents PostgreSQL JSONB errors when processing PDFs with malformed metadata.
Changes
_clean_string_value()function to remove null bytes and invalid control characters_clean_value()for recursive cleaning of nested structures (dict, list)filter_metadata()andprocess_metadata()to clean all string valuesTesting
All unit tests passed.
Issue Reference
Closes #22992
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.