mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[GH-ISSUE #18356] issue: oracle23ai.py UnboundLocalError: cannot access local variable 'limit' where it is not associated with a value #18571
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 @fatih-keles on GitHub (Oct 15, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/18356
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.6.33
Ollama Version (if applicable)
0.12.3
Operating System
Ubuntu 24.04
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
Web search results to be passed to LLM
Actual Behavior
Web search results are not passed to LLM, we see error message in container log
Steps to Reproduce
Start container with web search enabled
docker run -d
-p 3000:8080
-v ollama:/root/.ollama
-v open-webui:/app/backend/data
-v /u01/oracle_wallet:/oracle_wallet
--name open-webui
--restart unless-stopped
-e WEBUI_URL="https://"
-e ENABLE_OAUTH_SIGNUP=False
-e ENABLE_PERSISTENT_CONFIG=False
-e VECTOR_DB=oracle23ai
-e ORACLE_DB_USE_WALLET=True
-e ORACLE_DB_USER=OPENWEBUI
-e ORACLE_DB_PASSWORD=
-e ORACLE_DB_DSN=kbvectorstore2_low
-e ORACLE_WALLET_DIR=/oracle_wallet
-e ORACLE_WALLET_PASSWORD=
-e ORACLE_VECTOR_LENGTH=384
-e ORACLE_DB_POOL_MIN=2
-e ORACLE_DB_POOL_MAX=10
-e ORACLE_DB_POOL_INCREMENT=1
-e OAUTH_CLIENT_ID=""
-e OAUTH_CLIENT_SECRET=""
-e OPENID_PROVIDER_URL="https:///.well-known/openid-configuration"
-e OAUTH_PROVIDER_NAME="OCI SSO"
-e OAUTH_SCOPES="openid email profile"
-e OPENID_REDIRECT_URI="https:///oauth/oidc/callback"
-e ENABLE_WEB_SEARCH=True
-e WEB_SEARCH_ENGINE=perplexity_search
-e PERPLEXITY_API_KEY="pplx-"
ghcr.io/open-webui/open-webui:ollama
enable web search in a new chat and enter a prompt like "what's the weather like in Amsterdam"
observe container logs.
Logs & Screenshots
2025-10-15 17:18:08.029 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 94.207.29.255:0 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200
[GIN] 2025/10/15 - 17:18:38 | 200 | 2m19s | 127.0.0.1 | POST "/api/chat"
Fetching pages: 100%|##########| 6/6 [00:02<00:00, 2.55it/s]
2025-10-15 17:18:44.803 | INFO | open_webui.routers.retrieval:save_docs_to_vector_db:1262 - save_docs_to_vector_db: document Weather - Amsterdam - 14-Day Forecast: Temperature, Wind & Radar | Ventusky, Amsterdam, North Holland, Netherlands Weather Forecast | AccuWeather, Weather - The Hague - 14-Day Forecast: Temperature, Wind & Radar | Ventusky, 10-Day Weather Forecast for Frederik Hendrikbuurt, Amsterdam-West, North Holland, Netherlands - The Weather Channel | weather.com, Weather Forecast and Conditions for Burgwallen-Nieuwe Zijde, Amsterdam-Centrum, North Holland, Netherlands - The Weather Channel | Weather.com, Albany, New York News, Weather, Sports | NEWS10 ABC web-search-8a99e9cc4ece8992b7736ac93a13bcbf9fa12f4a1f0f805ae7b8
2025-10-15 17:18:44.829 | INFO | open_webui.routers.retrieval:save_docs_to_vector_db:1378 - generating embeddings for web-search-8a99e9cc4ece8992b7736ac93a13bcbf9fa12f4a1f0f805ae7b8
Batches: 100%|██████████| 3/3 [00:01<00:00, 2.43it/s]
2025-10-15 17:18:46.078 | INFO | open_webui.routers.retrieval:save_docs_to_vector_db:1414 - embeddings generated 86 for 86 items
2025-10-15 17:18:46.080 | INFO | open_webui.routers.retrieval:save_docs_to_vector_db:1426 - adding to collection web-search-8a99e9cc4ece8992b7736ac93a13bcbf9fa12f4a1f0f805ae7b8
2025-10-15 17:18:46.081 | INFO | open_webui.retrieval.vector.dbs.oracle23ai:insert:421 - Inserting 86 items into collection 'web-search-8a99e9cc4ece8992b7736ac93a13bcbf9fa12f4a1f0f805ae7b8'.
2025-10-15 17:18:46.240 | INFO | open_webui.retrieval.vector.dbs.oracle23ai:insert:446 - Successfully inserted 86 items into collection 'web-search-8a99e9cc4ece8992b7736ac93a13bcbf9fa12f4a1f0f805ae7b8'.
2025-10-15 17:18:46.241 | INFO | open_webui.routers.retrieval:save_docs_to_vector_db:1432 - added 86 items to collection web-search-8a99e9cc4ece8992b7736ac93a13bcbf9fa12f4a1f0f805ae7b8
2025-10-15 17:18:46.257 | ERROR | open_webui.retrieval.utils:get_doc:146 - Error getting doc web-search-8a99e9cc4ece8992b7736ac93a13bcbf9fa12f4a1f0f805ae7b8: cannot access local variable 'limit' where it is not associated with a value
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 0x7506027549a0>
└ <Thread(ThreadPoolExecutor-15_0, started 128658714859200)>
File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
self.run()
│ └ <function Thread.run at 0x750602754680>
└ <Thread(ThreadPoolExecutor-15_0, started 128658714859200)>
File "/usr/local/lib/python3.11/threading.py", line 982, in run
self._target(*self._args, **self._kwargs)
│ │ │ │ │ └ {}
│ │ │ │ └ <Thread(ThreadPoolExecutor-15_0, started 128658714859200)>
│ │ │ └ (<weakref at 0x750493dfae30; to 'ThreadPoolExecutor' at 0x7504c1ec3050>, <_queue.SimpleQueue object at 0x750493b00950>, None,...
│ │ └ <Thread(ThreadPoolExecutor-15_0, started 128658714859200)>
│ └ <function _worker at 0x7506016565c0>
└ <Thread(ThreadPoolExecutor-15_0, started 128658714859200)>
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 83, in _worker
work_item.run()
│ └ <function _WorkItem.run at 0x750601656700>
└ <concurrent.futures.thread._WorkItem object at 0x750493b2a910>
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
│ │ │ │ │ └ {}
│ │ │ │ └ <concurrent.futures.thread._WorkItem object at 0x750493b2a910>
│ │ │ └ ()
│ │ └ <concurrent.futures.thread._WorkItem object at 0x750493b2a910>
│ └ <function chat_completion_files_handler.. at 0x750493b0c900>
└ <concurrent.futures.thread._WorkItem object at 0x750493b2a910>
File "/app/backend/open_webui/utils/middleware.py", line 886, in
lambda: get_sources_from_items(
└ <function get_sources_from_items at 0x75055c21af20>
File "/app/backend/open_webui/retrieval/utils.py", line 728, in get_sources_from_items
query_result = get_all_items_from_collections(collection_names)
│ └ {'web-search-8a99e9cc4ece8992b7736ac93a13bcbf9fa12f4a1f0f805ae7b8'}
└ <function get_all_items_from_collections at 0x75055c21a520>
File "/app/backend/open_webui/retrieval/utils.py", line 312, in get_all_items_from_collections
result = get_doc(collection_name=collection_name)
│ └ 'web-search-8a99e9cc4ece8992b7736ac93a13bcbf9fa12f4a1f0f805ae7b8'
└ <function get_doc at 0x75055c21a700>
File "/app/backend/open_webui/retrieval/vector/dbs/oracle23ai.py", line 716, in get
f"Getting items from collection '{collection_name}' with limit {limit}."
UnboundLocalError: cannot access local variable 'limit' where it is not associated with a value
2025-10-15 17:18:46.259 | ERROR | open_webui.retrieval.utils:get_all_items_from_collections:316 - Error when querying the collection: cannot access local variable 'limit' where it is not associated with a value
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 0x7506027549a0>
└ <Thread(ThreadPoolExecutor-15_0, started 128658714859200)>
File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
self.run()
│ └ <function Thread.run at 0x750602754680>
└ <Thread(ThreadPoolExecutor-15_0, started 128658714859200)>
File "/usr/local/lib/python3.11/threading.py", line 982, in run
self._target(*self._args, **self._kwargs)
│ │ │ │ │ └ {}
│ │ │ │ └ <Thread(ThreadPoolExecutor-15_0, started 128658714859200)>
│ │ │ └ (<weakref at 0x750493dfae30; to 'ThreadPoolExecutor' at 0x7504c1ec3050>, <_queue.SimpleQueue object at 0x750493b00950>, None,...
│ │ └ <Thread(ThreadPoolExecutor-15_0, started 128658714859200)>
│ └ <function _worker at 0x7506016565c0>
└ <Thread(ThreadPoolExecutor-15_0, started 128658714859200)>
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 83, in _worker
work_item.run()
│ └ <function _WorkItem.run at 0x750601656700>
└ <concurrent.futures.thread._WorkItem object at 0x750493b2a910>
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
│ │ │ │ │ └ {}
│ │ │ │ └ <concurrent.futures.thread._WorkItem object at 0x750493b2a910>
│ │ │ └ ()
│ │ └ <concurrent.futures.thread._WorkItem object at 0x750493b2a910>
│ └ <function chat_completion_files_handler.. at 0x750493b0c900>
└ <concurrent.futures.thread._WorkItem object at 0x750493b2a910>
File "/app/backend/open_webui/utils/middleware.py", line 886, in
lambda: get_sources_from_items(
└ <function get_sources_from_items at 0x75055c21af20>
File "/app/backend/open_webui/retrieval/utils.py", line 728, in get_sources_from_items
query_result = get_all_items_from_collections(collection_names)
│ └ {'web-search-8a99e9cc4ece8992b7736ac93a13bcbf9fa12f4a1f0f805ae7b8'}
└ <function get_all_items_from_collections at 0x75055c21a520>
File "/app/backend/open_webui/retrieval/utils.py", line 147, in get_doc
raise e
File "/app/backend/open_webui/retrieval/utils.py", line 139, in get_doc
result = VECTOR_DB_CLIENT.get(collection_name=collection_name)
│ │ └ 'web-search-8a99e9cc4ece8992b7736ac93a13bcbf9fa12f4a1f0f805ae7b8'
│ └ <function Oracle23aiClient.get at 0x7505659b6fc0>
└ <open_webui.retrieval.vector.dbs.oracle23ai.Oracle23aiClient object at 0x750566443350>
File "/app/backend/open_webui/retrieval/vector/dbs/oracle23ai.py", line 716, in get
f"Getting items from collection '{collection_name}' with limit {limit}."
UnboundLocalError: cannot access local variable 'limit' where it is not associated with a value
2025-10-15 17:18:53.691 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 94.207.29.255:0 - "GET /_app/version.json HTTP/1.1" 200
[GIN] 2025/10/15 - 17:19:01 | 200 | 54.354498778s | 127.0.0.1 | POST "/api/chat"
Additional Information
open-webui/backend/open_webui/retrieval/vector/dbs/oracle23ai.py
local variable limit is missing in procedure get
def get(self, collection_name: str) -> Optional[GetResult]:
"""
Get all items in a collection.
@tjbck commented on GitHub (Oct 15, 2025):
Addressed in dev.