Api Container always request everything by HTTP_PROXY even not set #13426

Closed
opened 2026-02-21 19:12:07 -05:00 by yindo · 3 comments
Owner

Originally created by @Ucag on GitHub (Apr 27, 2025).

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

1.3.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I did not set any proxy configuration when using Dify. However I got this error when docker compose up

api-1            |
api-1            | During handling of the above exception, another exception occurred:
api-1            |
api-1            | Traceback (most recent call last):
api-1            |   File "/app/api/core/plugin/manager/base.py", line 63, in _request
api-1            |     response = requests.request(
api-1            |                ^^^^^^^^^^^^^^^^^
api-1            |   File "/app/api/.venv/lib/python3.12/site-packages/requests/api.py", line 59, in request
api-1            |     return session.request(method=method, url=url, **kwargs)
api-1            |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1            |   File "/app/api/.venv/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
api-1            |     resp = self.send(prep, **send_kwargs)
api-1            |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1            |   File "/app/api/.venv/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
api-1            |     r = adapter.send(request, **kwargs)
api-1            |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1            |   File "/app/api/.venv/lib/python3.12/site-packages/requests/adapters.py", line 513, in send
api-1            |     raise ProxyError(e, request=request)
api-1            | requests.exceptions.ProxyError: HTTPConnectionPool(host='127.0.0.1', port=7890): Max retries exceeded with url: http://plugin_daemon:5002/plugin/691c9952-bc6a-4678-bcc6-f543fd6003c0/management/install/tasks?page=1&page_size=100 (Caused by ProxyError('Unable to connect to proxy', NewConnectionError('<urllib3.connection.HTTPConnection object at 0xffffa0ce7cb0>: Failed to establish a new connection: [Errno 111] Connection refused')))

For figuring out, this is what I tried:

(base) ➜  docker git:(main) docker compose exec api env|grep proxy
SANDBOX_HTTPS_PROXY=http://ssrf_proxy:3128
http_proxy=http://127.0.0.1:7890
SANDBOX_HTTP_PROXY=http://ssrf_proxy:3128
SSRF_PROXY_HTTPS_URL=http://ssrf_proxy:3128
SSRF_PROXY_HTTP_URL=http://ssrf_proxy:3128

Even the apt command in api container also goes to http_proxy.

How can I cancel the proxy?

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @Ucag on GitHub (Apr 27, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.3.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I did not set any proxy configuration when using Dify. However I got this error when `docker compose up` ```bash api-1 | api-1 | During handling of the above exception, another exception occurred: api-1 | api-1 | Traceback (most recent call last): api-1 | File "/app/api/core/plugin/manager/base.py", line 63, in _request api-1 | response = requests.request( api-1 | ^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/.venv/lib/python3.12/site-packages/requests/api.py", line 59, in request api-1 | return session.request(method=method, url=url, **kwargs) api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/.venv/lib/python3.12/site-packages/requests/sessions.py", line 589, in request api-1 | resp = self.send(prep, **send_kwargs) api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/.venv/lib/python3.12/site-packages/requests/sessions.py", line 703, in send api-1 | r = adapter.send(request, **kwargs) api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/.venv/lib/python3.12/site-packages/requests/adapters.py", line 513, in send api-1 | raise ProxyError(e, request=request) api-1 | requests.exceptions.ProxyError: HTTPConnectionPool(host='127.0.0.1', port=7890): Max retries exceeded with url: http://plugin_daemon:5002/plugin/691c9952-bc6a-4678-bcc6-f543fd6003c0/management/install/tasks?page=1&page_size=100 (Caused by ProxyError('Unable to connect to proxy', NewConnectionError('<urllib3.connection.HTTPConnection object at 0xffffa0ce7cb0>: Failed to establish a new connection: [Errno 111] Connection refused'))) ``` For figuring out, this is what I tried: ```bash (base) ➜ docker git:(main) docker compose exec api env|grep proxy SANDBOX_HTTPS_PROXY=http://ssrf_proxy:3128 http_proxy=http://127.0.0.1:7890 SANDBOX_HTTP_PROXY=http://ssrf_proxy:3128 SSRF_PROXY_HTTPS_URL=http://ssrf_proxy:3128 SSRF_PROXY_HTTP_URL=http://ssrf_proxy:3128 ``` Even the `apt` command in `api` container also goes to `http_proxy`. How can I cancel the proxy? ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-21 19:12:07 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 27, 2025):

Hello @Ucag! I'm Dosu, your friendly bot here to help you tackle bugs, answer questions, and guide you on your journey as a contributor. I'm here while you wait for a human maintainer. Let's get started! 🚀

To cancel the proxy settings in your self-hosted Dify Docker setup, you can unset the system proxy environment variables (HTTP_PROXY and HTTPS_PROXY) before running docker compose. Alternatively, you can comment out the proxy-related lines added in commit #11681 if the proxy settings are not needed for your setup [1].

To continue talking to Dosu, mention @dosu.


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

@dosubot[bot] commented on GitHub (Apr 27, 2025): <!-- Greeting --> Hello @Ucag! I'm [Dosu](https://dosu.dev), your friendly bot here to help you tackle bugs, answer questions, and guide you on your journey as a contributor. I'm here while you wait for a human maintainer. Let's get started! 🚀 <!-- Answer --> To cancel the proxy settings in your self-hosted Dify Docker setup, you can unset the system proxy environment variables (HTTP_PROXY and HTTPS_PROXY) before running `docker compose`. Alternatively, you can comment out the proxy-related lines added in commit #11681 if the proxy settings are not needed for your setup <sup>[[1]](https://github.com/langgenius/dify/issues/11739)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/1960e793-24a5-4035-b671-51f4648af4d0?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/1960e793-24a5-4035-b671-51f4648af4d0?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/1960e793-24a5-4035-b671-51f4648af4d0?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/1960e793-24a5-4035-b671-51f4648af4d0?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/1960e793-24a5-4035-b671-51f4648af4d0?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/1960e793-24a5-4035-b671-51f4648af4d0?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/1960e793-24a5-4035-b671-51f4648af4d0?feedback_type=other)</sup>
Author
Owner

@Ucag commented on GitHub (Apr 27, 2025):

No, I did not set any proxy in my shell or system environment

@Ucag commented on GitHub (Apr 27, 2025): No, I did not set any proxy in my shell or system environment
Author
Owner

@Ucag commented on GitHub (Apr 27, 2025):

The proxy config in ~/.docker/config.json will influence all started container. Remove it will help.

@Ucag commented on GitHub (Apr 27, 2025): The proxy config in ~/.docker/config.json will influence all started container. Remove it will help.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13426