Skip to content

fix:When there are multiple pods, upgrading the plugin can cause a null pointer error in the plugin-daemon. #207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gaoyue1989
Copy link
Contributor

This is the final execution directory for the Python plugin. Each time a pod restarts, it reads the plugin from the PLUGIN_STORAGE_LOCAL_ROOT directory and installs it, so there’s no need to place it in a shared directory. However, when multiple pods perform upgrade or other write operations on the plugin simultaneously, it can cause issues with the plugin directory, making the plugin inaccessible.

warlocgao and others added 3 commits June 12, 2025 10:10
…ll pointer error in the plugin-daemon.

This is the final execution directory for the Python plugin. Each time a pod restarts, it reads the plugin from the PLUGIN_STORAGE_LOCAL_ROOT directory and installs it, so there’s no need to place it in a shared directory. However, when multiple pods perform upgrade or other write operations on the plugin simultaneously, it can cause issues with the plugin directory, making the plugin inaccessible.
…ll pointer error in the plugin-daemon.

This is the final execution directory for the Python plugin. Each time a pod restarts, it reads the plugin from the PLUGIN_STORAGE_LOCAL_ROOT directory and installs it, so there’s no need to place it in a shared directory. However, when multiple pods perform upgrade or other write operations on the plugin simultaneously, it can cause issues with the plugin directory, making the plugin inaccessible.
@BorisPolonsky
Copy link
Owner

BorisPolonsky commented Jun 12, 2025

According to the documents from dify-plugin-daemon:

  • pluginDaemon depends on a shared cwd directory for running plugins
  • Daemon community edition are not designed to be seamlessly scaled out as multiple replicas.

Hardcoding PLUGIN_WORKING_PATH doesn't comply with the document and will break backward compatibility.

You may wish to override PLUGIN_WORKING_PATH with a different directory through pluginDaemon.extraEnv in order not to share cwd over replicas, while using PVC for data persistence.

As an alternative, you may also opt in externalS3 for data persistence of pluginDaemon (available since dify-helm-0.24.0). In this way each replica of pluginDaemon shares no persistent volume. Note that you still need to do the data migration yourself for this approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants