[GH-ISSUE #15535] issue: Plain text file upload to knowledge fails with 400: 'NoneType' object has no attribute 'encode' #17593

Closed
opened 2026-04-19 23:23:40 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @GanizaniSitara on GitHub (Jul 4, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/15535

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Pip Install

Open WebUI Version

0.6.15

Ollama Version (if applicable)

0.9.5

Operating System

Windows 10

Browser (if applicable)

Firefox 140.0.2

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

File uploads

Actual Behavior

Failure with 400 error

Steps to Reproduce

Just upgraded to 0.6.15, worked before, no other significant changes

Logs & Screenshots

File "C:\Anaconda3\envs\ollama311\Lib\threading.py", line 1002, in _bootstrap
self._bootstrap_inner()
│ └ <function Thread._bootstrap_inner at 0x0000020387976A20>
└ <WorkerThread(AnyIO worker thread, started 23704)>
File "C:\Anaconda3\envs\ollama311\Lib\threading.py", line 1045, in _bootstrap_inner
self.run()
│ └ <function WorkerThread.run at 0x00000203BDE58FE0>
└ <WorkerThread(AnyIO worker thread, started 23704)>
File "C:\Anaconda3\envs\ollama311\Lib\site-packages\anyio_backends_asyncio.py", line 967, in run
result = context.run(func, *args)
│ │ │ └ ()
│ │ └ functools.partial(<function add_file_to_knowledge_by_id at 0x00000203BB167380>, user=UserModel(id='e41d640a-9fdd-43cb-931a-e7...
│ └ <method 'run' of '_contextvars.Context' objects>
└ <_contextvars.Context object at 0x00000203BDE21380>
File "C:\Anaconda3\envs\ollama311\Lib\site-packages\open_webui\routers\knowledge.py", line 372, in add_file_to_knowledge_by_id
process_file(
└ <function process_file at 0x00000203BB065580>

File "C:\Anaconda3\envs\ollama311\Lib\site-packages\open_webui\routers\retrieval.py", line 1447, in process_file
raise e
└ AttributeError("'NoneType' object has no attribute 'encode'")
File "C:\Anaconda3\envs\ollama311\Lib\site-packages\open_webui\routers\retrieval.py", line 1419, in process_file
result = save_docs_to_vector_db(
└ <function save_docs_to_vector_db at 0x00000203BB01EE80>
File "C:\Anaconda3\envs\ollama311\Lib\site-packages\open_webui\routers\retrieval.py", line 1263, in save_docs_to_vector_db
raise e
File "C:\Anaconda3\envs\ollama311\Lib\site-packages\open_webui\routers\retrieval.py", line 1239, in save_docs_to_vector_db
embeddings = embedding_function(
└ <function get_embedding_function.. at 0x00000203BE3528E0>
File "C:\Anaconda3\envs\ollama311\Lib\site-packages\open_webui\retrieval\utils.py", line 407, in
return lambda query, prefix=None, user=None: embedding_function.encode(
│ └ None

Additional Information

No response

Originally created by @GanizaniSitara on GitHub (Jul 4, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/15535 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Pip Install ### Open WebUI Version 0.6.15 ### Ollama Version (if applicable) 0.9.5 ### Operating System Windows 10 ### Browser (if applicable) Firefox 140.0.2 ### 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 File uploads ### Actual Behavior Failure with 400 error ### Steps to Reproduce Just upgraded to 0.6.15, worked before, no other significant changes ### Logs & Screenshots File "C:\Anaconda3\envs\ollama311\Lib\threading.py", line 1002, in _bootstrap self._bootstrap_inner() │ └ <function Thread._bootstrap_inner at 0x0000020387976A20> └ <WorkerThread(AnyIO worker thread, started 23704)> File "C:\Anaconda3\envs\ollama311\Lib\threading.py", line 1045, in _bootstrap_inner self.run() │ └ <function WorkerThread.run at 0x00000203BDE58FE0> └ <WorkerThread(AnyIO worker thread, started 23704)> File "C:\Anaconda3\envs\ollama311\Lib\site-packages\anyio\_backends\_asyncio.py", line 967, in run result = context.run(func, *args) │ │ │ └ () │ │ └ functools.partial(<function add_file_to_knowledge_by_id at 0x00000203BB167380>, user=UserModel(id='e41d640a-9fdd-43cb-931a-e7... │ └ <method 'run' of '_contextvars.Context' objects> └ <_contextvars.Context object at 0x00000203BDE21380> File "C:\Anaconda3\envs\ollama311\Lib\site-packages\open_webui\routers\knowledge.py", line 372, in add_file_to_knowledge_by_id process_file( └ <function process_file at 0x00000203BB065580> > File "C:\Anaconda3\envs\ollama311\Lib\site-packages\open_webui\routers\retrieval.py", line 1447, in process_file raise e └ AttributeError("'NoneType' object has no attribute 'encode'") File "C:\Anaconda3\envs\ollama311\Lib\site-packages\open_webui\routers\retrieval.py", line 1419, in process_file result = save_docs_to_vector_db( └ <function save_docs_to_vector_db at 0x00000203BB01EE80> File "C:\Anaconda3\envs\ollama311\Lib\site-packages\open_webui\routers\retrieval.py", line 1263, in save_docs_to_vector_db raise e File "C:\Anaconda3\envs\ollama311\Lib\site-packages\open_webui\routers\retrieval.py", line 1239, in save_docs_to_vector_db embeddings = embedding_function( └ <function get_embedding_function.<locals>.<lambda> at 0x00000203BE3528E0> File "C:\Anaconda3\envs\ollama311\Lib\site-packages\open_webui\retrieval\utils.py", line 407, in <lambda> return lambda query, prefix=None, user=None: embedding_function.encode( │ └ None ### Additional Information _No response_
GiteaMirror added the bug label 2026-04-19 23:23:40 -05:00
Author
Owner

@GanizaniSitara commented on GitHub (Jul 5, 2025):

Ok, this was a weird one.

pip install --index-url https://download.pytorch.org/whl/cpu torch==2.3.1 --force-reinstall

Apparently:

Dependency of C:\Anaconda3\envs\ollama311\Lib\site-packages\torch\lib\fbgemm.dll fails (missing libomp140.x86_64.dll).

I don't think there were any changes to the environment, nevertheless this seems to be the reasoning:

Recent Windows builds of PyTorch switched to LLVM OpenMP for parallel inner loops. That improves speed but pulls in a DLL ( libomp140.x86_64.dll ) that Microsoft does not ship in the redistributable, so any environment lacking Visual Studio’s Clang tools—or a conda package that provides the DLL—breaks at import time. The PyTorch team is tracking the issue in [#131662]. A patch bundling the DLL is targeted for 2.4.1.

<!-- gh-comment-id:3040349092 --> @GanizaniSitara commented on GitHub (Jul 5, 2025): Ok, this was a weird one. `pip install --index-url https://download.pytorch.org/whl/cpu torch==2.3.1 --force-reinstall` Apparently: Dependency of C:\Anaconda3\envs\ollama311\Lib\site-packages\torch\lib\fbgemm.dll fails (missing libomp140.x86_64.dll). I don't think there were any changes to the environment, nevertheless this seems to be the reasoning: Recent Windows builds of PyTorch switched to LLVM OpenMP for parallel inner loops. That improves speed but pulls in a DLL ( libomp140.x86_64.dll ) that Microsoft does not ship in the redistributable, so any environment lacking Visual Studio’s Clang tools—or a conda package that provides the DLL—breaks at import time. The PyTorch team is tracking the issue in [#131662]. A patch bundling the DLL is targeted for 2.4.1.
Author
Owner

@The-LittleTeapot commented on GitHub (Nov 5, 2025):

+1

ERROR    | open_webui.routers.retrieval:save_docs_to_vector_db:1473 - 'NoneType' object has no attribute 'encode' - {"trace_id": "7d25d1c33ca55b30b5e445748bf40e6b", "span_id": "7ae7a06dcd9af75c"}
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 0x7f0d6405c9a0>
    └ <WorkerThread(AnyIO worker thread, started 139692681619136)>
  File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
    self.run()
    │    └ <function WorkerThread.run at 0x7f0cbf50c4a0>
    └ <WorkerThread(AnyIO worker thread, started 139692681619136)>
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 976, in run
    result = context.run(func, *args)
             │       │   │      └ ()
             │       │   └ functools.partial(<function process_uploaded_file at 0x7f0d367c5300>, <starlette.requests.Request object at 0x7f0d328dacd0>, ...
             │       └ <method 'run' of '_contextvars.Context' objects>
             └ <_contextvars.Context object at 0x7f0cbf347e80>

  File "/app/backend/open_webui/routers/files.py", line 117, in process_uploaded_file
    process_file(request, ProcessFileForm(file_id=file_item.id), user=user)
    │            │        │                       │         │         └ UserModel(id='8da6f15f-a644-43e8-8ae7-d2f2bf8a7a16', name='user_name', email='user@email.com', username=Non...
    │            │        │                       │         └ 'ab28a8eb-eacc-4b94-887d-e4f5dd3eb877'
    │            │        │                       └ FileModel(id='ab28a8eb-eacc-4b94-887d-e4f5dd3eb877', user_id='8da6f15f-a644-43e8-8ae7-d2f2bf8a7a16', hash=None, filename='tes...
    │            │        └ <class 'open_webui.routers.retrieval.ProcessFileForm'>
    │            └ <starlette.requests.Request object at 0x7f0d328dacd0>
    └ <function process_file at 0x7f0d126b2de0>

  File "/app/backend/open_webui/routers/retrieval.py", line 1656, in process_file
    result = save_docs_to_vector_db(
             └ <function save_docs_to_vector_db at 0x7f0d126b1f80>

> File "/app/backend/open_webui/routers/retrieval.py", line 1447, in save_docs_to_vector_db
    embeddings = embedding_function(
                 └ <function get_embedding_function.<locals>.<lambda> at 0x7f0cbc20e3e0>

  File "/app/backend/open_webui/retrieval/utils.py", line 468, in <lambda>
    return lambda query, prefix=None, user=None: embedding_function.encode(
                  │                              └ None
                  └ ["today is Wednesday and it's 3:41."]

AttributeError: 'NoneType' object has no attribute 'encode'
2025-11-05 15:45:51.044 | ERROR    | open_webui.routers.retrieval:process_file:1695 - 'NoneType' object has no attribute 'encode' - {"trace_id": "7d25d1c33ca55b30b5e445748bf40e6b", "span_id": "7ae7a06dcd9af75c"}
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 0x7f0d6405c9a0>
    └ <WorkerThread(AnyIO worker thread, started 139692681619136)>
  File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
    self.run()
    │    └ <function WorkerThread.run at 0x7f0cbf50c4a0>
    └ <WorkerThread(AnyIO worker thread, started 139692681619136)>
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 976, in run
    result = context.run(func, *args)
             │       │   │      └ ()
             │       │   └ functools.partial(<function process_uploaded_file at 0x7f0d367c5300>, <starlette.requests.Request object at 0x7f0d328dacd0>, ...
             │       └ <method 'run' of '_contextvars.Context' objects>
             └ <_contextvars.Context object at 0x7f0cbf347e80>

  File "/app/backend/open_webui/routers/files.py", line 117, in process_uploaded_file
    process_file(request, ProcessFileForm(file_id=file_item.id), user=user)
    │            │        │                       │         │         └ UserModel(id='8da6f15f-a644-43e8-8ae7-d2f2bf8a7a16', name='user_name', email=user@email.com', username=Non...
    │            │        │                       │         └ 'ab28a8eb-eacc-4b94-887d-e4f5dd3eb877'
    │            │        │                       └ FileModel(id='ab28a8eb-eacc-4b94-887d-e4f5dd3eb877', user_id='8da6f15f-a644-43e8-8ae7-d2f2bf8a7a16', hash=None, filename='tes...
    │            │        └ <class 'open_webui.routers.retrieval.ProcessFileForm'>
    │            └ <starlette.requests.Request object at 0x7f0d328dacd0>
    └ <function process_file at 0x7f0d126b2de0>

> File "/app/backend/open_webui/routers/retrieval.py", line 1692, in process_file
    raise e
          └ AttributeError("'NoneType' object has no attribute 'encode'")

  File "/app/backend/open_webui/routers/retrieval.py", line 1656, in process_file
    result = save_docs_to_vector_db(
             └ <function save_docs_to_vector_db at 0x7f0d126b1f80>

  File "/app/backend/open_webui/routers/retrieval.py", line 1474, in save_docs_to_vector_db
    raise e

  File "/app/backend/open_webui/routers/retrieval.py", line 1447, in save_docs_to_vector_db
    embeddings = embedding_function(
                 └ <function get_embedding_function.<locals>.<lambda> at 0x7f0cbc20e3e0>

  File "/app/backend/open_webui/retrieval/utils.py", line 468, in <lambda>
    return lambda query, prefix=None, user=None: embedding_function.encode(
                  │                              └ None
                  └ ["today is Wednesday and it's 3:41."]

AttributeError: 'NoneType' object has no attribute 'encode'

<!-- gh-comment-id:3491375253 --> @The-LittleTeapot commented on GitHub (Nov 5, 2025): +1 ``` ERROR | open_webui.routers.retrieval:save_docs_to_vector_db:1473 - 'NoneType' object has no attribute 'encode' - {"trace_id": "7d25d1c33ca55b30b5e445748bf40e6b", "span_id": "7ae7a06dcd9af75c"} 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 0x7f0d6405c9a0> └ <WorkerThread(AnyIO worker thread, started 139692681619136)> File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner self.run() │ └ <function WorkerThread.run at 0x7f0cbf50c4a0> └ <WorkerThread(AnyIO worker thread, started 139692681619136)> File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 976, in run result = context.run(func, *args) │ │ │ └ () │ │ └ functools.partial(<function process_uploaded_file at 0x7f0d367c5300>, <starlette.requests.Request object at 0x7f0d328dacd0>, ... │ └ <method 'run' of '_contextvars.Context' objects> └ <_contextvars.Context object at 0x7f0cbf347e80> File "/app/backend/open_webui/routers/files.py", line 117, in process_uploaded_file process_file(request, ProcessFileForm(file_id=file_item.id), user=user) │ │ │ │ │ └ UserModel(id='8da6f15f-a644-43e8-8ae7-d2f2bf8a7a16', name='user_name', email='user@email.com', username=Non... │ │ │ │ └ 'ab28a8eb-eacc-4b94-887d-e4f5dd3eb877' │ │ │ └ FileModel(id='ab28a8eb-eacc-4b94-887d-e4f5dd3eb877', user_id='8da6f15f-a644-43e8-8ae7-d2f2bf8a7a16', hash=None, filename='tes... │ │ └ <class 'open_webui.routers.retrieval.ProcessFileForm'> │ └ <starlette.requests.Request object at 0x7f0d328dacd0> └ <function process_file at 0x7f0d126b2de0> File "/app/backend/open_webui/routers/retrieval.py", line 1656, in process_file result = save_docs_to_vector_db( └ <function save_docs_to_vector_db at 0x7f0d126b1f80> > File "/app/backend/open_webui/routers/retrieval.py", line 1447, in save_docs_to_vector_db embeddings = embedding_function( └ <function get_embedding_function.<locals>.<lambda> at 0x7f0cbc20e3e0> File "/app/backend/open_webui/retrieval/utils.py", line 468, in <lambda> return lambda query, prefix=None, user=None: embedding_function.encode( │ └ None └ ["today is Wednesday and it's 3:41."] AttributeError: 'NoneType' object has no attribute 'encode' 2025-11-05 15:45:51.044 | ERROR | open_webui.routers.retrieval:process_file:1695 - 'NoneType' object has no attribute 'encode' - {"trace_id": "7d25d1c33ca55b30b5e445748bf40e6b", "span_id": "7ae7a06dcd9af75c"} 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 0x7f0d6405c9a0> └ <WorkerThread(AnyIO worker thread, started 139692681619136)> File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner self.run() │ └ <function WorkerThread.run at 0x7f0cbf50c4a0> └ <WorkerThread(AnyIO worker thread, started 139692681619136)> File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 976, in run result = context.run(func, *args) │ │ │ └ () │ │ └ functools.partial(<function process_uploaded_file at 0x7f0d367c5300>, <starlette.requests.Request object at 0x7f0d328dacd0>, ... │ └ <method 'run' of '_contextvars.Context' objects> └ <_contextvars.Context object at 0x7f0cbf347e80> File "/app/backend/open_webui/routers/files.py", line 117, in process_uploaded_file process_file(request, ProcessFileForm(file_id=file_item.id), user=user) │ │ │ │ │ └ UserModel(id='8da6f15f-a644-43e8-8ae7-d2f2bf8a7a16', name='user_name', email=user@email.com', username=Non... │ │ │ │ └ 'ab28a8eb-eacc-4b94-887d-e4f5dd3eb877' │ │ │ └ FileModel(id='ab28a8eb-eacc-4b94-887d-e4f5dd3eb877', user_id='8da6f15f-a644-43e8-8ae7-d2f2bf8a7a16', hash=None, filename='tes... │ │ └ <class 'open_webui.routers.retrieval.ProcessFileForm'> │ └ <starlette.requests.Request object at 0x7f0d328dacd0> └ <function process_file at 0x7f0d126b2de0> > File "/app/backend/open_webui/routers/retrieval.py", line 1692, in process_file raise e └ AttributeError("'NoneType' object has no attribute 'encode'") File "/app/backend/open_webui/routers/retrieval.py", line 1656, in process_file result = save_docs_to_vector_db( └ <function save_docs_to_vector_db at 0x7f0d126b1f80> File "/app/backend/open_webui/routers/retrieval.py", line 1474, in save_docs_to_vector_db raise e File "/app/backend/open_webui/routers/retrieval.py", line 1447, in save_docs_to_vector_db embeddings = embedding_function( └ <function get_embedding_function.<locals>.<lambda> at 0x7f0cbc20e3e0> File "/app/backend/open_webui/retrieval/utils.py", line 468, in <lambda> return lambda query, prefix=None, user=None: embedding_function.encode( │ └ None └ ["today is Wednesday and it's 3:41."] AttributeError: 'NoneType' object has no attribute 'encode' ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#17593