Bug: RAG Web Search fails with "cannot access local variable 'tool'" #17863
alexandrsuk
started this conversation in
Issues
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
When using the RAG Web Search feature with a custom search engine (like SearXNG), the AI correctly identifies the intent to search and prepares the tool call parameters. However, before the tool call is dispatched, the Open WebUI backend crashes with an
UnboundLocalError.The SearXNG instance is working correctly and is accessible from the Open WebUI container. The error seems to be internal to the tool-calling logic in Open WebUI.
Steps to Reproduce
docker-compose.yml:cannot access local variable 'tool' where it is not associated with a value.Expected Behavior
The AI should successfully execute the call to the SearXNG API URL, receive the search results, and use them to formulate an answer.
Actual Behavior
The tool call fails with a Python
UnboundLocalErrororiginating from the Open WebUI backend. The search is never actually performed.Screenshot of the error in the UI:
(Zde vložte ten screenshot, který jste poslal mně)
Environment Details
ghcr.io/open-webui/open-webui:latesttag.gpt-oss:20bsearxngcontainer.Logs
Here is the relevant error message from the Open WebUI logs:

log-open-webui-001.txt
Beta Was this translation helpful? Give feedback.
All reactions