Open WebUI: 400: 'NoneType' object has no attribute 'encode' (document embedding model missing)
When uploading a document or adding it to a knowledge base, Open WebUI crashes with this error. The document is not prepared for search (RAG).
The message
400: 'NoneType' object has no attribute 'encode'
Affects: Open WebUI
Why is this happening?
For RAG, Open WebUI converts the text into vectors with an embedding model. If this model is not set up, has not finished downloading, or the external embedding service (for example Ollama) is not reachable, Open WebUI does not get a model back and fails.
How to fix it
- Open „Settings > Admin > Documents“ and save the model again under „Embedding Model“, even if it is already selected. This makes Open WebUI check it again and download it if needed.
- If you use an external embedding service, check whether it is running and reachable from Open WebUI.
- Then upload a document again and check the log to see whether the error message is gone.
- If you changed the embedding model, reindex the existing documents: „Settings > Admin > Documents > Reindex Knowledge and Memory Vectors“. Only then will the new embeddings apply.
Better not: Do not change the embedding model without reindexing afterward: Old and new vectors do not match, and document search will then return nothing useful.
Set up from scratch again
If it still doesn’t work after that, a fresh setup step by step often helps:
- Your own ChatGPT with Ollama and Open WebUI
Run a language model locally on Windows - with the Ollama app, suitable models for 8 to 24 GB, context length, command line, and Open WebUI… - Chat with your own documents (AnythingLLM)
Set up AnythingLLM Desktop on Windows, load PDFs into a workspace, and ask questions locally — with sources and privacy.
Terms for this
Similar errors
- Confusing answers, endless loops, or tags like <|im_end|> (wrong chat template)
- Model forgets the beginning or ignores long texts (context length too small)
- Ollama: model "…" not found, try pulling it first (model missing on this server)
- Ollama: POST predict … /completion: EOF / wsarecv: An existing connection was forcibly closed by the remote host (model process crashed in the middle of the response)
- Open WebUI: Ollama: 500, message='Internal Server Error' (Ollama reached, but model cannot respond)
Sources
Checked on Oct 28, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.