init environment failed: failed to install dependencies: exit status 2, output: error: Failed to fetch: https://pypi.tuna.tsinghua.edu.cn/simple/dify-plugin/ #11995

Closed
opened 2026-02-21 19:05:10 -05:00 by yindo · 5 comments
Owner

Originally created by @volongoto on GitHub (Mar 23, 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.1.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I am using version 1.1.1, dify-plugin-daemon version: 0.0.6-local,
[ERROR]init environment failed: failed to install dependencies: exit status 2, output: error: Failed to fetch: https://pypi.tuna.tsinghua.edu.cn/simple/openai/Caused by: Could not connect, are you offline? Caused by: Request failed after 3 retries Caused by: error sending request for url (https://pypi.tuna.tsinghua.edu.cn/simple/openai/) Caused by: client error (Connect) Caused by: dns error: failed to lookup address information: Temporary failure in name resolution Caused by: failed to lookup address information: Temporary failure in name resolution , retry in 30s [GIN] 2025/03/23 - 04:56:52 | 200 | 9.652219ms | 172.21.0.8 | GET "/plugin/47228023-b57c-44ea-9016-735b4decaf75/management/models?page=1&page_size=256" 2025/03/23 04:56:57 runtime_lifetime.go:76: [ERROR]init environment failed: failed to install dependencies: exit status 2, output: error: Failed to fetch:https://pypi.tuna.tsinghua.edu.cn/simple/dify-plugin/`
Caused by: Could not connect, are you offline?
Caused by: Request failed after 3 retries
Caused by: error sending request for url (https://pypi.tuna.tsinghua.edu.cn/simple/dify-plugin/)
Caused by: client error (Connect)
Caused by: dns error: failed to lookup address information: Temporary failure in name resolution
Caused by: failed to lookup address information: Temporary failure in name resolution
, retry in 30s

`
After entering the container, I manually downloaded the corresponding dify_plugin dependencies, but it still reported an error.

`
root@2149fb69af59:/app# pip list |grep dify
dify_plugin 0.0.1b65

`

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @volongoto on GitHub (Mar 23, 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.1.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I am using version 1.1.1, dify-plugin-daemon version: 0.0.6-local, `[ERROR]init environment failed: failed to install dependencies: exit status 2, output: error: Failed to fetch: `https://pypi.tuna.tsinghua.edu.cn/simple/openai/` Caused by: Could not connect, are you offline? Caused by: Request failed after 3 retries Caused by: error sending request for url (https://pypi.tuna.tsinghua.edu.cn/simple/openai/) Caused by: client error (Connect) Caused by: dns error: failed to lookup address information: Temporary failure in name resolution Caused by: failed to lookup address information: Temporary failure in name resolution , retry in 30s [GIN] 2025/03/23 - 04:56:52 | 200 | 9.652219ms | 172.21.0.8 | GET "/plugin/47228023-b57c-44ea-9016-735b4decaf75/management/models?page=1&page_size=256" 2025/03/23 04:56:57 runtime_lifetime.go:76: [ERROR]init environment failed: failed to install dependencies: exit status 2, output: error: Failed to fetch: `https://pypi.tuna.tsinghua.edu.cn/simple/dify-plugin/` Caused by: Could not connect, are you offline? Caused by: Request failed after 3 retries Caused by: error sending request for url (https://pypi.tuna.tsinghua.edu.cn/simple/dify-plugin/) Caused by: client error (Connect) Caused by: dns error: failed to lookup address information: Temporary failure in name resolution Caused by: failed to lookup address information: Temporary failure in name resolution , retry in 30s ` After entering the container, I manually downloaded the corresponding dify_plugin dependencies, but it still reported an error. ` root@2149fb69af59:/app# pip list |grep dify dify_plugin 0.0.1b65 ` ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-21 19:05:10 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 23, 2025):

I found a similar open issue that might help you resolve the DNS resolution failure and connection errors when trying to install dependencies for the dify-plugin in a self-hosted Docker environment using the Tsinghua University PyPI mirror. The recommended approach is to set the PIP_MIRROR_URL environment variable specifically within the plugin_daemon's container. This is because the dify_plugin packages are not available on the Tsinghua mirror, and setting the mirror URL globally may not work. Ensure that the PIP_MIRROR_URL is correctly configured in the docker-compose.yaml file to 'https://pypi.tuna.tsinghua.edu.cn/simple' for other packages, but handle the dify_plugin packages separately within the container [1][2][3].

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 (Mar 23, 2025): <!-- Answer --> I found a similar open issue that might help you resolve the DNS resolution failure and connection errors when trying to install dependencies for the dify-plugin in a self-hosted Docker environment using the Tsinghua University PyPI mirror. The recommended approach is to set the `PIP_MIRROR_URL` environment variable specifically within the `plugin_daemon`'s container. This is because the dify_plugin packages are not available on the Tsinghua mirror, and setting the mirror URL globally may not work. Ensure that the `PIP_MIRROR_URL` is correctly configured in the `docker-compose.yaml` file to 'https://pypi.tuna.tsinghua.edu.cn/simple' for other packages, but handle the dify_plugin packages separately within the container <sup>[[1]](https://github.com/langgenius/dify/issues/16418)</sup><sup>[[2]](https://github.com/langgenius/dify/issues/15538)</sup><sup>[[3]](https://github.com/langgenius/dify/issues/14579)</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/ef2c54ce-e7a3-4e32-8dde-b8de56c19793?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/ef2c54ce-e7a3-4e32-8dde-b8de56c19793?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/ef2c54ce-e7a3-4e32-8dde-b8de56c19793?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/ef2c54ce-e7a3-4e32-8dde-b8de56c19793?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ef2c54ce-e7a3-4e32-8dde-b8de56c19793?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/ef2c54ce-e7a3-4e32-8dde-b8de56c19793?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/ef2c54ce-e7a3-4e32-8dde-b8de56c19793?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Mar 23, 2025):

dns error: failed to lookup address information: Temporary failure in name resolution

You should check your proxy settings.

@crazywoola commented on GitHub (Mar 23, 2025): ``` dns error: failed to lookup address information: Temporary failure in name resolution ``` You should check your proxy settings.
Author
Owner

@volongoto commented on GitHub (Mar 23, 2025):

I found the source code of dify_plugin_daemon and discovered that the proxy configuration items http_proxy and https_proxy need to be in uppercase to take effect. Thank you. The issue has been resolved.
like this:
HTTP_PROXY: 127.0.0.1:7890 HTTPS_PROXY: 127.0.0.1:7890

@volongoto commented on GitHub (Mar 23, 2025): I found the source code of dify_plugin_daemon and discovered that the proxy configuration items http_proxy and https_proxy need to be in uppercase to take effect. Thank you. The issue has been resolved. like this: ` HTTP_PROXY: 127.0.0.1:7890 HTTPS_PROXY: 127.0.0.1:7890 `
Author
Owner

@maijing274 commented on GitHub (Apr 26, 2025):

我找到了 dify_plugin_daemon 的源码,发现代理配置项 http_proxy 和 https_proxy 需要大写才能生效。谢谢。此问题已解决。 喜欢这个: HTTP_PROXY: 127.0.0.1:7890 HTTPS_PROXY: 127.0.0.1:7890

请问是在哪个文件改呢

@maijing274 commented on GitHub (Apr 26, 2025): > 我找到了 dify_plugin_daemon 的源码,发现代理配置项 http_proxy 和 https_proxy 需要大写才能生效。谢谢。此问题已解决。 喜欢这个: `HTTP_PROXY: 127.0.0.1:7890 HTTPS_PROXY: 127.0.0.1:7890` 请问是在哪个文件改呢
Author
Owner

@biao001 commented on GitHub (May 15, 2025):

我发现了一个类似的公开问题,它可能有助于您解决在自托管 Docker 环境中尝试安装 dify-plugin 时出现的 DNS 解析失败和连接错误的问题。推荐的方法是在 plugin_daemon 容器内设置 PIP_MIRROR_URL 环境变量。因为 dify_plugin 包在 Tsinghua 镜像中不可用,设置镜像 URL 可能不会生效。确保在 docker-compose.yaml 文件中正确配置 PIP_MIRROR_URL 为 'https://pypi.tuna.tsinghua.edu.cn/simple' 以便其他包可以使用,但在容器内单独处理 dify_plugin 包 [1][2][3]

要继续与 Dosu 通信,请提及 。

帮助 Dosu 学习!给予它反馈: 伟大回应 | 无关回答 | 错误来源 | 太冗长 | 幻觉 | Bug 报告 | 其他

容器内设置成哪个源呢,我设置成清华园仍然报错

@biao001 commented on GitHub (May 15, 2025): > 我发现了一个类似的公开问题,它可能有助于您解决在自托管 Docker 环境中尝试安装 dify-plugin 时出现的 DNS 解析失败和连接错误的问题。推荐的方法是在 `plugin_daemon` 容器内设置 `PIP_MIRROR_URL` 环境变量。因为 dify_plugin 包在 Tsinghua 镜像中不可用,设置镜像 URL 可能不会生效。确保在 `docker-compose.yaml` 文件中正确配置 [PIP_MIRROR_URL 为 '](https://pypi.tuna.tsinghua.edu.cn/simple)https://pypi.tuna.tsinghua.edu.cn/simple' 以便其他包可以使用,但在容器内单独处理 dify_plugin 包 [[1]](https://github.com/langgenius/dify/issues/16418)[[2]](https://github.com/langgenius/dify/issues/15538)[[3]](https://github.com/langgenius/dify/issues/14579)。 > > _要继续与 [Dosu](https://dosu.dev) 通信,请提及 。_ > > 帮助 Dosu 学习!给予它反馈: 伟大回应 | 无关回答 | 错误来源 | 太冗长 | 幻觉 | Bug 报告 | 其他 容器内设置成哪个源呢,我设置成清华园仍然报错
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#11995