langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
39.56k stars 5.42k forks source link

An error occurred during credentials validation: HTTPConnectionPool(host='localhost', port=6337): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x79235a8b7130>: Failed to establish a new connection: [Errno 111] Connection refused')) #4905

Closed quzx closed 1 month ago

quzx commented 1 month ago

Self Checks

Dify version

0.6.9

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

curl http://124.xxx.66.xxx:7004/api/chat -d '{ "model": "qwen:32b-chat-v1.5-q5_K_M", "messages": [ { "role": "user", "content": "hello" } ] }' It works well.

When add ollama model provider from UI(ollama url:http://134.xxx.66.xxx:7004/), i get "An error occurred during credentials validation: HTTPConnectionPool(host='localhost', port=6337): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x79235a8b7130>: Failed to establish a new connection: [Errno 111] Connection refused'))" It's really not 'localhost' in the UI, but i get "HTTPConnectionPool(host='localhost', port=6337): ..." error information.

But it work fine 5 days ago.

my ip is not localhost. its http://134.xxx.66.xxx:7004/

my installation: git clone https://github.com/langgenius/dify.git cd dify/docker docker compose up -d

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

crazywoola commented 1 month ago

错误信息请使用标准格式化贴在 Actual Behavior 里面,标题请勿直接填写错误信息,请查看以前的 issue 尝试解决。

quzx commented 1 month ago

Not Bug. My ollama listen on 0.0.0.0. With frp , public ip map to localhost. I let ollama listening on 192.168.x.x, and changed local_port in frp, It become ok.