Plugin installation on multi-instances #156

Closed
opened 2026-02-16 00:20:12 -05:00 by yindo · 8 comments
Owner

Originally created by @plutonji on GitHub (Jul 7, 2025).

Self Checks

To make sure we get to you in time, please check the following :)

  • 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."

Versions

  1. dify-plugin-daemon 0.1.3
  2. dify-api Version 1.5.1

Describe the bug
I am running two instances of daemon_plugin in the system to achieve high availability (HA), with HAProxy acting as the load balancer at the traffic entry point.

However, a problem has arisen: when I install a plugin through the Dify interface, the plugin is only installed on one of the instances, and the other instance remains without it.

As a result, errors occur when requests are distributed by HAProxy to the instance where the plugin is not installed.

To Reproduce
Steps to reproduce the behavior:

  1. Startup two instances of plugin_daemon.
  2. Install Plugin via dify web.
  3. Test it.

Expected behavior
It should work.

Screenshots

Image Image

Additional context
Add any other context about the problem here.

Originally created by @plutonji on GitHub (Jul 7, 2025). **Self Checks** To make sure we get to you in time, please check the following :) - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify-plugin-daemon/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." **Versions** 1. dify-plugin-daemon 0.1.3 2. dify-api Version 1.5.1 **Describe the bug** I am running two instances of `daemon_plugin` in the system to achieve high availability (HA), with HAProxy acting as the load balancer at the traffic entry point. However, a problem has arisen: when I install a plugin through the Dify interface, the plugin is only installed on one of the instances, and the other instance remains without it. As a result, errors occur when requests are distributed by HAProxy to the instance where the plugin is not installed. **To Reproduce** Steps to reproduce the behavior: 1. Startup two instances of plugin_daemon. 2. Install Plugin via dify web. 3. Test it. **Expected behavior** It should work. **Screenshots** <img width="1069" height="471" alt="Image" src="https://github.com/user-attachments/assets/63062d0a-0e35-46b3-bdbe-6a8a4310eda1" /> <img width="1887" height="794" alt="Image" src="https://github.com/user-attachments/assets/1243aed4-3261-4fa8-b638-8b239803b844" /> **Additional context** Add any other context about the problem here.
yindo closed this issue 2026-02-16 00:20:12 -05:00
Author
Owner

@homejim commented on GitHub (Jul 8, 2025):

Dify’s plugin daemon leverages Redis for state management and includes custom routing rules. When all instances share the same Redis instance, the system ensures high availability by automatically routing plugin-related requests to any instance that has the required plugin installed. This prevents errors from occurring due to missing plugins on certain nodes.

In our service, which runs multiple plugin daemon instances, we’ve observed that even during deployment — when some instances may not have completed plugin installation — the system continues to operate smoothly without raising errors.

@homejim commented on GitHub (Jul 8, 2025): Dify’s plugin daemon leverages Redis for state management and includes custom routing rules. When all instances share the same Redis instance, the system ensures high availability by automatically routing plugin-related requests to any instance that has the required plugin installed. This prevents errors from occurring due to missing plugins on certain nodes. In our service, which runs multiple plugin daemon instances, we’ve observed that even during deployment — when some instances may not have completed plugin installation — the system continues to operate smoothly without raising errors.
Author
Owner

@xiaomeixw commented on GitHub (Aug 12, 2025):

This is an issue with the official design. You need to modify the code yourself to use the forced installation mode and skip the database detection mechanism.

@xiaomeixw commented on GitHub (Aug 12, 2025): This is an issue with the official design. You need to modify the code yourself to use the forced installation mode and skip the database detection mechanism.
Author
Owner

@xiaomeixw commented on GitHub (Aug 12, 2025):

Dify’s plugin daemon leverages Redis for state management and includes custom routing rules. When all instances share the same Redis instance, the system ensures high availability by automatically routing plugin-related requests to any instance that has the required plugin installed. This prevents errors from occurring due to missing plugins on certain nodes.

In our service, which runs multiple plugin daemon instances, we’ve observed that even during deployment — when some instances may not have completed plugin installation — the system continues to operate smoothly without raising errors.

Your response completely failed to understand the question. The user wants to implement load balancing. There are issues with your existing cluster mechanism. The user now wants to create a plugin distribution and processing mechanism. You only allow the installation of a single plugin. How is the user supposed to proceed?

@xiaomeixw commented on GitHub (Aug 12, 2025): > Dify’s plugin daemon leverages Redis for state management and includes custom routing rules. When all instances share the same Redis instance, the system ensures high availability by automatically routing plugin-related requests to any instance that has the required plugin installed. This prevents errors from occurring due to missing plugins on certain nodes. > > In our service, which runs multiple plugin daemon instances, we’ve observed that even during deployment — when some instances may not have completed plugin installation — the system continues to operate smoothly without raising errors. Your response completely failed to understand the question. The user wants to implement load balancing. There are issues with your existing cluster mechanism. The user now wants to create a plugin distribution and processing mechanism. You only allow the installation of a single plugin. How is the user supposed to proceed?
Author
Owner

@plutonji commented on GitHub (Aug 12, 2025):

This is an issue with the official design. You need to modify the code yourself to use the forced installation mode and skip the database detection mechanism.

Thanks

@plutonji commented on GitHub (Aug 12, 2025): > This is an issue with the official design. You need to modify the code yourself to use the forced installation mode and skip the database detection mechanism. Thanks
Author
Owner

