[GH-ISSUE #21439] issue: RAG stopped working: list index out of range #35010

Closed
opened 2026-04-25 09:13:04 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @theoretischer on GitHub (Feb 15, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/21439

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

0.8.1

Ollama Version (if applicable)

0.16.1

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

Rag works and the file gets uploaded

Actual Behavior

Rag does not work , file does not upload and error "list index out of range" is displayed

Steps to Reproduce

Have rag with ollama bge m3 and update to newest version

Logs & Screenshots

Image
openwebui  | 2026-02-15 20:46:42.078 | INFO     | open_webui.routers.retrieval:save_docs_to_vector_db:1607 - embeddings generated 1 for 2 items
openwebui  | 2026-02-15 20:46:42.078 | ERROR    | open_webui.routers.retrieval:save_docs_to_vector_db:1628 - list index out of range
openwebui  | Traceback (most recent call last):
openwebui  | 
openwebui  |   File "/usr/local/lib/python3.11/threading.py", line 1002, in _bootstrap
openwebui  |     self._bootstrap_inner()
openwebui  |     │    └ <function Thread._bootstrap_inner at 0x7f1aa0a90ae0>
openwebui  |     └ <WorkerThread(AnyIO worker thread, started 139742750148288)>
openwebui  |   File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
openwebui  |     self.run()
openwebui  |     │    └ <function WorkerThread.run at 0x7f18f458ea20>
openwebui  |     └ <WorkerThread(AnyIO worker thread, started 139742750148288)>
openwebui  |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 986, in run
openwebui  |     result = context.run(func, *args)
openwebui  |              │       │   │      └ ()
openwebui  |              │       │   └ functools.partial(<function process_uploaded_file at 0x7f18fe642d40>, <starlette.requests.Request object at 0x7f18a900d290>, ...
openwebui  |              │       └ <method 'run' of '_contextvars.Context' objects>
openwebui  |              └ <_contextvars.Context object at 0x7f18a9034480>
openwebui  | 
openwebui  |   File "/app/backend/open_webui/routers/files.py", line 194, in process_uploaded_file
openwebui  |     _process_handler(db_session)
openwebui  |     │                └ <sqlalchemy.orm.session.Session object at 0x7f18a9034450>
openwebui  |     └ <function process_uploaded_file.<locals>._process_handler at 0x7f18f437ede0>
openwebui  | 
openwebui  |   File "/app/backend/open_webui/routers/files.py", line 158, in _process_handler
openwebui  |     process_file(
openwebui  |     └ <function process_file at 0x7f18f716e160>
openwebui  | 
openwebui  |   File "/app/backend/open_webui/routers/retrieval.py", line 1817, in process_file
openwebui  |     result = save_docs_to_vector_db(
openwebui  |              └ <function save_docs_to_vector_db at 0x7f18f716e020>
openwebui  | 
openwebui  | > File "/app/backend/open_webui/routers/retrieval.py", line 1609, in save_docs_to_vector_db
openwebui  |     items = [
openwebui  | 
openwebui  |   File "/app/backend/open_webui/routers/retrieval.py", line 1613, in <listcomp>
openwebui  |     "vector": embeddings[idx],
openwebui  |               │          └ 1
openwebui  |               └ [[-0.00891435, 0.052891236, -0.024646437, -0.027786113, -0.018779991, -0.021229422, 0.016159482, -0.015561145, -0.022388397, ...
openwebui  | 
openwebui  | IndexError: list index out of range
openwebui  | 2026-02-15 20:46:42.079 | ERROR    | open_webui.routers.retrieval:process_file:1861 - list index out of range
openwebui  | Traceback (most recent call last):
openwebui  | 
openwebui  |   File "/usr/local/lib/python3.11/threading.py", line 1002, in _bootstrap
openwebui  |     self._bootstrap_inner()
openwebui  |     │    └ <function Thread._bootstrap_inner at 0x7f1aa0a90ae0>
openwebui  |     └ <WorkerThread(AnyIO worker thread, started 139742750148288)>
openwebui  |   File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
openwebui  |     self.run()
openwebui  |     │    └ <function WorkerThread.run at 0x7f18f458ea20>
openwebui  |     └ <WorkerThread(AnyIO worker thread, started 139742750148288)>
openwebui  |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 986, in run
openwebui  |     result = context.run(func, *args)
openwebui  |              │       │   │      └ ()
openwebui  |              │       │   └ functools.partial(<function process_uploaded_file at 0x7f18fe642d40>, <starlette.requests.Request object at 0x7f18a900d290>, ...
openwebui  |              │       └ <method 'run' of '_contextvars.Context' objects>
openwebui  |              └ <_contextvars.Context object at 0x7f18a9034480>
openwebui  | 
openwebui  |   File "/app/backend/open_webui/routers/files.py", line 194, in process_uploaded_file
openwebui  |     _process_handler(db_session)
openwebui  |     │                └ <sqlalchemy.orm.session.Session object at 0x7f18a9034450>
openwebui  |     └ <function process_uploaded_file.<locals>._process_handler at 0x7f18f437ede0>
openwebui  | 
openwebui  |   File "/app/backend/open_webui/routers/files.py", line 158, in _process_handler
openwebui  |     process_file(
openwebui  |     └ <function process_file at 0x7f18f716e160>
openwebui  | 
openwebui  | > File "/app/backend/open_webui/routers/retrieval.py", line 1858, in process_file
openwebui  |     raise e
openwebui  |           └ IndexError('list index out of range')
openwebui  | 
openwebui  |   File "/app/backend/open_webui/routers/retrieval.py", line 1817, in process_file
openwebui  |     result = save_docs_to_vector_db(
openwebui  |              └ <function save_docs_to_vector_db at 0x7f18f716e020>
openwebui  | 
openwebui  |   File "/app/backend/open_webui/routers/retrieval.py", line 1629, in save_docs_to_vector_db
openwebui  |     raise e
openwebui  | 
openwebui  |   File "/app/backend/open_webui/routers/retrieval.py", line 1609, in save_docs_to_vector_db
openwebui  |     items = [
openwebui  | 
openwebui  |   File "/app/backend/open_webui/routers/retrieval.py", line 1613, in <listcomp>
openwebui  |     "vector": embeddings[idx],
openwebui  |               │          └ 1
openwebui  |               └ [[-0.00891435, 0.052891236, -0.024646437, -0.027786113, -0.018779991, -0.021229422, 0.016159482, -0.015561145, -0.022388397, ...
openwebui  | 
openwebui  | IndexError: list index out of range
openwebui  | 2026-02-15 20:46:42.119 | ERROR    | open_webui.routers.files:_process_handler:180 - Error processing file: 935bc4f3-2152-4d67-bde9-629f74b961cd```

Ollama logs
```ollama  | init: embeddings required but some input tokens were not marked as outputs -> overriding
ollama  | output_reserve: reallocating output buffer from size 0.96 MiB to 346.65 MiB
ollama  | [GIN] 2026/02/15 - 19:46:41 | 500 |  2.678291082s |      172.22.0.1 | POST     "/api/embed"
ollama  | time=2026-02-15T19:46:41.940Z level=INFO source=server.go:1751 msg="llm embedding error: failed to encode response: json: unsupported value: NaN"```

### Additional Information


This worked flawlessly until I updated Openwebui. Since then i have been getting the "list index out of range" Error and the logs of openwebui say almost nothing usefull



When giving ollama work via curl everything works and it has more then enough vram, its an openwebui error.
I have tried changing every singe setting and deleted the verctor storage but nothing changend.
Originally created by @theoretischer on GitHub (Feb 15, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/21439 ### 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 have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!). - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version 0.8.1 ### Ollama Version (if applicable) 0.16.1 ### 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 Rag works and the file gets uploaded ### Actual Behavior Rag does not work , file does not upload and error "list index out of range" is displayed ### Steps to Reproduce Have rag with ollama bge m3 and update to newest version ### Logs & Screenshots <img width="1772" height="606" alt="Image" src="https://github.com/user-attachments/assets/79f7c45c-da81-4ed3-85a6-6384ca5fcbee" /> ```openwebui | aiohttp.client_exceptions.ClientResponseError: 500, message='Internal Server Error', url='http://192.168.178.130:11434/api/embed' openwebui | 2026-02-15 20:46:42.078 | INFO | open_webui.routers.retrieval:save_docs_to_vector_db:1607 - embeddings generated 1 for 2 items openwebui | 2026-02-15 20:46:42.078 | ERROR | open_webui.routers.retrieval:save_docs_to_vector_db:1628 - list index out of range openwebui | Traceback (most recent call last): openwebui | openwebui | File "/usr/local/lib/python3.11/threading.py", line 1002, in _bootstrap openwebui | self._bootstrap_inner() openwebui | │ └ <function Thread._bootstrap_inner at 0x7f1aa0a90ae0> openwebui | └ <WorkerThread(AnyIO worker thread, started 139742750148288)> openwebui | File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner openwebui | self.run() openwebui | │ └ <function WorkerThread.run at 0x7f18f458ea20> openwebui | └ <WorkerThread(AnyIO worker thread, started 139742750148288)> openwebui | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 986, in run openwebui | result = context.run(func, *args) openwebui | │ │ │ └ () openwebui | │ │ └ functools.partial(<function process_uploaded_file at 0x7f18fe642d40>, <starlette.requests.Request object at 0x7f18a900d290>, ... openwebui | │ └ <method 'run' of '_contextvars.Context' objects> openwebui | └ <_contextvars.Context object at 0x7f18a9034480> openwebui | openwebui | File "/app/backend/open_webui/routers/files.py", line 194, in process_uploaded_file openwebui | _process_handler(db_session) openwebui | │ └ <sqlalchemy.orm.session.Session object at 0x7f18a9034450> openwebui | └ <function process_uploaded_file.<locals>._process_handler at 0x7f18f437ede0> openwebui | openwebui | File "/app/backend/open_webui/routers/files.py", line 158, in _process_handler openwebui | process_file( openwebui | └ <function process_file at 0x7f18f716e160> openwebui | openwebui | File "/app/backend/open_webui/routers/retrieval.py", line 1817, in process_file openwebui | result = save_docs_to_vector_db( openwebui | └ <function save_docs_to_vector_db at 0x7f18f716e020> openwebui | openwebui | > File "/app/backend/open_webui/routers/retrieval.py", line 1609, in save_docs_to_vector_db openwebui | items = [ openwebui | openwebui | File "/app/backend/open_webui/routers/retrieval.py", line 1613, in <listcomp> openwebui | "vector": embeddings[idx], openwebui | │ └ 1 openwebui | └ [[-0.00891435, 0.052891236, -0.024646437, -0.027786113, -0.018779991, -0.021229422, 0.016159482, -0.015561145, -0.022388397, ... openwebui | openwebui | IndexError: list index out of range openwebui | 2026-02-15 20:46:42.079 | ERROR | open_webui.routers.retrieval:process_file:1861 - list index out of range openwebui | Traceback (most recent call last): openwebui | openwebui | File "/usr/local/lib/python3.11/threading.py", line 1002, in _bootstrap openwebui | self._bootstrap_inner() openwebui | │ └ <function Thread._bootstrap_inner at 0x7f1aa0a90ae0> openwebui | └ <WorkerThread(AnyIO worker thread, started 139742750148288)> openwebui | File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner openwebui | self.run() openwebui | │ └ <function WorkerThread.run at 0x7f18f458ea20> openwebui | └ <WorkerThread(AnyIO worker thread, started 139742750148288)> openwebui | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 986, in run openwebui | result = context.run(func, *args) openwebui | │ │ │ └ () openwebui | │ │ └ functools.partial(<function process_uploaded_file at 0x7f18fe642d40>, <starlette.requests.Request object at 0x7f18a900d290>, ... openwebui | │ └ <method 'run' of '_contextvars.Context' objects> openwebui | └ <_contextvars.Context object at 0x7f18a9034480> openwebui | openwebui | File "/app/backend/open_webui/routers/files.py", line 194, in process_uploaded_file openwebui | _process_handler(db_session) openwebui | │ └ <sqlalchemy.orm.session.Session object at 0x7f18a9034450> openwebui | └ <function process_uploaded_file.<locals>._process_handler at 0x7f18f437ede0> openwebui | openwebui | File "/app/backend/open_webui/routers/files.py", line 158, in _process_handler openwebui | process_file( openwebui | └ <function process_file at 0x7f18f716e160> openwebui | openwebui | > File "/app/backend/open_webui/routers/retrieval.py", line 1858, in process_file openwebui | raise e openwebui | └ IndexError('list index out of range') openwebui | openwebui | File "/app/backend/open_webui/routers/retrieval.py", line 1817, in process_file openwebui | result = save_docs_to_vector_db( openwebui | └ <function save_docs_to_vector_db at 0x7f18f716e020> openwebui | openwebui | File "/app/backend/open_webui/routers/retrieval.py", line 1629, in save_docs_to_vector_db openwebui | raise e openwebui | openwebui | File "/app/backend/open_webui/routers/retrieval.py", line 1609, in save_docs_to_vector_db openwebui | items = [ openwebui | openwebui | File "/app/backend/open_webui/routers/retrieval.py", line 1613, in <listcomp> openwebui | "vector": embeddings[idx], openwebui | │ └ 1 openwebui | └ [[-0.00891435, 0.052891236, -0.024646437, -0.027786113, -0.018779991, -0.021229422, 0.016159482, -0.015561145, -0.022388397, ... openwebui | openwebui | IndexError: list index out of range openwebui | 2026-02-15 20:46:42.119 | ERROR | open_webui.routers.files:_process_handler:180 - Error processing file: 935bc4f3-2152-4d67-bde9-629f74b961cd``` Ollama logs ```ollama | init: embeddings required but some input tokens were not marked as outputs -> overriding ollama | output_reserve: reallocating output buffer from size 0.96 MiB to 346.65 MiB ollama | [GIN] 2026/02/15 - 19:46:41 | 500 | 2.678291082s | 172.22.0.1 | POST "/api/embed" ollama | time=2026-02-15T19:46:41.940Z level=INFO source=server.go:1751 msg="llm embedding error: failed to encode response: json: unsupported value: NaN"``` ### Additional Information This worked flawlessly until I updated Openwebui. Since then i have been getting the "list index out of range" Error and the logs of openwebui say almost nothing usefull When giving ollama work via curl everything works and it has more then enough vram, its an openwebui error. I have tried changing every singe setting and deleted the verctor storage but nothing changend.
GiteaMirror added the bug label 2026-04-25 09:13:04 -05:00
Author
Owner

@theoretischer commented on GitHub (Feb 15, 2026):

It was an ollama issue, setting
- OLLAMA_BATCH_SIZE=512
- OLLAMA_MAX_LOADED_MODELS=1
worked

still have no idea why, because i didnt change anything.

<!-- gh-comment-id:3905157626 --> @theoretischer commented on GitHub (Feb 15, 2026): It was an ollama issue, setting - OLLAMA_BATCH_SIZE=512 - OLLAMA_MAX_LOADED_MODELS=1 worked still have no idea why, because i didnt change anything.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#35010