mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[GH-ISSUE #22664] Bug: UnboundLocalError in oracle23ai.py get() method crashes hybrid search #35309
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 @mango766 on GitHub (Mar 14, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/22664
Description
Hi there! I came across an
UnboundLocalErrorinbackend/open_webui/retrieval/vector/dbs/oracle23ai.pythat causes hybrid search to crash when Oracle 23ai is configured as the vector database.Root cause
In the
get()method (around line 713-718), thelimitvariable is referenced in alog.info()call before it is assigned:Python raises
UnboundLocalError: cannot access local variable 'limit' where it is not associated with a valuebecause the assignment on line 718 causes Python to treatlimitas a local variable throughout the entire function scope, even before the assignment executes.Impact
This bug is triggered whenever
VECTOR_DB_CLIENT.get(collection_name)is called on an Oracle23ai backend. The primary trigger path is:query_collection_with_hybrid_search()inretrieval/utils.pycallsVECTOR_DB_CLIENT.get(collection_name)(line 502)get()method crashes withUnboundLocalErrorbefore any database query executesThis makes hybrid search completely unusable with Oracle 23ai.
Fix
Move the
limit = 1000assignment before thelog.info()call so the variable is defined when it is first referenced. I will submit a PR shortly.Environment
main)Related
This is the same issue reported in #22616 and previously in #18356.
@silentoplayz commented on GitHub (Mar 16, 2026):
Related (based on issue title) - https://github.com/open-webui/open-webui/issues/22616
@Classic298 commented on GitHub (Mar 17, 2026):
fcf7208352