[GH-ISSUE #18201] issue: Memory leak and database insertion failure when using Google PSE web search with PostgreSQL/pgvector #57195

Closed
opened 2026-05-05 20:44:28 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @fgonzalez-glmc on GitHub (Oct 9, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/18201

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

v0.6.33

Ollama Version (if applicable)

No response

Operating System

Debian 12

Browser (if applicable)

No response

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 provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

When performing web searches using Google PSE (Programmable Search Engine), the system should:

  1. Successfully retrieve and process web search results
  2. Store the results in the PostgreSQL vector database without errors
  3. Maintain stable memory usage across multiple search requests
  4. Allow users to reference the search results in their conversations

Actual Behavior

When using Google PSE web search with PostgreSQL/pgvector backend:

  1. Web search requests work successfully - users receive search results in their chat and can interact with them normally
  2. However, backend logs show database insertion failures due to NUL characters in scraped content
  3. The search results fail to be stored as vector embeddings in the PostgreSQL database
  4. Each web search request causes a persistent 300MB memory increase in server RAM usage
  5. After multiple web search requests, our server RAM fills up completely, crashes the server, and requires a manual reboot to restore functionality

Steps to Reproduce

Prerequisites:

  • Open WebUI v0.6.33 running in Docker
  • PostgreSQL database with pgvector extension enabled
  • Google PSE API configured with valid API key and Search Engine ID

Reproduction Steps:

  1. Start Open WebUI with the above configuration
  2. Navigate to a chat interface
  3. Enable web search in the chat settings
  4. Send a message that triggers a web search (e.g., "Search for recent news about AI")
  5. Observe the server logs for the database error
  6. Monitor server memory usage - note ~300MB increase
  7. Repeat steps 4-6 multiple times
  8. Observe cumulative memory increase and eventual server instability

Logs & Screenshots

Web Search Config :

Image

Logs :

025-10-09 16:59:46.292 | INFO | open_webui.routers.retrieval:save_docs_to_vector_db:1414 - embeddings generated 1271 for 1271 items
2025-10-09 16:59:46.305 | INFO | open_webui.routers.retrieval:save_docs_to_vector_db:1426 - adding to collection web-search-42d22ef408b24d2e68ba48ae3a2e436324de9be90cec7c985860
2025-10-09 16:59:48.368 | ERROR | open_webui.retrieval.vector.dbs.pgvector:insert:278 - Error during insert: A string literal cannot contain NUL (0x00) characters.
Traceback (most recent call last):
File "/usr/local/lib/python3.11/threading.py", line 1002, in _bootstrap
self._bootstrap_inner()
│ └ <function Thread._bootstrap_inner at 0xf8232b5349a0>
└ <WorkerThread(AnyIO worker thread, started 272828079272352)>
File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
self.run()
│ └ <function WorkerThread.run at 0xf82303091580>
└ <WorkerThread(AnyIO worker thread, started 272828079272352)>
File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 976, in run
result = context.run(func, *args)
│ │ │ └ ()
│ │ └ functools.partial(<function save_docs_to_vector_db at 0xf823052a7ce0>, <starlette.requests.Request object at 0xf82300145910>,...
│ └ <method 'run' of '_contextvars.Context' objects>
└ <_contextvars.Context object at 0xf822bffbcb00>
File "/app/backend/open_webui/routers/retrieval.py", line 1427, in save_docs_to_vector_db
VECTOR_DB_CLIENT.insert(
│ └ <function PgvectorClient.insert at 0xf82309d03f60>
└ <open_webui.retrieval.vector.dbs.pgvector.PgvectorClient object at 0xf82309e80490>

File "/app/backend/open_webui/retrieval/vector/dbs/pgvector.py", line 271, in insert
self.session.bulk_save_objects(new_items)
│ │ │ └ [<open_webui.retrieval.vector.dbs.pgvector.DocumentChunk object at 0xf822bd5b7550>, <open_webui.retrieval.vector.dbs.pgvector...
│ │ └ <function scoped_session.bulk_save_objects at 0xf8230b288a40>
│ └ <sqlalchemy.orm.scoping.scoped_session object at 0xf82309edfd90>
└ <open_webui.retrieval.vector.dbs.pgvector.PgvectorClient object at 0xf82309e80490>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/scoping.py", line 1359, in bulk_save_objects
return self._proxied.bulk_save_objects(
│ └ <property object at 0xf8230b319f30>
└ <sqlalchemy.orm.scoping.scoped_session object at 0xf82309edfd90>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4586, in bulk_save_objects
self._bulk_save_mappings(
│ └ <function Session._bulk_save_mappings at 0xf8230b325bc0>
└ <sqlalchemy.orm.session.Session object at 0xf822b1067450>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4763, in _bulk_save_mappings
with util.safe_reraise():
│ └ <class 'sqlalchemy.util.langhelpers.safe_reraise'>
└ <module 'sqlalchemy.util' from '/usr/local/lib/python3.11/site-packages/sqlalchemy/util/__init__.py'>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py", line 146, in exit
raise exc_value.with_traceback(exc_tb)
│ │ └ <traceback object at 0xf822bccc3dc0>
│ └ <method 'with_traceback' of 'BaseException' objects>
└ ValueError('A string literal cannot contain NUL (0x00) characters.')
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4752, in _bulk_save_mappings
bulk_persistence._bulk_insert(
│ └ <function _bulk_insert at 0xf8230b3cd580>
└ <module 'sqlalchemy.orm.bulk_persistence' from '/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/bulk_persistence.py'>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/bulk_persistence.py", line 222, in _bulk_insert
result = persistence._emit_insert_statements(
│ └ <function _emit_insert_statements at 0xf8230b3ccf40>
└ <module 'sqlalchemy.orm.persistence' from '/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/persistence.py'>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/persistence.py", line 1048, in _emit_insert_statements
result = connection.execute(
│ └ <function Connection.execute at 0xf8232870ed40>
└ <sqlalchemy.engine.base.Connection object at 0xf822bcefc6d0>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1416, in execute
return meth(
└ <bound method ClauseElement._execute_on_connection of <sqlalchemy.sql.dml.Insert object at 0xf82303589550>>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 516, in _execute_on_connection
return connection._execute_clauseelement(
│ └ <function Connection._execute_clauseelement at 0xf8232870f060>
└ <sqlalchemy.engine.base.Connection object at 0xf822bcefc6d0>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1638, in _execute_clauseelement
ret = self._execute_context(
│ └ <function Connection._execute_context at 0xf8232870f240>
└ <sqlalchemy.engine.base.Connection object at 0xf822bcefc6d0>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1841, in _execute_context
return self._exec_insertmany_context(dialect, context)
│ │ │ └ <sqlalchemy.dialects.postgresql.psycopg2.PGExecutionContext_psycopg2 object at 0xf822bcd68510>
│ │ └ <sqlalchemy.dialects.postgresql.psycopg2.PGDialect_psycopg2 object at 0xf82309edf990>
│ └ <function Connection._exec_insertmany_context at 0xf8232870f380>
└ <sqlalchemy.engine.base.Connection object at 0xf822bcefc6d0>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2123, in _exec_insertmany_context
self._handle_dbapi_exception(
│ └ <function Connection._handle_dbapi_exception at 0xf8232870f560>
└ <sqlalchemy.engine.base.Connection object at 0xf822bcefc6d0>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception
raise exc_info[1].with_traceback(exc_info[2])
│ └ (<class 'ValueError'>, ValueError('A string literal cannot contain NUL (0x00) characters.'), <traceback object at 0xf822bccc3...
└ (<class 'ValueError'>, ValueError('A string literal cannot contain NUL (0x00) characters.'), <traceback object at 0xf822bccc3...
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2115, in _exec_insertmany_context
dialect.do_execute(
│ └ <function DefaultDialect.do_execute at 0xf8232884b1a0>
└ <sqlalchemy.dialects.postgresql.psycopg2.PGDialect_psycopg2 object at 0xf82309edf990>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 942, in do_execute
cursor.execute(statement, parameters)
│ │ │ └ {'id__0': '51ed0b9c-1f0c-47d2-bddc-046fc01d6991', 'text__0': "You've been blocked by network security.To continue, log in to ...
│ │ └ 'INSERT INTO document_chunk (id, vector, collection_name, text, vmetadata) VALUES (%(id__0)s, %(vector__0)s, %(collection_nam...
│ └ <method 'execute' of 'psycopg2.extensions.cursor' objects>
└ <cursor object at 0xf823001126b0; closed: -1>
ValueError: A string literal cannot contain NUL (0x00) characters.
2025-10-09 16:59:48.570 | ERROR | open_webui.routers.retrieval:save_docs_to_vector_db:1435 - A string literal cannot contain NUL (0x00) characters.
Traceback (most recent call last):
File "/usr/local/lib/python3.11/threading.py", line 1002, in _bootstrap
self._bootstrap_inner()
│ └ <function Thread._bootstrap_inner at 0xf8232b5349a0>
└ <WorkerThread(AnyIO worker thread, started 272828079272352)>
File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
self.run()
│ └ <function WorkerThread.run at 0xf82303091580>
└ <WorkerThread(AnyIO worker thread, started 272828079272352)>
File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 976, in run
result = context.run(func, *args)
│ │ │ └ ()
│ │ └ functools.partial(<function save_docs_to_vector_db at 0xf823052a7ce0>, <starlette.requests.Request object at 0xf82300145910>,...
│ └ <method 'run' of '_contextvars.Context' objects>
└ <_contextvars.Context object at 0xf822bffbcb00>
File "/app/backend/open_webui/routers/retrieval.py", line 1427, in save_docs_to_vector_db
VECTOR_DB_CLIENT.insert(
│ └ <function PgvectorClient.insert at 0xf82309d03f60>
└ <open_webui.retrieval.vector.dbs.pgvector.PgvectorClient object at 0xf82309e80490>
File "/app/backend/open_webui/retrieval/vector/dbs/pgvector.py", line 271, in insert
self.session.bulk_save_objects(new_items)
│ │ │ └ [<open_webui.retrieval.vector.dbs.pgvector.DocumentChunk object at 0xf822bd5b7550>, <open_webui.retrieval.vector.dbs.pgvector...
│ │ └ <function scoped_session.bulk_save_objects at 0xf8230b288a40>
│ └ <sqlalchemy.orm.scoping.scoped_session object at 0xf82309edfd90>
└ <open_webui.retrieval.vector.dbs.pgvector.PgvectorClient object at 0xf82309e80490>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/scoping.py", line 1359, in bulk_save_objects
return self._proxied.bulk_save_objects(
│ └ <property object at 0xf8230b319f30>
└ <sqlalchemy.orm.scoping.scoped_session object at 0xf82309edfd90>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4586, in bulk_save_objects
self._bulk_save_mappings(
│ └ <function Session._bulk_save_mappings at 0xf8230b325bc0>
└ <sqlalchemy.orm.session.Session object at 0xf822b1067450>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4763, in _bulk_save_mappings
with util.safe_reraise():
│ └ <class 'sqlalchemy.util.langhelpers.safe_reraise'>
└ <module 'sqlalchemy.util' from '/usr/local/lib/python3.11/site-packages/sqlalchemy/util/__init__.py'>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py", line 146, in exit
raise exc_value.with_traceback(exc_tb)
│ │ └ <traceback object at 0xf822bccc3dc0>
│ └ <method 'with_traceback' of 'BaseException' objects>
└ ValueError('A string literal cannot contain NUL (0x00) characters.')
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4752, in _bulk_save_mappings
bulk_persistence._bulk_insert(
│ └ <function _bulk_insert at 0xf8230b3cd580>
└ <module 'sqlalchemy.orm.bulk_persistence' from '/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/bulk_persistence.py'>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/bulk_persistence.py", line 222, in _bulk_insert
result = persistence._emit_insert_statements(
│ └ <function _emit_insert_statements at 0xf8230b3ccf40>
└ <module 'sqlalchemy.orm.persistence' from '/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/persistence.py'>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/persistence.py", line 1048, in _emit_insert_statements
result = connection.execute(
│ └ <function Connection.execute at 0xf8232870ed40>
└ <sqlalchemy.engine.base.Connection object at 0xf822bcefc6d0>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1416, in execute
return meth(
└ <bound method ClauseElement._execute_on_connection of <sqlalchemy.sql.dml.Insert object at 0xf82303589550>>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 516, in _execute_on_connection
return connection._execute_clauseelement(
│ └ <function Connection._execute_clauseelement at 0xf8232870f060>
└ <sqlalchemy.engine.base.Connection object at 0xf822bcefc6d0>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1638, in _execute_clauseelement
ret = self._execute_context(
│ └ <function Connection._execute_context at 0xf8232870f240>
└ <sqlalchemy.engine.base.Connection object at 0xf822bcefc6d0>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1841, in _execute_context
return self._exec_insertmany_context(dialect, context)
│ │ │ └ <sqlalchemy.dialects.postgresql.psycopg2.PGExecutionContext_psycopg2 object at 0xf822bcd68510>
│ │ └ <sqlalchemy.dialects.postgresql.psycopg2.PGDialect_psycopg2 object at 0xf82309edf990>
│ └ <function Connection._exec_insertmany_context at 0xf8232870f380>
└ <sqlalchemy.engine.base.Connection object at 0xf822bcefc6d0>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2123, in _exec_insertmany_context
self._handle_dbapi_exception(
│ └ <function Connection._handle_dbapi_exception at 0xf8232870f560>
└ <sqlalchemy.engine.base.Connection object at 0xf822bcefc6d0>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception
raise exc_info[1].with_traceback(exc_info[2])
│ └ (<class 'ValueError'>, ValueError('A string literal cannot contain NUL (0x00) characters.'), <traceback object at 0xf822bccc3...
└ (<class 'ValueError'>, ValueError('A string literal cannot contain NUL (0x00) characters.'), <traceback object at 0xf822bccc3...
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2115, in _exec_insertmany_context
dialect.do_execute(
│ └ <function DefaultDialect.do_execute at 0xf8232884b1a0>
└ <sqlalchemy.dialects.postgresql.psycopg2.PGDialect_psycopg2 object at 0xf82309edf990>
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 942, in do_execute
cursor.execute(statement, parameters)
│ │ │ └ {'id__0': '51ed0b9c-1f0c-47d2-bddc-046fc01d6991', 'text__0': "You've been blocked by network security.To continue, log in to ...
│ │ └ 'INSERT INTO document_chunk (id, vector, collection_name, text, vmetadata) VALUES (%(id__0)s, %(vector__0)s, %(collection_nam...
│ └ <method 'execute' of 'psycopg2.extensions.cursor' objects>
└ <cursor object at 0xf823001126b0; closed: -1>

Additional Information

No response

Originally created by @fgonzalez-glmc on GitHub (Oct 9, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/18201 ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version v0.6.33 ### Ollama Version (if applicable) _No response_ ### Operating System Debian 12 ### Browser (if applicable) _No response_ ### 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 **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior When performing web searches using Google PSE (Programmable Search Engine), the system should: 1. Successfully retrieve and process web search results 2. Store the results in the PostgreSQL vector database without errors 3. Maintain stable memory usage across multiple search requests 4. Allow users to reference the search results in their conversations ### Actual Behavior When using Google PSE web search with PostgreSQL/pgvector backend: 1. Web search requests work successfully - users receive search results in their chat and can interact with them normally 2. However, backend logs show database insertion failures due to NUL characters in scraped content 3. The search results fail to be stored as vector embeddings in the PostgreSQL database 4. Each web search request causes a persistent 300MB memory increase in server RAM usage 5. After multiple web search requests, our server RAM fills up completely, crashes the server, and requires a manual reboot to restore functionality ### Steps to Reproduce Prerequisites: - Open WebUI v0.6.33 running in Docker - PostgreSQL database with pgvector extension enabled - Google PSE API configured with valid API key and Search Engine ID Reproduction Steps: 1. Start Open WebUI with the above configuration 2. Navigate to a chat interface 3. Enable web search in the chat settings 4. Send a message that triggers a web search (e.g., "Search for recent news about AI") 5. Observe the server logs for the database error 6. Monitor server memory usage - note ~300MB increase 7. Repeat steps 4-6 multiple times 8. Observe cumulative memory increase and eventual server instability ### Logs & Screenshots Web Search Config : <img width="2834" height="1520" alt="Image" src="https://github.com/user-attachments/assets/60c658dd-f711-419e-a1ff-ddd2a9947103" /> Logs : ```bash 025-10-09 16:59:46.292 | INFO | open_webui.routers.retrieval:save_docs_to_vector_db:1414 - embeddings generated 1271 for 1271 items 2025-10-09 16:59:46.305 | INFO | open_webui.routers.retrieval:save_docs_to_vector_db:1426 - adding to collection web-search-42d22ef408b24d2e68ba48ae3a2e436324de9be90cec7c985860 2025-10-09 16:59:48.368 | ERROR | open_webui.retrieval.vector.dbs.pgvector:insert:278 - Error during insert: A string literal cannot contain NUL (0x00) characters. Traceback (most recent call last): File "/usr/local/lib/python3.11/threading.py", line 1002, in _bootstrap self._bootstrap_inner() │ └ <function Thread._bootstrap_inner at 0xf8232b5349a0> └ <WorkerThread(AnyIO worker thread, started 272828079272352)> File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner self.run() │ └ <function WorkerThread.run at 0xf82303091580> └ <WorkerThread(AnyIO worker thread, started 272828079272352)> File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 976, in run result = context.run(func, *args) │ │ │ └ () │ │ └ functools.partial(<function save_docs_to_vector_db at 0xf823052a7ce0>, <starlette.requests.Request object at 0xf82300145910>,... │ └ <method 'run' of '_contextvars.Context' objects> └ <_contextvars.Context object at 0xf822bffbcb00> File "/app/backend/open_webui/routers/retrieval.py", line 1427, in save_docs_to_vector_db VECTOR_DB_CLIENT.insert( │ └ <function PgvectorClient.insert at 0xf82309d03f60> └ <open_webui.retrieval.vector.dbs.pgvector.PgvectorClient object at 0xf82309e80490> File "/app/backend/open_webui/retrieval/vector/dbs/pgvector.py", line 271, in insert self.session.bulk_save_objects(new_items) │ │ │ └ [<open_webui.retrieval.vector.dbs.pgvector.DocumentChunk object at 0xf822bd5b7550>, <open_webui.retrieval.vector.dbs.pgvector... │ │ └ <function scoped_session.bulk_save_objects at 0xf8230b288a40> │ └ <sqlalchemy.orm.scoping.scoped_session object at 0xf82309edfd90> └ <open_webui.retrieval.vector.dbs.pgvector.PgvectorClient object at 0xf82309e80490> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/scoping.py", line 1359, in bulk_save_objects return self._proxied.bulk_save_objects( │ └ <property object at 0xf8230b319f30> └ <sqlalchemy.orm.scoping.scoped_session object at 0xf82309edfd90> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4586, in bulk_save_objects self._bulk_save_mappings( │ └ <function Session._bulk_save_mappings at 0xf8230b325bc0> └ <sqlalchemy.orm.session.Session object at 0xf822b1067450> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4763, in _bulk_save_mappings with util.safe_reraise(): │ └ <class 'sqlalchemy.util.langhelpers.safe_reraise'> └ <module 'sqlalchemy.util' from '/usr/local/lib/python3.11/site-packages/sqlalchemy/util/__init__.py'> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py", line 146, in exit raise exc_value.with_traceback(exc_tb) │ │ └ <traceback object at 0xf822bccc3dc0> │ └ <method 'with_traceback' of 'BaseException' objects> └ ValueError('A string literal cannot contain NUL (0x00) characters.') File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4752, in _bulk_save_mappings bulk_persistence._bulk_insert( │ └ <function _bulk_insert at 0xf8230b3cd580> └ <module 'sqlalchemy.orm.bulk_persistence' from '/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/bulk_persistence.py'> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/bulk_persistence.py", line 222, in _bulk_insert result = persistence._emit_insert_statements( │ └ <function _emit_insert_statements at 0xf8230b3ccf40> └ <module 'sqlalchemy.orm.persistence' from '/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/persistence.py'> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/persistence.py", line 1048, in _emit_insert_statements result = connection.execute( │ └ <function Connection.execute at 0xf8232870ed40> └ <sqlalchemy.engine.base.Connection object at 0xf822bcefc6d0> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1416, in execute return meth( └ <bound method ClauseElement._execute_on_connection of <sqlalchemy.sql.dml.Insert object at 0xf82303589550>> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 516, in _execute_on_connection return connection._execute_clauseelement( │ └ <function Connection._execute_clauseelement at 0xf8232870f060> └ <sqlalchemy.engine.base.Connection object at 0xf822bcefc6d0> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1638, in _execute_clauseelement ret = self._execute_context( │ └ <function Connection._execute_context at 0xf8232870f240> └ <sqlalchemy.engine.base.Connection object at 0xf822bcefc6d0> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1841, in _execute_context return self._exec_insertmany_context(dialect, context) │ │ │ └ <sqlalchemy.dialects.postgresql.psycopg2.PGExecutionContext_psycopg2 object at 0xf822bcd68510> │ │ └ <sqlalchemy.dialects.postgresql.psycopg2.PGDialect_psycopg2 object at 0xf82309edf990> │ └ <function Connection._exec_insertmany_context at 0xf8232870f380> └ <sqlalchemy.engine.base.Connection object at 0xf822bcefc6d0> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2123, in _exec_insertmany_context self._handle_dbapi_exception( │ └ <function Connection._handle_dbapi_exception at 0xf8232870f560> └ <sqlalchemy.engine.base.Connection object at 0xf822bcefc6d0> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception raise exc_info[1].with_traceback(exc_info[2]) │ └ (<class 'ValueError'>, ValueError('A string literal cannot contain NUL (0x00) characters.'), <traceback object at 0xf822bccc3... └ (<class 'ValueError'>, ValueError('A string literal cannot contain NUL (0x00) characters.'), <traceback object at 0xf822bccc3... File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2115, in _exec_insertmany_context dialect.do_execute( │ └ <function DefaultDialect.do_execute at 0xf8232884b1a0> └ <sqlalchemy.dialects.postgresql.psycopg2.PGDialect_psycopg2 object at 0xf82309edf990> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 942, in do_execute cursor.execute(statement, parameters) │ │ │ └ {'id__0': '51ed0b9c-1f0c-47d2-bddc-046fc01d6991', 'text__0': "You've been blocked by network security.To continue, log in to ... │ │ └ 'INSERT INTO document_chunk (id, vector, collection_name, text, vmetadata) VALUES (%(id__0)s, %(vector__0)s, %(collection_nam... │ └ <method 'execute' of 'psycopg2.extensions.cursor' objects> └ <cursor object at 0xf823001126b0; closed: -1> ValueError: A string literal cannot contain NUL (0x00) characters. 2025-10-09 16:59:48.570 | ERROR | open_webui.routers.retrieval:save_docs_to_vector_db:1435 - A string literal cannot contain NUL (0x00) characters. Traceback (most recent call last): File "/usr/local/lib/python3.11/threading.py", line 1002, in _bootstrap self._bootstrap_inner() │ └ <function Thread._bootstrap_inner at 0xf8232b5349a0> └ <WorkerThread(AnyIO worker thread, started 272828079272352)> File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner self.run() │ └ <function WorkerThread.run at 0xf82303091580> └ <WorkerThread(AnyIO worker thread, started 272828079272352)> File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 976, in run result = context.run(func, *args) │ │ │ └ () │ │ └ functools.partial(<function save_docs_to_vector_db at 0xf823052a7ce0>, <starlette.requests.Request object at 0xf82300145910>,... │ └ <method 'run' of '_contextvars.Context' objects> └ <_contextvars.Context object at 0xf822bffbcb00> File "/app/backend/open_webui/routers/retrieval.py", line 1427, in save_docs_to_vector_db VECTOR_DB_CLIENT.insert( │ └ <function PgvectorClient.insert at 0xf82309d03f60> └ <open_webui.retrieval.vector.dbs.pgvector.PgvectorClient object at 0xf82309e80490> File "/app/backend/open_webui/retrieval/vector/dbs/pgvector.py", line 271, in insert self.session.bulk_save_objects(new_items) │ │ │ └ [<open_webui.retrieval.vector.dbs.pgvector.DocumentChunk object at 0xf822bd5b7550>, <open_webui.retrieval.vector.dbs.pgvector... │ │ └ <function scoped_session.bulk_save_objects at 0xf8230b288a40> │ └ <sqlalchemy.orm.scoping.scoped_session object at 0xf82309edfd90> └ <open_webui.retrieval.vector.dbs.pgvector.PgvectorClient object at 0xf82309e80490> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/scoping.py", line 1359, in bulk_save_objects return self._proxied.bulk_save_objects( │ └ <property object at 0xf8230b319f30> └ <sqlalchemy.orm.scoping.scoped_session object at 0xf82309edfd90> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4586, in bulk_save_objects self._bulk_save_mappings( │ └ <function Session._bulk_save_mappings at 0xf8230b325bc0> └ <sqlalchemy.orm.session.Session object at 0xf822b1067450> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4763, in _bulk_save_mappings with util.safe_reraise(): │ └ <class 'sqlalchemy.util.langhelpers.safe_reraise'> └ <module 'sqlalchemy.util' from '/usr/local/lib/python3.11/site-packages/sqlalchemy/util/__init__.py'> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py", line 146, in exit raise exc_value.with_traceback(exc_tb) │ │ └ <traceback object at 0xf822bccc3dc0> │ └ <method 'with_traceback' of 'BaseException' objects> └ ValueError('A string literal cannot contain NUL (0x00) characters.') File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4752, in _bulk_save_mappings bulk_persistence._bulk_insert( │ └ <function _bulk_insert at 0xf8230b3cd580> └ <module 'sqlalchemy.orm.bulk_persistence' from '/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/bulk_persistence.py'> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/bulk_persistence.py", line 222, in _bulk_insert result = persistence._emit_insert_statements( │ └ <function _emit_insert_statements at 0xf8230b3ccf40> └ <module 'sqlalchemy.orm.persistence' from '/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/persistence.py'> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/persistence.py", line 1048, in _emit_insert_statements result = connection.execute( │ └ <function Connection.execute at 0xf8232870ed40> └ <sqlalchemy.engine.base.Connection object at 0xf822bcefc6d0> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1416, in execute return meth( └ <bound method ClauseElement._execute_on_connection of <sqlalchemy.sql.dml.Insert object at 0xf82303589550>> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 516, in _execute_on_connection return connection._execute_clauseelement( │ └ <function Connection._execute_clauseelement at 0xf8232870f060> └ <sqlalchemy.engine.base.Connection object at 0xf822bcefc6d0> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1638, in _execute_clauseelement ret = self._execute_context( │ └ <function Connection._execute_context at 0xf8232870f240> └ <sqlalchemy.engine.base.Connection object at 0xf822bcefc6d0> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1841, in _execute_context return self._exec_insertmany_context(dialect, context) │ │ │ └ <sqlalchemy.dialects.postgresql.psycopg2.PGExecutionContext_psycopg2 object at 0xf822bcd68510> │ │ └ <sqlalchemy.dialects.postgresql.psycopg2.PGDialect_psycopg2 object at 0xf82309edf990> │ └ <function Connection._exec_insertmany_context at 0xf8232870f380> └ <sqlalchemy.engine.base.Connection object at 0xf822bcefc6d0> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2123, in _exec_insertmany_context self._handle_dbapi_exception( │ └ <function Connection._handle_dbapi_exception at 0xf8232870f560> └ <sqlalchemy.engine.base.Connection object at 0xf822bcefc6d0> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception raise exc_info[1].with_traceback(exc_info[2]) │ └ (<class 'ValueError'>, ValueError('A string literal cannot contain NUL (0x00) characters.'), <traceback object at 0xf822bccc3... └ (<class 'ValueError'>, ValueError('A string literal cannot contain NUL (0x00) characters.'), <traceback object at 0xf822bccc3... File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2115, in _exec_insertmany_context dialect.do_execute( │ └ <function DefaultDialect.do_execute at 0xf8232884b1a0> └ <sqlalchemy.dialects.postgresql.psycopg2.PGDialect_psycopg2 object at 0xf82309edf990> File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 942, in do_execute cursor.execute(statement, parameters) │ │ │ └ {'id__0': '51ed0b9c-1f0c-47d2-bddc-046fc01d6991', 'text__0': "You've been blocked by network security.To continue, log in to ... │ │ └ 'INSERT INTO document_chunk (id, vector, collection_name, text, vmetadata) VALUES (%(id__0)s, %(vector__0)s, %(collection_nam... │ └ <method 'execute' of 'psycopg2.extensions.cursor' objects> └ <cursor object at 0xf823001126b0; closed: -1> ``` ### Additional Information _No response_
GiteaMirror added the bug label 2026-05-05 20:44:28 -05:00
Author
Owner

@Classic298 commented on GitHub (Oct 9, 2025):

Related #15616

<!-- gh-comment-id:3387584042 --> @Classic298 commented on GitHub (Oct 9, 2025): Related #15616
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#57195