dify icon indicating copy to clipboard operation
dify copied to clipboard

plugins_daemon failed with squid proxy setup upon "poetry run flask install-plugins --workers=2"

Open leeseng-nie opened this issue 10 months ago • 3 comments

Self Checks

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

Dify version

1.0.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Our Dify environment has no direct internet connection and only Squid proxy.

I have configured following environment parameters correctly for Dify v0.15.3. HTTPS_PROXY, HTTP_PROXY, NO_PROXY

With similar proxy setup for plugin_daemon, I have following error after "poetry run flask install-plugins --workers=2"

✔️ Expected Behavior

plugins migrated without error

❌ Actual Behavior

docker compose logs -f:

plugin_daemon-1 | 2025/03/14 03:40:35 runtime_lifetime.go:70: [INFO]init environment for plugin langgenius/arxiv:0.0.2 plugin_daemon-1 | 2025/03/14 03:40:35 runtime_lifetime.go:76: [ERROR]init environment failed: failed to install dependencies: exit status 2, output: error : unexpected argument '--proxy' found plugin_daemon-1 | plugin_daemon-1 | tip: a similar argument exists: '--prefix' plugin_daemon-1 | plugin_daemon-1 | Usage: uv pip install --prefix <PREFIX> <PACKAGE|--requirements <REQUIREMENTS>|--editable <EDITABLE>> plugin_daemon-1 | plugin_daemon-1 | For more information, try '--help'. plugin_daemon-1 | , retry in 30s

leeseng-nie avatar Mar 14 '25 03:03 leeseng-nie

@leeseng-nie Hello! I'm here to help you with any bugs, questions, or contributions you have for Dify. Let me know how I can assist you while we wait for a human maintainer.

To resolve the error "unexpected argument '--proxy' found" when running "poetry run flask install-plugins --workers=2" with a Squid proxy setup in a self-hosted Dify environment, you should replace the plugin_daemon tag in your Docker configuration with 07d13bfb59acc422afa06436c7fdc5f3bc7e6554-local. This fix addresses the redundant proxy handling in the Python environment setup that was causing the error [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] avatar Mar 14 '25 03:03 dosubot[bot]

Still seeing error in docker compose logs -f as following after using image, plugin_daemon:07d13bfb59acc422afa06436c7fdc5f3bc7e6554-local :

sandbox-1 | [GIN] 2025/03/14 - 06:13:33 | 200 | 30.047µs | 127.0.0.1 | GET "/health" sandbox-1 | [GIN] 2025/03/14 - 06:14:03 | 200 | 29.096µs | 127.0.0.1 | GET "/health" plugin_daemon-1 | 2025/03/14 06:14:04 runtime_lifetime.go:76: [ERROR]init environment failed: failed to install dependencies: signal: killed, output: init process exited due to no activity for 120 seconds, retry in 30s sandbox-1 | [GIN] 2025/03/14 - 06:14:33 | 200 | 27.519µs | 127.0.0.1 | GET "/health" plugin_daemon-1 | 2025/03/14 06:14:34 runtime_lifetime.go:70: [INFO]init environment for plugin langgenius/arxiv:0.0.2 sandbox-1 | [GIN] 2025/03/14 - 06:15:03 | 200 | 25.009µs | 127.0.0.1 | GET "/health" sandbox-1 | [GIN] 2025/03/14 - 06:15:33 | 200 | 24.688µs | 127.0.0.1 | GET "/health" sandbox-1 | [GIN] 2025/03/14 - 06:16:03 | 200 | 83.72µs | 127.0.0.1 | GET "/health" sandbox-1 | [GIN] 2025/03/14 - 06:16:33 | 200 | 48.448µs | 127.0.0.1 | GET "/health" plugin_daemon-1 | 2025/03/14 06:16:34 runtime_lifetime.go:76: [ERROR]init environment failed: failed to install dependencies: signal: killed, output: init process exited due to no activity for 120 seconds, retry in 30s

leeseng-nie avatar Mar 14 '25 06:03 leeseng-nie

I encountered a similar error. When setting the proxy to the dify-plugin-daemon container at startup, I get:

"2025/03/18 14:18:49 runtime_lifetime.go:70: [INFO]init environment for plugin langgenius/azure_openai:0.0.82025/03/18 14:18:52 runtime_lifetime.go:76: [ERROR]init environment failed: failed to install dependencies: exit status 2, output: error: Failed to fetch: https://pypi.org/simple/tiktoken/ Caused by: Request failed after 3 retries Caused by: error sending request for url (https://pypi.org/simple/tiktoken/) Caused by: client error (Connect) Caused by: tcp connect error: Network is unreachable (os error 101) Caused by: Network is unreachable (os error 101), retry in 30s"

fedecompa avatar Mar 19 '25 08:03 fedecompa

Hi, @leeseng-nie. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You reported a problem with plugins_daemon failing to install plugins in a self-hosted Dify environment using a Squid proxy.
  • The issue was due to an unrecognized '--proxy' argument.
  • I suggested using a specific Docker image tag, but you continued to face errors related to dependency installation and inactivity signals.
  • Another user, Fedecompa, experienced similar errors, indicating potential network issues with PyPI dependencies, suggesting a broader proxy configuration or network accessibility problem.

Next Steps:

  • Please let us know if this issue is still relevant to the latest version of the Dify repository by commenting here.
  • If there is no further activity, this issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

dosubot[bot] avatar Apr 19 '25 16:04 dosubot[bot]