@LeoLiuYan commented on GitHub (Aug 26, 2025):

This is an issue with the official design. You need to modify the code yourself to use the forced installation mode and skip the database detection mechanism.

Hi, when using the forced installation mode, will this cause traffic to be routed to nodes without the plugin installed?
BTW, how to use the forced installation mode?

@xiaomeixw @plutonji

@LeoLiuYan commented on GitHub (Aug 26, 2025): > This is an issue with the official design. You need to modify the code yourself to use the forced installation mode and skip the database detection mechanism. Hi, when using the forced installation mode, will this cause traffic to be routed to nodes without the plugin installed? BTW, how to use the forced installation mode? @xiaomeixw @plutonji
Author
Owner

@xiaomeixw commented on GitHub (Aug 26, 2025):

This is an issue with the official design. You need to modify the code yourself to use the forced installation mode and skip the database detection mechanism.

Hi, when using the forced installation mode, will this cause traffic to be routed to nodes without the plugin installed? BTW, how to use the forced installation mode?

@xiaomeixw @plutonji

@LeoLiuYan

Forced installation requires adjustments to the plugin's install-related api. Since multiple plugin servers in a cluster share the same database state, the official code will block the installation of plugins on other plugin servers in the cluster. Therefore, it is necessary to skip these database checks and implement forced installation.

@xiaomeixw commented on GitHub (Aug 26, 2025): > > This is an issue with the official design. You need to modify the code yourself to use the forced installation mode and skip the database detection mechanism. > > Hi, when using the forced installation mode, will this cause traffic to be routed to nodes without the plugin installed? BTW, how to use the forced installation mode? > > [@xiaomeixw](https://github.com/xiaomeixw) [@plutonji](https://github.com/plutonji) @LeoLiuYan Forced installation requires adjustments to the plugin's install-related api. Since multiple plugin servers in a cluster share the same database state, the official code will block the installation of plugins on other plugin servers in the cluster. Therefore, it is necessary to skip these database checks and implement forced installation.
Author
Owner

@fatelei commented on GitHub (Jan 10, 2026):

Installing sync dependencies relies on the object-storage adapter layer (installedBucket/packageBucket), which can point to S3/MinIO/Azure Blob/GCS or any other remote store.
Multi-machine setups work perfectly as long as every node is configured to use the same bucket/prefix.
Each node’s local working directory (PluginWorkingPath) is used to unpack and build the runtime environment (.venv); it is strongly recommended that every node use its own local disk instead of a shared one. This prevents concurrency collisions; if you must share, add distributed locking.
Multi-node HA checklist
Both instances use the same remote object store:
– PLUGIN_STORAGE_TYPE set to s3/minio/azure/gcs (never “local”)
– Identical bucket, endpoint and credentials
– PLUGIN_INSTALLED_PATH and PLUGIN_PACKAGE_CACHE_PATH identical (same prefix)
PLATFORM=local; WatchDog scans the installedBucket once at start-up and then every 30 s on every node.
PluginWorkingPath must be node-local; if shared, enable distributed locking to serialize environment initialization for the same plugin.
Minimal example (two instances sharing one MinIO/S3 bucket) – environment variables must be identical on both sides.

@fatelei commented on GitHub (Jan 10, 2026): Installing sync dependencies relies on the object-storage adapter layer (installedBucket/packageBucket), which can point to S3/MinIO/Azure Blob/GCS or any other remote store. Multi-machine setups work perfectly as long as every node is configured to use the same bucket/prefix. Each node’s local working directory (PluginWorkingPath) is used to unpack and build the runtime environment (.venv); it is strongly recommended that every node use its own local disk instead of a shared one. This prevents concurrency collisions; if you must share, add distributed locking. Multi-node HA checklist Both instances use the same remote object store: – PLUGIN_STORAGE_TYPE set to s3/minio/azure/gcs (never “local”) – Identical bucket, endpoint and credentials – PLUGIN_INSTALLED_PATH and PLUGIN_PACKAGE_CACHE_PATH identical (same prefix) PLATFORM=local; WatchDog scans the installedBucket once at start-up and then every 30 s on every node. PluginWorkingPath must be node-local; if shared, enable distributed locking to serialize environment initialization for the same plugin. Minimal example (two instances sharing one MinIO/S3 bucket) – environment variables must be identical on both sides.
Author
Owner

@plutonji commented on GitHub (Jan 12, 2026):

@fatelei Thank you for your reply. Although our offline server intranet does not have an object storage service, we do have a NAS server that can provide NFS Server v3. Therefore, I tried setting PLUGIN_STORAGE_LOCAL_ROOT to the shared NFS directory, while keeping PLUGIN_WORKING_PATH as the local directory /app/storage/cwd. Sure enough, the error no longer occurred!
Thank you again for the information you provided!

@plutonji commented on GitHub (Jan 12, 2026): @fatelei Thank you for your reply. Although our offline server intranet does not have an object storage service, we do have a NAS server that can provide NFS Server v3. Therefore, I tried setting PLUGIN_STORAGE_LOCAL_ROOT to the shared NFS directory, while keeping PLUGIN_WORKING_PATH as the local directory /app/storage/cwd. Sure enough, the error no longer occurred! Thank you again for the information you provided!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-daemon#156