Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading to 0.14.0 broke the openai_api_compatible model provider connection #11739

Closed
5 tasks done
AugNSo opened this issue Dec 17, 2024 · 3 comments · Fixed by #11906
Closed
5 tasks done

Upgrading to 0.14.0 broke the openai_api_compatible model provider connection #11739

AugNSo opened this issue Dec 17, 2024 · 3 comments · Fixed by #11906
Labels
🐞 bug Something isn't working

Comments

@AugNSo
Copy link

AugNSo commented Dec 17, 2024

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.14.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

git pull
docker compose up -d

✔️ Expected Behavior

The previous version was 0.13.0 and the API worked.

❌ Actual Behavior

API Endpoint redacted for privacy.

[openai_api_compatible] Server Unavailable Error, HTTPConnectionPool(host='127.0.0.1', port=7890): Max retries exceeded with url: http://...:*/v1/chat/completions (Caused by ProxyError('Unable to connect to proxy', NewConnectionError('<urllib3.connection.HTTPConnection object at 0x79e63d47eab0>: Failed to establish a new connection: [Errno 111] Connection refused')))

@dosubot dosubot bot added the 🐞 bug Something isn't working label Dec 17, 2024
Copy link

dosubot bot commented Dec 17, 2024

To resolve the "Server Unavailable Error" with the openai_api_compatible model provider connection after upgrading to Dify version 0.14.0 on a self-hosted Docker setup, you should ensure that the service is accessible from the Docker container. The error typically occurs because the Docker container cannot access the service using localhost. Instead, you should configure the service to use host.docker.internal to allow the Docker container to connect to the host machine's services.

Here's how you can configure it:

  1. Replace localhost with host.docker.internal in your Dify configuration for the service:

    http://host.docker.internal:11434

This change allows the Docker container to access the service running on the host machine [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@crazywoola
Copy link
Member

[openai_api_compatible] Server Unavailable Error, HTTPConnectionPool(host='127.0.0.1', port=7890): Max retries exceeded with url: http://...:*/v1/chat/completions (Caused by ProxyError('Unable to connect to proxy', NewConnectionError('<urllib3.connection.HTTPConnection object at 0x79e63d47eab0>: Failed to establish a new connection: [Errno 111] Connection refused')))

According to the url you provided, I don't think we support this if you use older version or not.

http://host.docker.internal:11434

Try this instead.

@AugNSo
Copy link
Author

AugNSo commented Dec 17, 2024

Pinpoint the problem to commit #11681, docker compose will read the system proxy env HTTP_PROXY and HTTPS_PROXY and in the case of HTTP_PROXY=127.0.0.1:7890, dify cannot access this endpoint. @crazywoola

Not sure what this fix is for but for people encountering the same problem, I think you can just comment out the 2 lines added if this fix is irrelevant to you or unset the system proxy env before docker compose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants