plugins are not installed when plugin-daemon is restarted and plugins are stored on s3 #14

Closed
opened 2026-02-16 00:19:02 -05:00 by yindo · 0 comments
Owner

Originally created by @tmokmss on GitHub (Feb 26, 2025).

When we restart a plugin daemon, the plugins that were installed previously are not re-installed and become unavailable when we use S3 bucket as a plugin installation location.

Here's the root cause:

Usually localWatcher automatically installs the plugins that are in installation locatiion.

https://github.com/langgenius/dify-plugin-daemon/blob/109050dc16f85068133841f351b6a26a15a97549/internal/core/plugin_manager/watcher.go#L14-L23

handleNewLocalPlugins searches the previously installed plugins from installedBucket.

https://github.com/langgenius/dify-plugin-daemon/blob/109050dc16f85068133841f351b6a26a15a97549/internal/core/plugin_manager/watcher.go#L69-L75

installedBucket.List first check the existence of the directory by the Exists function.

https://github.com/langgenius/dify-plugin-daemon/blob/109050dc16f85068133841f351b6a26a15a97549/internal/core/plugin_manager/media_transport/installed_bucket.go#L50-L60

Finally, when we use S3 as a installedBucket, we use HeadObject API to check the existence.

https://github.com/langgenius/dify-plugin-daemon/blob/109050dc16f85068133841f351b6a26a15a97549/internal/oss/s3/s3_storage.go#L86-L90

So basically HeadObject({bucket, key: "plugins"}) is called. However, because S3 does not have the concept of directory, the object plugins cannot be found, even when there are objects such as plugins/langgenius/github:0.0.2@e65.... This results in wrong decision that there is no plugins installed, and plugin-daemon fails to install the plugins when restarted.

Originally created by @tmokmss on GitHub (Feb 26, 2025). When we restart a plugin daemon, the plugins that were installed previously are not re-installed and become unavailable when we use S3 bucket as a plugin installation location. Here's the root cause: Usually localWatcher automatically installs the plugins that are in installation locatiion. https://github.com/langgenius/dify-plugin-daemon/blob/109050dc16f85068133841f351b6a26a15a97549/internal/core/plugin_manager/watcher.go#L14-L23 handleNewLocalPlugins searches the previously installed plugins from installedBucket. https://github.com/langgenius/dify-plugin-daemon/blob/109050dc16f85068133841f351b6a26a15a97549/internal/core/plugin_manager/watcher.go#L69-L75 installedBucket.List first check the existence of the directory by the Exists function. https://github.com/langgenius/dify-plugin-daemon/blob/109050dc16f85068133841f351b6a26a15a97549/internal/core/plugin_manager/media_transport/installed_bucket.go#L50-L60 Finally, when we use S3 as a installedBucket, we use HeadObject API to check the existence. https://github.com/langgenius/dify-plugin-daemon/blob/109050dc16f85068133841f351b6a26a15a97549/internal/oss/s3/s3_storage.go#L86-L90 So basically `HeadObject({bucket, key: "plugins"})` is called. However, because S3 does not have the concept of directory, the object `plugins` cannot be found, even when there are objects such as `plugins/langgenius/github:0.0.2@e65...`. This results in wrong decision that there is no plugins installed, and plugin-daemon fails to install the plugins when restarted.
yindo closed this issue 2026-02-16 00:19:03 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-daemon#14