dify icon indicating copy to clipboard operation
dify copied to clipboard

Got error when install plugin in the offline env

Open dickens88 opened this issue 9 months ago • 2 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

v1.0.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Hi,

I installed Dify v1.0.1 in a offline env which means it can not connect to internet directly. I download ollama plugin from marketplace and install the plugin from my pc. During the installation it get the following error.

plugin_daemon_1          | 2025/03/14 19:30:44 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

I thought It was becuase there is no dependencies in the docker env. So is that means the latest version can not be used in the offline system?

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

dickens88 avatar Mar 14 '25 19:03 dickens88

I found some relevant discussions and issues regarding plugin installation in offline environments for Dify:

  1. dify1.0.0 cannot be used offline? - This discussion is open and addresses similar concerns about using Dify offline [1].

  2. Help with completely offline usage - Another open discussion that might provide insights into handling offline installations [2].

  3. After deploying v1.0-beta via Docker, plugins cannot be installed. - This discussion is also open and discusses issues with plugin installations in offline environments [3].

For your specific issue, the error you're encountering is likely due to missing dependencies in the Docker environment, which is a known limitation when using Dify offline. To resolve this, you can follow these steps:

  1. Simulate Installation with Network Access: On a machine with internet access, simulate the plugin installation to gather all necessary dependencies.

  2. Package the Plugin: Ensure your plugin is packaged into a .difypkg file. This allows for manual upload and installation in offline environments.

  3. Create a Docker Image: Use a multi-stage Docker build process to create an image that includes the installed plugin and all its dependencies.

  4. Transfer the Docker Image: Export and transfer this Docker image to your offline environment.

  5. Load the Image: Load the image in the offline environment.

  6. Configure Docker-Compose: Use this image in your docker-compose configuration to ensure all dependencies are available [4].

This approach should help you install the plugin without requiring internet access.

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 19:03 dosubot[bot]

well... I think I got a solution. I added my internal PIP source into docker-compose.yaml. The key setting is PIP_MIRROR_URL.

dickens88 avatar Mar 14 '25 20:03 dickens88

While if there's no pypi source in internal network, how may I install the plugin manually? I just encount the same issue. Why don't the developer concurn the full offline senario?

haopdf avatar May 02 '25 05:05 haopdf

It doesn't help. I've mentioned that there's no internal pypi source, how may I know which dependicies I need to install? Why don't you package the full plugin to a package with dependencies? Is there any other way to solve it? Of course, I've download the plugin from marketplace and uploaded it.

haopdf avatar May 03 '25 12:05 haopdf

It doesn't help. I've mentioned that there's no internal pypi source, how may I know which dependicies I need to install? Why don't you package the full plugin to a package with dependencies? Is there any other way to solve it? Of course, I've download the plugin from marketplace and uploaded it.

Any progress?

connor-john-x avatar May 08 '25 02:05 connor-john-x