
open-webui中报错:Ollama: bad gateway 502 -> 解决
解决open-webui报错问题
open-webui中报错:Ollama: bad gateway 502
在open-webui中click manage ollama的时候出现了一个问题
Ollama: 502 Server Error: Bad Gateway for url: http://172.17.0.6:11434/api/tags
我的配置
- 系统:linux22.04
- 安装ollama方式:curl -fsSL https://ollama.com/install.sh | sh
- 安装open-webui方式:pip install open-webui==0.5.10
报错情况
看open-webui terminal log报错:
[open_webui.routers.ollama] 502 Server Error: Bad Gateway for url: http://172.17.0.6:11434/api/tags
Traceback (most recent call last):
File “/usr/local/lib/python3.11/dist-packages/open_webui/routers/ollama.py”, line 377, in get_ollama_tags
r.raise_for_status()
File “/usr/local/lib/python3.11/dist-packages/requests/models.py”, line 1024, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 502 Server Error: Bad Gateway for url: http://172.17.0.6:11434/api/tags
可以看到这是一个request请求问题,问题出在http上面
解决方案
找到文件ollama.py --> find / -name “*ollama.py”
然后找到函数get_ollama_tags函数,对其中的"url = request.app.state.config.OLLAMA_BASE_URLS[url_idx]"替换成显式的"url = “http://localhost:11434/”,问题便得到了解决
有问题的评论在下面
在部署ollama和open-webui的时候碰到了很多问题,包括但不仅限于:
- 下载ollama速度慢,下载不了
- 部署open-webui的时候使用python版本不对,依赖包没有
- 部署open-webui使用development方式部署,但是embeddings already exists
- …
更多推荐
所有评论(0)