mirror of
https://github.com/open-webui/open-webui.git
synced 2026-06-04 07:47:12 -05:00
[GH-ISSUE #20292] issue: [BUG] Error 500 /api/models block when OLLAMA_BASE_URLS contains an unreachable IP #106140
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 @netgabo on GitHub (Dec 31, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20292
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.6.43
Ollama Version (if applicable)
None (Issue occurs when Ollama is not present but a ghost IP is configured)
Operating System
Debian/Ubuntu (CasaOS Environment) ZimaOS
Browser (if applicable)
Chrome / Firefox
Confirmation
README.md.Expected Behavior
If a configured OLLAMA_BASE_URLS or OPENAI_API_BASE_URLS endpoint is unreachable, the backend should handle the connection timeout gracefully. The /api/models endpoint should return the available models from working connections (or an empty list) instead of failing with a 500 Internal Server Error. Users should always be able to access the Settings UI to correct invalid configurations.
Actual Behavior
When an unreachable IP (e.g., 192.168.0.109) is present in the connection settings, the backend attempts to fetch models and fails. This results in a 500 Internal Server Error for the /api/models call. Since the frontend Settings menu depends on this call to load, the UI becomes unresponsive or blocked, creating a "deadlock" where the user cannot fix the incorrect IP through the web interface.
Steps to Reproduce
Install Open WebUI via Docker.
Go to Settings > Connections and add an unreachable IP to Ollama or OpenAI base URLs (e.g., http://192.168.0.109:11434 + http://host.docker.internal:11434) .
Save and restart the container.
Attempt to log in and open the Settings menu.
The UI will show an error or spin indefinitely. Checking the browser console and Docker logs will reveal a 500 Error on GET /api/models.
End: There is no way to revert this change via UI; only manual database manipulation (SQLite) fixes it.
Logs & Screenshots
ERROR | open_webui.routers.openai:send_get_request:83 - Connection error: Cannot connect to host 192.168.0.109:1234 ssl:default [Connect call failed ('192.168.0.109', 1234)]
ERROR | open_webui.routers.ollama:send_get_request:99 - Connection error: Cannot connect to host 192.168.0.109:11434 ssl:default [Connect call failed ('192.168.0.109', 11434)]
INFO | uvicorn.protocols.http.httptools_impl:send:476 - "GET /api/models HTTP/1.1" 500
Database Inspection (using grep on webui.db): The unreachable IP was found persisted in a large JSON string within the config table, preventing successful initialization even after changing environment variables, as the database values took precedence.
Additional Information
Manual Workaround used to recover: To fix this, I had to stop the container and manually clear the config table using: sqlite3 webui.db "DELETE FROM config WHERE id LIKE '%urls%';" This confirms the issue is that the backend does not ignore or timeout quickly enough on invalid database-stored endpoints, causing a total UI lockout.
@owui-terminator[bot] commented on GitHub (Dec 31, 2025):
🔍 Similar Issues Found
I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:
#19755 issue: Error: 404, message='Not Found', url='http://ollama:11434/api/embed'
by stevewillett • Dec 04, 2025 •
bug#20290 issue:
by rldet9 • Dec 31, 2025 •
bug#19496 issue: 500 internal server error appears in v0.6.40
by cloudtuotuo • Nov 26, 2025 •
bug#19575 issue: Remove / delete Ollama models not possible - Error occurred
by JoeyVinc • Nov 28, 2025 •
bug#19188 issue: Model drop-down fails to show models from remote hosts (ollama, llama.cpp)
by d-shehu • Nov 14, 2025 •
bugShow 5 more related issues
#16255 issue: 404: Model not found
by wade3po • Aug 04, 2025 •
bug#18975 issue: 500: Internal Error
by nurb2kea • Nov 06, 2025 •
bug#11972 issue: not found ollama models after ollama upgrade
by SquirrelJimmy • Mar 23, 2025 •
bug#11990 issue: OLLAMA_BASE_URL being passed as OLLAMA_API_BASE_URL
by deboboy • Mar 23, 2025 •
bug#19563 issue:
by naruto7g • Nov 28, 2025 •
bug💡 Tips:
This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
@tjbck commented on GitHub (Dec 31, 2025):
You can configure this behaviour with an env var.