mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[GH-ISSUE #19867] issue:Memory Leak in Attach Web Page Function Due to Null Bytes in Postgres Embeddings #57688
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 @fgonzalez-glmc on GitHub (Dec 10, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/19867
Check Existing Issues
Installation Method
Docker
Open WebUI Version
0.60.41
Ollama Version (if applicable)
No response
Operating System
Debian
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
The attach web pages functions works correctly and does not cause a memory leak. null bytes should be correctly managed.
Actual Behavior
The "attach web page" function in OpenWebUI creates a memory leak when attaching some web pages, not all of them. When you attach a web page, it tries to convert and embed the results, but sometimes the results create null bytes in the embedding, so the system Postgres doesn't handle it well and it creates a memory leak. The RAM peaks up, like by 100 MB for example.
Steps to Reproduce
Use the OpenWebUI website for environment variables as a test case : https://docs.openwebui.com/getting-started/env-configuration/
Actual Behavior
ValueErroris raised:A string literal cannot contain NUL (0x00) characters.Related Issues
This is similar to an issue that was fixed recently with native web search in OpenWebUI. Some web search results contained null bytes in the embedding and Postgres didn't like it.
Steps to Reproduce
Logs & Screenshots
Error Logs
Additional Information
No response
@owui-terminator[bot] commented on GitHub (Dec 10, 2025):
🔍 Similar Issues Found
I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:
#19723 issue: "Async Embedding Processing" does not seem to have an effect
by Elettrotecnica • Dec 03, 2025 •
bug#19264 issue: Uploaded file hash remains in database even when OCR fails, causing false duplicate detection
by flefevre • Nov 18, 2025 •
bug#18201 issue: Memory leak and database insertion failure when using Google PSE web search with PostgreSQL/pgvector
by fgonzalez-glmc • Oct 09, 2025 •
bug#19562 [Bug] Attach Webpage fails with metadata type error in v0.6.37+
by naruto7g • Nov 28, 2025 •
bug#19474 issue: Embeddings using API not working
by curious-broccoli • Nov 25, 2025 •
bugShow 5 more related issues
#16873 issue: Embedding fails with “The content provided is empty” using Open-WebUI API
by ka-admin • Aug 24, 2025 •
bug#19421 issue: save embedding to vector DB freezes the whole application
by FBH93 • Nov 24, 2025 •
bug#19281 issue: RAG Template applied with "Bypass Embedding and Retrieval" enabled
by lucyknada • Nov 19, 2025 •
bug#16854 issue: Fail to Embed HTML files
by tthung282 • Aug 23, 2025 •
bug#17720 issue: With "bypass embedding and retrieval" attached files are still sent in a RAG system prompt not with the user message
by mramendi • Sep 24, 2025 •
bug💡 Tips:
This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
@le-patenteux commented on GitHub (Dec 10, 2025):
It is not a duplicate, as this issue was present in the search functions and was fixed there.
But is now present in another function (Attach URL)
I am not technical enough to know how this is all managed behind the scene, but the NULL byte issue should be handled globally as to avoid that new features have the same bug.
Have a nice day amazing devs and community.
@Classic298 commented on GitHub (Dec 21, 2025):
@le-patenteux ooking at the issue more carefully:
The "memory leak" claim is a misdiagnosis. The actual bug is a failed database insertion due to null bytes (\u0000) causing PostgreSQL to reject the data with:
ValueError: A string literal cannot contain NUL (0x00) characters.
@Classic298 commented on GitHub (Dec 21, 2025):
fixed in dev
@le-patenteux commented on GitHub (Dec 21, 2025):
I can reproduce the memory leak invariably, it was doing the same thing back when web-search had the null byte issue.
When Open-Webui tries to insert Null value in a string literal in the PostgreSQL DB, the error occurs, then the RAM useage increases by about 100MB, invariably.
I think that the null byte thing needs to be fixed at a lower level, in the INSERT funtion of open-webui, for any other scenario. (I have the knowlege to diagnose the issue, but not to fix it... But I can ensure OWUI had the same memory leak issue with the search function a month ago before it got fixed.
See #17775, #17723, #18207
@Classic298 commented on GitHub (Dec 21, 2025):
@le-patenteux this is not really a memory leak
either way, the web add was fixed, pls point us to other areas where issues arise and we'll fix it there
for now pls test dev and let me know if this specific issue is fixed (it should)