The http proxy environment variable of Dify plugin_daemon only supports uppercase letters. #13334

Open
opened 2026-02-21 19:11:41 -05:00 by yindo · 5 comments
Owner

Originally created by @anadamasayuki on GitHub (Apr 25, 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

In a self-hosted environment under an HTTP(S) proxy, set the following proxy environment variables in docker-compose.yaml .

services:
  plugin_daemon:
    environment;
      http(s)_proxy: http://proxy-host:port

The http(s)_proxy environment variables specified in lowercase are valid in sandbox and api containers, but not in plugin_daemon.

plugin_daemon supports resolving python dependencies under http(s) proxy.
https://github.com/langgenius/dify-plugin-daemon/blob/main/internal/core/plugin_manager/launcher.go#L132-L143

	localPluginRuntime := local_runtime.NewLocalPluginRuntime(local_runtime.LocalPluginRuntimeConfig{
		PythonInterpreterPath:     p.pythonInterpreterPath,

		HttpProxy:                 p.HttpProxy,
		HttpsProxy:                p.HttpsProxy,
		NoProxy:                   p.NoProxy,

	})

However, the plugin_daemon configuration only reads the proxy environment variable in uppercase.
https://github.com/langgenius/dify-plugin-daemon/blob/main/internal/types/app/config.go#L131-L132

	HttpProxy  string `envconfig:"HTTP_PROXY"`
	HttpsProxy string `envconfig:"HTTPS_PROXY"`

If the uppercase HTTP(S)_PROXY setting is empty and the lowercase http(s)_proxy is defined, I would like it to take precedence.

✔️ Expected Behavior

It will be possible to install plugins on the marketplace from behind the http(s) proxy.

Actual Behavior

plugin_daemon gives the following error.

runtime error: invalid memory address or nil pointer dereference
Originally created by @anadamasayuki on GitHub (Apr 25, 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 In a self-hosted environment under an HTTP(S) proxy, set the following proxy environment variables in docker-compose.yaml . ```yaml services: plugin_daemon: environment; http(s)_proxy: http://proxy-host:port ``` The http(s)_proxy environment variables specified in lowercase are valid in sandbox and api containers, but not in plugin_daemon. plugin_daemon supports resolving python dependencies under http(s) proxy. https://github.com/langgenius/dify-plugin-daemon/blob/main/internal/core/plugin_manager/launcher.go#L132-L143 ```golang localPluginRuntime := local_runtime.NewLocalPluginRuntime(local_runtime.LocalPluginRuntimeConfig{ PythonInterpreterPath: p.pythonInterpreterPath, HttpProxy: p.HttpProxy, HttpsProxy: p.HttpsProxy, NoProxy: p.NoProxy, }) ``` However, the plugin_daemon configuration only reads the proxy environment variable in uppercase. https://github.com/langgenius/dify-plugin-daemon/blob/main/internal/types/app/config.go#L131-L132 ```golang HttpProxy string `envconfig:"HTTP_PROXY"` HttpsProxy string `envconfig:"HTTPS_PROXY"` ``` If the uppercase HTTP(S)_PROXY setting is empty and the lowercase http(s)_proxy is defined, I would like it to take precedence. ### ✔️ Expected Behavior It will be possible to install plugins on the marketplace from behind the http(s) proxy. ### ❌ Actual Behavior plugin_daemon gives the following error. ``` runtime error: invalid memory address or nil pointer dereference ```
yindo added the 🐞 buggood first issue labels 2026-02-21 19:11:41 -05:00
Author
Owner

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

Hello @anadamasayuki! I'm Dosu, here to assist you with bugs, answer your questions, and help you become a contributor. I'm ready to help while you wait for a human maintainer.

The issue you're experiencing with the Dify plugin_daemon only recognizing uppercase HTTP_PROXY and HTTPS_PROXY environment variables is a known behavior. The plugin_daemon is explicitly configured to use these uppercase variables, as indicated in the codebase. The lowercase http(s)_proxy variables are not recognized, which leads to runtime errors when the uppercase variables are not set [1].

To resolve this, you should set both the uppercase and lowercase proxy environment variables in your configuration. This can be done by including both versions in your docker-compose.yaml file under the plugin_daemon service environment section. This approach ensures compatibility with systems that require lowercase proxy settings while still adhering to the current configuration of the plugin_daemon [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 25, 2025): <!-- Greeting --> Hello @anadamasayuki! I'm [Dosu](https://dosu.dev), here to assist you with bugs, answer your questions, and help you become a contributor. I'm ready to help while you wait for a human maintainer. <!-- Answer --> The issue you're experiencing with the Dify `plugin_daemon` only recognizing uppercase `HTTP_PROXY` and `HTTPS_PROXY` environment variables is a known behavior. The `plugin_daemon` is explicitly configured to use these uppercase variables, as indicated in the codebase. The lowercase `http(s)_proxy` variables are not recognized, which leads to runtime errors when the uppercase variables are not set <sup>[[1]](https://github.com/langgenius/dify/issues/16548)</sup>. To resolve this, you should set both the uppercase and lowercase proxy environment variables in your configuration. This can be done by including both versions in your `docker-compose.yaml` file under the `plugin_daemon` service environment section. This approach ensures compatibility with systems that require lowercase proxy settings while still adhering to the current configuration of the `plugin_daemon` <sup>[[1]](https://github.com/langgenius/dify/issues/16548)</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/e2bf3d3c-5a2b-42df-97aa-4d746e881fe6?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/e2bf3d3c-5a2b-42df-97aa-4d746e881fe6?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/e2bf3d3c-5a2b-42df-97aa-4d746e881fe6?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/e2bf3d3c-5a2b-42df-97aa-4d746e881fe6?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e2bf3d3c-5a2b-42df-97aa-4d746e881fe6?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/e2bf3d3c-5a2b-42df-97aa-4d746e881fe6?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e2bf3d3c-5a2b-42df-97aa-4d746e881fe6?feedback_type=other)</sup>
Author
Owner

@kenwoodjw commented on GitHub (Apr 29, 2025):

@crazywoola Do we need to modify the code of plugin_daemon? Or just modify docker-compose.yaml

@kenwoodjw commented on GitHub (Apr 29, 2025): @crazywoola Do we need to modify the code of `plugin_daemon`? Or just modify `docker-compose.yaml`
Author
Owner

@skylinenzo commented on GitHub (Jun 10, 2025):

Hi all, I have a similar issue like this.
I am trying to add Volcengine in my air-gapped-behind-VPN Dify 1.3.1, and I got constantly 400 error of

api-1            | 2025-06-10 07:09:46.876 INFO [Thread-2 (process_request_thread)] [_internal.py:97] - 172.19.0.10 - - [10/Jun/2025 07:09:46] "POST /console/api/workspaces/current/model-providers/langgenius/volcengine_maas/volcengine_maas/models HTTP/1.1" 400 -

After some tcpdump tries, I focused on the plugin_daemon, I had already mount my ca-certs and set proxy server in docker-compose.yaml like this for plugin_daemon:

   envs:
      HTTP_PROXY: http://server:port
      HTTPS_PROXY: http://server:port
      NO_PROXY: ssrf_proxy,api,weaviate,gdrant,db,redis,web,worker,sandbox,plugin_daemon,localhost,127.0.0.1,172.19.*.*

   ports:
      - "${EXPOSE_PLUGIN_DEBUGGING_PORT:-5003}:${PLUGIN_DEBUGGING_PORT:-5003}"
   volumes:
      - /etc/pki/tls/certs/ca-bundle.crt:/etc/ssl/certs/ca-certificates.crt
      - ./volumes/plugin_daemon:/app/storage

I can successfully curl the endpoint of volcengine and even access to API, however, when I add the model in the Volcengine plugin, it still got 400 error, when I dump the packets, it seems the ca-cert didn't load properly, the dump from Wireshark looks like this:

52	0.496160	src_ip	dst_proxy_ip	TLSv1.3	79	60716	proxy_port	Alert (Level: Fatal, Description: Unknown CA)

I am pretty sure that the proxy I set in the yaml worked, only the ca-certs didn't mount, any suggestion or idea?

@skylinenzo commented on GitHub (Jun 10, 2025): Hi all, I have a similar issue like this. I am trying to add Volcengine in my air-gapped-behind-VPN Dify 1.3.1, and I got constantly 400 error of ``` api-1 | 2025-06-10 07:09:46.876 INFO [Thread-2 (process_request_thread)] [_internal.py:97] - 172.19.0.10 - - [10/Jun/2025 07:09:46] "POST /console/api/workspaces/current/model-providers/langgenius/volcengine_maas/volcengine_maas/models HTTP/1.1" 400 - ``` After some tcpdump tries, I focused on the plugin_daemon, I had already mount my ca-certs and set proxy server in docker-compose.yaml like this for plugin_daemon: ``` envs: HTTP_PROXY: http://server:port HTTPS_PROXY: http://server:port NO_PROXY: ssrf_proxy,api,weaviate,gdrant,db,redis,web,worker,sandbox,plugin_daemon,localhost,127.0.0.1,172.19.*.* ports: - "${EXPOSE_PLUGIN_DEBUGGING_PORT:-5003}:${PLUGIN_DEBUGGING_PORT:-5003}" volumes: - /etc/pki/tls/certs/ca-bundle.crt:/etc/ssl/certs/ca-certificates.crt - ./volumes/plugin_daemon:/app/storage ``` I can successfully curl the endpoint of volcengine and even access to API, however, when I add the model in the Volcengine plugin, it still got 400 error, when I dump the packets, it seems the ca-cert didn't load properly, the dump from Wireshark looks like this: ``` 52 0.496160 src_ip dst_proxy_ip TLSv1.3 79 60716 proxy_port Alert (Level: Fatal, Description: Unknown CA) ``` I am pretty sure that the proxy I set in the yaml worked, only the ca-certs didn't mount, any suggestion or idea?
Author
Owner

@knu-code commented on GitHub (Oct 28, 2025):

same problem

@knu-code commented on GitHub (Oct 28, 2025): same problem
Author
Owner

@fghpdf commented on GitHub (Jan 7, 2026):

Hi! I've submitted a PR to fix this issue: https://github.com/langgenius/dify-plugin-daemon/pull/562

The fix adds fallback support for lowercase proxy environment variables (http_proxy, https_proxy, no_proxy) when the uppercase versions (HTTP_PROXY, HTTPS_PROXY, NO_PROXY) are not set.

This maintains backward compatibility while supporting the common lowercase convention used by many tools.

@fghpdf commented on GitHub (Jan 7, 2026): Hi! I've submitted a PR to fix this issue: https://github.com/langgenius/dify-plugin-daemon/pull/562 The fix adds fallback support for lowercase proxy environment variables (`http_proxy`, `https_proxy`, `no_proxy`) when the uppercase versions (`HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY`) are not set. This maintains backward compatibility while supporting the common lowercase convention used by many tools.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13334