PluginDaemonInternalServerError: no available node, plugin not found #27

Open
opened 2026-02-16 00:19:10 -05:00 by yindo · 16 comments
Owner

Originally created by @PittyXu on GitHub (Mar 6, 2025).

I installed 6 plugins, but only 3 plugins were loaded when I started, and an error that the plugin could not be found when I called was reported. I use a local installation plugin, and the installation is often unsuccessful, so most of my plugins are installed manually (copy the plugin source code to the cwd directory and run /usr/bin/python3 -m venv .venv, and add relevant records in the database. The dify interface is displayed without any problem, but the call is reported when it is not loaded)

Version: Docker 0.0.3-local,

Image

2025/03/06 19:30:01 pool.go:32: [INFO]init routine pool, size: 10
2025/03/06 19:30:01 init.go:149: [INFO]dify plugin db initialized
2025/03/06 19:30:01 manager.go:143: [INFO]start plugin manager daemon...
2025/03/06 19:30:01 init.go:19: [INFO]Persistence initialized
2025/03/06 19:30:01 watcher.go:16: [INFO]start to handle new plugins in path: plugins
2025/03/06 19:30:01 runtime_lifetime.go:40: [INFO]new plugin logged in: langgenius/agent:0.0.9
2025/03/06 19:30:01 runtime_lifetime.go:70: [INFO]init environment for plugin langgenius/agent:0.0.9
2025/03/06 19:30:01 run.go:143: [INFO]plugin langgenius/agent:0.0.9 started
2025/03/06 19:30:01 runtime_lifetime.go:40: [INFO]new plugin logged in: langgenius/echarts:0.0.1
2025/03/06 19:30:01 runtime_lifetime.go:70: [INFO]init environment for plugin langgenius/echarts:0.0.1
2025/03/06 19:30:01 run.go:143: [INFO]plugin langgenius/echarts:0.0.1 started
[gnet] 2025-03-06T19:30:01.335768088+08:00	INFO	logging/logger.go:256	Launching gnet with 8 event-loops, listening on: tcp://0.0.0.0:5003
2025/03/06 19:30:01 runtime_lifetime.go:40: [INFO]new plugin logged in: langgenius/ollama:0.0.3
2025/03/06 19:30:01 runtime_lifetime.go:70: [INFO]init environment for plugin langgenius/ollama:0.0.3
2025/03/06 19:30:01 run.go:143: [INFO]plugin langgenius/ollama:0.0.3 started
2025/03/06 19:30:07 stdio_handle.go:115: [INFO]plugin langgenius/ollama:0.0.3: Installed model: ollama
2025/03/06 19:30:07 stdio_handle.go:115: [INFO]plugin langgenius/echarts:0.0.1: Installed tool: echarts
2025/03/06 19:30:07 stdio_handle.go:115: [INFO]plugin langgenius/agent:0.0.9: Installed agent: agent
2025/03/06 19:30:31 cluster_lifetime.go:113: [INFO]current node has become the master of the cluster
2025/03/06 19:30:31 node.go:213: [INFO]node 63b52f7f-82ab-4d78-9a18-3cc84dadfdec has been removed from the cluster due to being disconnected
2025/03/06 19:30:31 node.go:213: [INFO]node 0fa1e1ea-9764-4a3e-bb66-223987c998d4 has been removed from the cluster due to being disconnected
[GIN] 2025/03/07 - 10:47:50 | 200 |   14.308926ms |     10.71.8.229 | GET      "/plugin/32cdc1de-89e7-418a-bf89-e6f4c6dea677/management/install/tasks?page=1&page_size=100"
2025/03/07 10:48:10 factory.go:28: [ERROR]PluginDaemonInternalServerError: no available node, plugin not found
goroutine 78 [running]:
runtime/debug.Stack()
	/usr/local/go/src/runtime/debug/stack.go:24 +0x5e
github.com/langgenius/dify-plugin-daemon/internal/types/exception.InternalServerError({0x180b640, 0xc00057c3c0})
	/app/internal/types/exception/factory.go:27 +0x27
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).redirectPluginInvokeByPluginIdentifier(0xc00012a348, 0xc0000e8600, {0xc0000fe060?, 0xe98ebf?}, {0x180b640, 0xc00057c370})
	/app/internal/server/middleware.go:120 +0xef
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).RedirectPluginInvoke.func2(0xc0000e8600)
	/app/internal/server/middleware.go:94 +0x95
github.com/gin-gonic/gin.(*Context).Next(0xc0000e8600)
	/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).FetchPluginInstallation.func1(0xc0000e8600)
	/app/internal/server/middleware.go:66 +0x2f2
github.com/gin-gonic/gin.(*Context).Next(0xc0000e8600)
	/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginGroup.CheckingKey.func1(0xc0000e8600)
	/app/internal/server/middleware.go:24 +0x95
github.com/gin-gonic/gin.(*Context).Next(...)
	/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1(0xc0000e8600)
	/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102 +0x7a
github.com/gin-gonic/gin.(*Context).Next(...)
	/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.LoggerWithConfig.func1(0xc0000e8600)
	/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 +0xe5
github.com/gin-gonic/gin.(*Context).Next(...)
	/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc0001736c0, 0xc0000e8600)
	/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633 +0x892
github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc0001736c0, {0x181dac0, 0xc0004de000}, 0xc000566120)
	/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589 +0x1b2
net/http.serverHandler.ServeHTTP({0x1813868?}, {0x181dac0?, 0xc0004de000?}, 0x6?)
	/usr/local/go/src/net/http/server.go:3142 +0x8e
net/http.(*conn).serve(0xc000468000, {0x1820270, 0xc000118e70})
	/usr/local/go/src/net/http/server.go:2044 +0x5e8
created by net/http.(*Server).Serve in goroutine 90
	/usr/local/go/src/net/http/server.go:3290 +0x4b4
Originally created by @PittyXu on GitHub (Mar 6, 2025). I installed 6 plugins, but only 3 plugins were loaded when I started, and an error that the plugin could not be found when I called was reported. I use a local installation plugin, and the installation is often unsuccessful, so most of my plugins are installed manually (copy the plugin source code to the cwd directory and run `/usr/bin/python3 -m venv .venv`, and add relevant records in the database. The dify interface is displayed without any problem, but the call is reported when it is not loaded) Version: Docker 0.0.3-local, ![Image](https://github.com/user-attachments/assets/0d33eaef-0ebb-4efe-95bf-42ce7a705cb7) ```log 2025/03/06 19:30:01 pool.go:32: [INFO]init routine pool, size: 10 2025/03/06 19:30:01 init.go:149: [INFO]dify plugin db initialized 2025/03/06 19:30:01 manager.go:143: [INFO]start plugin manager daemon... 2025/03/06 19:30:01 init.go:19: [INFO]Persistence initialized 2025/03/06 19:30:01 watcher.go:16: [INFO]start to handle new plugins in path: plugins 2025/03/06 19:30:01 runtime_lifetime.go:40: [INFO]new plugin logged in: langgenius/agent:0.0.9 2025/03/06 19:30:01 runtime_lifetime.go:70: [INFO]init environment for plugin langgenius/agent:0.0.9 2025/03/06 19:30:01 run.go:143: [INFO]plugin langgenius/agent:0.0.9 started 2025/03/06 19:30:01 runtime_lifetime.go:40: [INFO]new plugin logged in: langgenius/echarts:0.0.1 2025/03/06 19:30:01 runtime_lifetime.go:70: [INFO]init environment for plugin langgenius/echarts:0.0.1 2025/03/06 19:30:01 run.go:143: [INFO]plugin langgenius/echarts:0.0.1 started [gnet] 2025-03-06T19:30:01.335768088+08:00 INFO logging/logger.go:256 Launching gnet with 8 event-loops, listening on: tcp://0.0.0.0:5003 2025/03/06 19:30:01 runtime_lifetime.go:40: [INFO]new plugin logged in: langgenius/ollama:0.0.3 2025/03/06 19:30:01 runtime_lifetime.go:70: [INFO]init environment for plugin langgenius/ollama:0.0.3 2025/03/06 19:30:01 run.go:143: [INFO]plugin langgenius/ollama:0.0.3 started 2025/03/06 19:30:07 stdio_handle.go:115: [INFO]plugin langgenius/ollama:0.0.3: Installed model: ollama 2025/03/06 19:30:07 stdio_handle.go:115: [INFO]plugin langgenius/echarts:0.0.1: Installed tool: echarts 2025/03/06 19:30:07 stdio_handle.go:115: [INFO]plugin langgenius/agent:0.0.9: Installed agent: agent 2025/03/06 19:30:31 cluster_lifetime.go:113: [INFO]current node has become the master of the cluster 2025/03/06 19:30:31 node.go:213: [INFO]node 63b52f7f-82ab-4d78-9a18-3cc84dadfdec has been removed from the cluster due to being disconnected 2025/03/06 19:30:31 node.go:213: [INFO]node 0fa1e1ea-9764-4a3e-bb66-223987c998d4 has been removed from the cluster due to being disconnected [GIN] 2025/03/07 - 10:47:50 | 200 | 14.308926ms | 10.71.8.229 | GET "/plugin/32cdc1de-89e7-418a-bf89-e6f4c6dea677/management/install/tasks?page=1&page_size=100" 2025/03/07 10:48:10 factory.go:28: [ERROR]PluginDaemonInternalServerError: no available node, plugin not found goroutine 78 [running]: runtime/debug.Stack() /usr/local/go/src/runtime/debug/stack.go:24 +0x5e github.com/langgenius/dify-plugin-daemon/internal/types/exception.InternalServerError({0x180b640, 0xc00057c3c0}) /app/internal/types/exception/factory.go:27 +0x27 github.com/langgenius/dify-plugin-daemon/internal/server.(*App).redirectPluginInvokeByPluginIdentifier(0xc00012a348, 0xc0000e8600, {0xc0000fe060?, 0xe98ebf?}, {0x180b640, 0xc00057c370}) /app/internal/server/middleware.go:120 +0xef github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).RedirectPluginInvoke.func2(0xc0000e8600) /app/internal/server/middleware.go:94 +0x95 github.com/gin-gonic/gin.(*Context).Next(0xc0000e8600) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginDispatchGroup.(*App).FetchPluginInstallation.func1(0xc0000e8600) /app/internal/server/middleware.go:66 +0x2f2 github.com/gin-gonic/gin.(*Context).Next(0xc0000e8600) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b github.com/langgenius/dify-plugin-daemon/internal/server.(*App).pluginGroup.CheckingKey.func1(0xc0000e8600) /app/internal/server/middleware.go:24 +0x95 github.com/gin-gonic/gin.(*Context).Next(...) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1(0xc0000e8600) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102 +0x7a github.com/gin-gonic/gin.(*Context).Next(...) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 github.com/gin-gonic/gin.LoggerWithConfig.func1(0xc0000e8600) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 +0xe5 github.com/gin-gonic/gin.(*Context).Next(...) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc0001736c0, 0xc0000e8600) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633 +0x892 github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc0001736c0, {0x181dac0, 0xc0004de000}, 0xc000566120) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589 +0x1b2 net/http.serverHandler.ServeHTTP({0x1813868?}, {0x181dac0?, 0xc0004de000?}, 0x6?) /usr/local/go/src/net/http/server.go:3142 +0x8e net/http.(*conn).serve(0xc000468000, {0x1820270, 0xc000118e70}) /usr/local/go/src/net/http/server.go:2044 +0x5e8 created by net/http.(*Server).Serve in goroutine 90 /usr/local/go/src/net/http/server.go:3290 +0x4b4 ```
Author
Owner

@Yeuoly commented on GitHub (Mar 10, 2025):

Looks like plugins are not installed fully, you can refer to cwd directory under /storage, it's the plugin that were installed successfully, I have fixed an issue related to this, you can try the latest image tag 6ce5373848d1c25ec939a358a26ab5007f75b572-local and observe will this happen again

@Yeuoly commented on GitHub (Mar 10, 2025): Looks like plugins are not installed fully, you can refer to `cwd` directory under `/storage`, it's the plugin that were installed successfully, I have fixed an issue related to this, you can try the latest image tag 6ce5373848d1c25ec939a358a26ab5007f75b572-local and observe will this happen again
Author
Owner

@PittyXu commented on GitHub (Mar 10, 2025):

Looks like plugins are not installed fully, you can refer to cwd directory under /storage, it's the plugin that were installed successfully, I have fixed an issue related to this, you can try the latest image tag 6ce5373-local and observe will this happen again

Still doesn't work, I switch the files in the plugin directory, 3 plugins can only be loaded, switching different plugins these three are able to work properly!

@PittyXu commented on GitHub (Mar 10, 2025): > Looks like plugins are not installed fully, you can refer to `cwd` directory under `/storage`, it's the plugin that were installed successfully, I have fixed an issue related to this, you can try the latest image tag [6ce5373](https://github.com/langgenius/dify-plugin-daemon/commit/6ce5373848d1c25ec939a358a26ab5007f75b572)-local and observe will this happen again Still doesn't work, I switch the files in the `plugin` directory, 3 plugins can only be loaded, switching different plugins these three are able to work properly!
Author
Owner

@Sakura4036 commented on GitHub (Mar 10, 2025):

plugin-daemon docker version: langgenius/dify-plugin-daemon:8ab1e2a91ea1ea6bf90bdb83abc6d15a9bc8965f-local

install ollama env failed, because of the network problem. but if you install it twice, the dify web will show install successfully which is not!

2025/03/11 03:25:22 runtime_lifetime.go:76: [ERROR]init environment failed: failed to install dependencies: signal: killed, output: Resolved 38 packages in 42ms
Downloading gevent (6.4MiB)
Downloading numpy (15.3MiB)
init process exited due to no activity for 120 seconds, retry in 30s
2025/03/11 03:25:52 runtime_lifetime.go:70: [INFO]init environment for plugin langgenius/ollama:0.0.3
2025/03/11 03:25:52 watcher.go:85: [ERROR]plugin launch error: init environment for plugin langgenius/ollama:0.0.3 failed too many times, you should consider the package is corrupted or your network is unstable

So how to install env in China mainland? like using http proxy and how?

@Sakura4036 commented on GitHub (Mar 10, 2025): plugin-daemon docker version: `langgenius/dify-plugin-daemon:8ab1e2a91ea1ea6bf90bdb83abc6d15a9bc8965f-local` install ollama env failed, because of the network problem. but if you install it twice, the dify web will show install successfully which is not! ```shell 2025/03/11 03:25:22 runtime_lifetime.go:76: [ERROR]init environment failed: failed to install dependencies: signal: killed, output: Resolved 38 packages in 42ms Downloading gevent (6.4MiB) Downloading numpy (15.3MiB) init process exited due to no activity for 120 seconds, retry in 30s 2025/03/11 03:25:52 runtime_lifetime.go:70: [INFO]init environment for plugin langgenius/ollama:0.0.3 2025/03/11 03:25:52 watcher.go:85: [ERROR]plugin launch error: init environment for plugin langgenius/ollama:0.0.3 failed too many times, you should consider the package is corrupted or your network is unstable ``` So how to install env in China mainland? like using http proxy and how?
Author
Owner

@yozi9257 commented on GitHub (Mar 10, 2025):

Is there any way to be a pip source?

@yozi9257 commented on GitHub (Mar 10, 2025): Is there any way to be a pip source?
Author
Owner

@Sakura4036 commented on GitHub (Mar 11, 2025):

I found a way to install plugin env:

  1. docker exec plugin-daemon
  2. cd /app/storage/cwd/plugin_name/
  3. uv pip install -r requirements.txt -i pip_source_url
@Sakura4036 commented on GitHub (Mar 11, 2025): I found a way to install plugin env: 1. docker exec plugin-daemon 2. cd /app/storage/cwd/plugin_name/ 3. uv pip install -r requirements.txt -i pip_source_url
Author
Owner

@Yeuoly commented on GitHub (Mar 11, 2025):

Looks like plugins are not installed fully, you can refer to cwd directory under /storage, it's the plugin that were installed successfully, I have fixed an issue related to this, you can try the latest image tag 6ce5373-local and observe will this happen again

Still doesn't work, I switch the files in the plugin directory, 3 plugins can only be loaded, switching different plugins these three are able to work properly!

Try to reinstall the plugins were not installed successfully with the latest image, or you can add my WeChat: Yeuoly, I will help with, It's hard for me to dig out the problem without reproducing it.

@Yeuoly commented on GitHub (Mar 11, 2025): > > Looks like plugins are not installed fully, you can refer to `cwd` directory under `/storage`, it's the plugin that were installed successfully, I have fixed an issue related to this, you can try the latest image tag [6ce5373](https://github.com/langgenius/dify-plugin-daemon/commit/6ce5373848d1c25ec939a358a26ab5007f75b572)-local and observe will this happen again > > Still doesn't work, I switch the files in the `plugin` directory, 3 plugins can only be loaded, switching different plugins these three are able to work properly! Try to reinstall the plugins were not installed successfully with the latest image, or you can add my WeChat: Yeuoly, I will help with, It's hard for me to dig out the problem without reproducing it.
Author
Owner

@Yeuoly commented on GitHub (Mar 11, 2025):

Is there any way to be a pip source?
@Sakura4036 here
using environment: PIP_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple, just add it to your docker compose file

@Yeuoly commented on GitHub (Mar 11, 2025): > Is there any way to be a pip source? @Sakura4036 here using environment: PIP_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple, just add it to your docker compose file
Author
Owner

@Sakura4036 commented on GitHub (Mar 11, 2025):

PIP_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple,

OK, I will try it, thanks

@Sakura4036 commented on GitHub (Mar 11, 2025): > PIP_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple, OK, I will try it, thanks
Author
Owner

@PittyXu commented on GitHub (Mar 12, 2025):

Looks like plugins are not installed fully, you can refer to cwd directory under /storage, it's the plugin that were installed successfully, I have fixed an issue related to this, you can try the latest image tag 6ce5373-local and observe will this happen again

Still doesn't work, I switch the files in the plugin directory, 3 plugins can only be loaded, switching different plugins these three are able to work properly!

Try to reinstall the plugins were not installed successfully with the latest image, or you can add my WeChat: Yeuoly, I will help with, It's hard for me to dig out the problem without reproducing it.

I added part of the log to the code, the code and log are as follows:
internal/core/plugin_manager/launcher.go

// launch a local plugin
// returns a full duplex lifetime, a launched channel, an error channel, and an error
// caller should always handle both the channels to avoid deadlock
// 1. for launched channel, launch process will close the channel to notify the caller, just wait for it
// 2. for error channel, it will be closed also, but no more error will be sent, caller should consume all errors
func (p *PluginManager) launchLocal(pluginUniqueIdentifier plugin_entities.PluginUniqueIdentifier) (
	plugin_entities.PluginFullDuplexLifetime, <-chan bool, <-chan error, error,
) {
	plugin, err := p.getLocalPluginRuntime(pluginUniqueIdentifier)
	log.Debug("plugin: %v", plugin)
	if err != nil {
		return nil, nil, nil, err
	}

	identity, err := plugin.decoder.UniqueIdentity()
	log.Debug("identity: %v", identity)
	if err != nil {
		return nil, nil, nil, err
	}

	// lock launch process
	p.localPluginLaunchingLock.Lock(identity.String())
	defer p.localPluginLaunchingLock.Unlock(identity.String())

	// check if the plugin is already running
	if lifetime, ok := p.m.Load(identity.String()); ok {
		lifetime, ok := lifetime.(plugin_entities.PluginFullDuplexLifetime)
		if !ok {
			return nil, nil, nil, fmt.Errorf("plugin runtime not found")
		}

		// returns a closed channel to indicate the plugin is already running, no more waiting is needed
		c := make(chan bool)
		close(c)
		errChan := make(chan error)
		close(errChan)

		return lifetime, c, errChan, nil
	}

	// extract plugin
	decoder, ok := plugin.decoder.(*decoder.ZipPluginDecoder)
	log.Debug("decoder: %v", decoder)
	if !ok {
		return nil, nil, nil, fmt.Errorf("plugin decoder is not a zip decoder")
	}

	// check if the working directory exists, if not, create it, otherwise, launch it directly
	if _, err := os.Stat(plugin.runtime.State.WorkingPath); err != nil {
		if err := decoder.ExtractTo(plugin.runtime.State.WorkingPath); err != nil {
			return nil, nil, nil, errors.Join(err, fmt.Errorf("extract plugin to working directory error"))
		}
	}

	success := false
	failed := func(message string) error {
		if !success {
			os.RemoveAll(plugin.runtime.State.WorkingPath)
		}
		return errors.New(message)
	}

	// get assets
	assets, err := plugin.decoder.Assets()
	if err != nil {
		return nil, nil, nil, failed(err.Error())
	}

	localPluginRuntime := local_runtime.NewLocalPluginRuntime(local_runtime.LocalPluginRuntimeConfig{
		PythonInterpreterPath: p.pythonInterpreterPath,
		PythonEnvInitTimeout:  p.pythonEnvInitTimeout,
		HttpProxy:             p.HttpProxy,
		HttpsProxy:            p.HttpsProxy,
		PipMirrorUrl:          p.pipMirrorUrl,
		PipPreferBinary:       p.pipPreferBinary,
		PipExtraArgs:          p.pipExtraArgs,
	})
	localPluginRuntime.PluginRuntime = plugin.runtime
	localPluginRuntime.BasicChecksum = basic_runtime.BasicChecksum{
		MediaTransport: basic_runtime.NewMediaTransport(p.mediaBucket),
		WorkingPath:    plugin.runtime.State.WorkingPath,
		Decoder:        plugin.decoder,
	}

	if err := localPluginRuntime.RemapAssets(
		&localPluginRuntime.Config,
		assets,
	); err != nil {
		return nil, nil, nil, failed(errors.Join(err, fmt.Errorf("remap plugin assets error")).Error())
	}

	success = true

	p.m.Store(identity.String(), localPluginRuntime)
	log.Debug("plugin Store: %v", p)
	// NOTE: you should always keep the size of the channel to 0
	// we use this to synchronize the plugin launch process
	launchedChan := make(chan bool)
	errChan := make(chan error)

	// local plugin
	routine.Submit(map[string]string{
		"module":   "plugin_manager",
		"function": "LaunchLocal",
	}, func() {
		defer func() {
			if r := recover(); r != nil {
				log.Error("plugin runtime panic: %v", r)
			}
			p.m.Delete(identity.String())
		}()
		log.Debug("add max launching lock to prevent too many plugins launching at the same time")
		// add max launching lock to prevent too many plugins launching at the same time
		p.maxLaunchingLock <- true
		routine.Submit(map[string]string{
			"module":   "plugin_manager",
			"function": "LaunchLocal",
		}, func() {
			log.Debug("wait for plugin launched")
			// wait for plugin launched
			<-launchedChan
			// release max launching lock
			<-p.maxLaunchingLock
		})

		p.fullDuplexLifecycle(localPluginRuntime, launchedChan, errChan)
	})

	return localPluginRuntime, launchedChan, errChan, nil
}

logs:

2025/03/12 17:50:10 pool.go:32: [INFO]init routine pool, size: 10
2025/03/12 17:50:11 init.go:152: [INFO]dify plugin db initialized
2025/03/12 17:50:11 manager.go:155: [INFO]start plugin manager daemon...
2025/03/12 17:50:11 init.go:19: [INFO]Persistence initialized
2025/03/12 17:50:11 watcher.go:16: [INFO]start to handle new plugins in path: plugins
2025/03/12 17:50:11 watcher.go:78: [DEBUG]handle new local plugin: langgenius/agent:0.0.9@f16916b704a20067317dbe9030f62aa28f0832021a3ef6d4ce699504074c5e13
2025/03/12 17:50:11 launcher.go:76: [DEBUG]plugin: &{{{0 pending storage/cwd/langgenius/agent-0.0.9@f16916b704a20067317dbe9030f62aa28f0832021a3ef6d4ce699504074c5e13 <nil> <nil> true <nil> []} {{0.0.9 plugin langgenius agent {Dify Agent Strategies  Dify Agent 策略 } {Dify official Agent strategies collection  Dify 官方 Agent 策略集合 } icon.svg {1048576 0xc0004862d0} {[] [] [] [provider/agent.yaml]} {0.0.1 [amd64 arm64] {python 3.12 main}} [agent] {658609186 63856368224 <nil>} <nil>} true <nil> <nil> <nil> 0xc000256900} []} 0xc000088fc0}
2025/03/12 17:50:11 launcher.go:82: [DEBUG]identity: langgenius/agent:0.0.9@f16916b704a20067317dbe9030f62aa28f0832021a3ef6d4ce699504074c5e13
2025/03/12 17:50:11 launcher.go:109: [DEBUG]decoder: &{<nil> {0xc00007f800 f16916b704a20067317dbe9030f62aa28f0832021a3ef6d4ce699504074c5e13} 0xc0005873b0 <nil> OrxTFFlJ/QEHawxlSgmRkTE2InwVs62fdXpziQiRfD2TFUlegltMjbFvCNSskIW9L1esLmBIDHz/RhVr/32VDBAHbbQv4ZbW7mfzzsowOjq6fpCxSswfKBwO+fflTKOx8yOcI1mANMSE/bKqCZ9/PLnvcuzwrhmzHcvWIGxDCkpP7KcmyxPwLRKoWq3boXd2aqSD+b6e5dtDjsoWRVYVq1G95m0rIkih8rNdudizegyi/HxrMGc35llHE9WiF28AOaEbQKaVwZK+yfJkOOz0qlHCL+21b+cwBXIGgdT6Bxz1uq3SvatNwXK674V1OmPAWXkMQqIEi642ClCFYLbqlW6/RznPu2Ry9qmFySrPY7qr9qPDGS4WiRAEJK1u/ieFj4ZZAQLdgatc6QIM9gqVYz/4kKhwL6fp5EHPQtX8gXQYU9NfoiNbsCZ9qZUpLNJLczj9QHTZ+Ykq1dV9Bn/q2r9fsRXc/sZqM8C2NYLWvcs1RcquatCGZ/S3Z9P3vEgfYeN1r4Ho4HpWcKp2VHCXi2K28Ey5+i/7oGqlrFZsDdvf0hdJXJCR75VpOIkNadnLAHVx0IJ0Zx6gu73PTbuoicBVMVRVnv27cNgpgAAW9wxASxH5wwHGklt8u0GHmzfwgrowUsr5hggWpsOSsRjRU6Pe2MnjCWLnn5bk6CE5MFM= 1741005967}
2025/03/12 17:50:11 launcher.go:161: [DEBUG]plugin Store: &{{1 {{0 0} {[] {} 0xc000480050} map[langgenius/agent:0.0.9@f16916b704a20067317dbe9030f62aa28f0832021a3ef6d4ce699504074c5e13:0xc000186000] 0}} 52428800 storage/cwd plugins 0xc0001e31a0 0xc0001187c0 0xc0001187e0 [0x12da2a0] 0xc0001deb70 0xc0001188e0 /usr/bin/python3 120    true true  0xc0001287f0 0xc00011c5b0 local}
2025/03/12 17:50:11 launcher.go:178: [DEBUG]add max launching lock to prevent too many plugins launching at the same time
2025/03/12 17:50:11 launcher.go:185: [DEBUG]wait for plugin launched
2025/03/12 17:50:11 runtime_lifetime.go:40: [INFO]new plugin logged in: langgenius/agent:0.0.9
2025/03/12 17:50:11 runtime_lifetime.go:70: [INFO]init environment for plugin langgenius/agent:0.0.9
[GIN] 2025/03/12 - 17:50:11 | 200 |      66.877µs |     10.71.5.182 | GET      "/health/check"
[gnet] 2025-03-12T17:50:11.307067457+08:00	INFO	logging/logger.go:256	Launching gnet with 8 event-loops, listening on: tcp://0.0.0.0:5003
2025/03/12 17:50:11 watcher.go:78: [DEBUG]handle new local plugin: langgenius/echarts:0.0.1@fe95412f101f2735530ea05f479ab5e8fbe1d4f4b2847f09e490e7d1d0125de5
2025/03/12 17:50:11 run.go:143: [INFO]plugin langgenius/agent:0.0.9 started
2025/03/12 17:50:11 launcher.go:76: [DEBUG]plugin: &{{{0 pending storage/cwd/langgenius/echarts-0.0.1@fe95412f101f2735530ea05f479ab5e8fbe1d4f4b2847f09e490e7d1d0125de5 <nil> <nil> true <nil> []} {{0.0.1 plugin langgenius echarts {ECharts Chart Generator  ECharts图表生成 } {ECharts Chart Generator is a tool for generating statistical ECharts charts like bar chart, line chart, pie chart, etc.  ECharts图表生成是一个用于生成可视化ECharts图表的工具,你可以通过它来生成柱状图、折线图、饼图等各类图表 } icon.svg {1048576 0xc0003baff0} {[provider/echarts.yaml] [] [] []} {0.0.1 [amd64 arm64] {python 3.12 main}} [design productivity utilities] {557364500 63872330101 0x2273080} <nil>} true <nil> <nil> 0xc0001f0120 <nil>} []} 0xc000247e00}
2025/03/12 17:50:11 launcher.go:82: [DEBUG]identity: langgenius/echarts:0.0.1@fe95412f101f2735530ea05f479ab5e8fbe1d4f4b2847f09e490e7d1d0125de5
2025/03/12 17:50:11 launcher.go:109: [DEBUG]decoder: &{<nil> {0xc000478000 fe95412f101f2735530ea05f479ab5e8fbe1d4f4b2847f09e490e7d1d0125de5} 0xc0001bea10 <nil> GsJlH23X/3SjJMEWQ1YuAjasNGlScso9DLpCncDk+9wCVVnutYynztITAoh5pud6zcBSz85i1rhnn5VZICT9fZvfGMSpRonFjvh4NuO+mJ55fOZ4rAfI6G7Hj9pEbyJ20SQd97oH2UXHA5HZEEli/NM87swmwVy2dzOZd54byoP/rvHkyWdXwIO/Vno+ZQikZ33kV7/Zt6v8M/UGCsYt4mvoRBeEgBU9khb+1ULf9ZAzlXYIgzLtHhVwTxRhdgGkfNK6pq/iaEHeYoeSbnUr+TieCKdsPa8Dp8qUr8EaD/mYUElNTbQSdx7NvXh2XFEDjX3tJQka2fzwFol1XP74syDVrUdpK7HNRbACRSVQdgfmcQzgAvjpTGhS80JoIcu3NPufycelnVd8Bz1Px7VdWM/Lx6uYDBFo4bGgIkC/lu9f+suwoD+ExbSb2kEKS3DAp2USRXV1lKHnYpqv7YtXvG27q9pUaNFw1wn3g0+tTksAOucOgeolAaHz4UtYL3CO8p3qXbPgNXByFbPM8u1E1EKWYVI6zxYGgYUrxUJvi8S2ryGQ0Od/hGuXs1uHDKx3kupp40G8vWGqprw0LU+j22XLmQKAQi1Mp/7eYLr4ZjW/O1dkYUrkCFQfK95kWrhv0Dy1aUSJJtRR4t1KzFQeY1ZSIZx03WRguHnwuU3Lipo= 1740887584}
2025/03/12 17:50:11 launcher.go:161: [DEBUG]plugin Store: &{{2 {{0 0} {[] {} 0xc000124f20} map[langgenius/agent:0.0.9@f16916b704a20067317dbe9030f62aa28f0832021a3ef6d4ce699504074c5e13:0xc000186000 langgenius/echarts:0.0.1@fe95412f101f2735530ea05f479ab5e8fbe1d4f4b2847f09e490e7d1d0125de5:0xc00048a408] 0}} 52428800 storage/cwd plugins 0xc0001e31a0 0xc0001187c0 0xc0001187e0 [0x12da2a0] 0xc0001deb70 0xc0001188e0 /usr/bin/python3 120    true true  0xc0001287f0 0xc00011c5b0 local}
2025/03/12 17:50:11 launcher.go:178: [DEBUG]add max launching lock to prevent too many plugins launching at the same time
2025/03/12 17:50:11 launcher.go:185: [DEBUG]wait for plugin launched
2025/03/12 17:50:11 runtime_lifetime.go:40: [INFO]new plugin logged in: langgenius/echarts:0.0.1
2025/03/12 17:50:11 runtime_lifetime.go:70: [INFO]init environment for plugin langgenius/echarts:0.0.1
2025/03/12 17:50:11 watcher.go:78: [DEBUG]handle new local plugin: langgenius/openai_api_compatible:0.0.7@f20c7275bbcf055ec5d170dd5128e341986e2dcba5266d08fd080d4bdf2288f6
2025/03/12 17:50:11 run.go:143: [INFO]plugin langgenius/echarts:0.0.1 started
2025/03/12 17:50:11 launcher.go:76: [DEBUG]plugin: &{{{0 pending storage/cwd/langgenius/openai_api_compatible-0.0.7@f20c7275bbcf055ec5d170dd5128e341986e2dcba5266d08fd080d4bdf2288f6 <nil> <nil> true <nil> []} {{0.0.7 plugin langgenius openai_api_compatible {OpenAI-API-compatible   } {Model providers compatible with OpenAI's API standard, such as LM Studio.  兼容 OpenAI API 的模型供应商,例如 LM Studio 。 } icon.svg {1048576 0xc00057a780} {[] [provider/openai_api_compatible.yaml] [] []} {0.0.1 [amd64 arm64] {python 3.12 main}} [] {658609186 63856368224 <nil>} <nil>} true <nil> 0xc00088e100 <nil> <nil>} []} 0xc00058a420}
2025/03/12 17:50:11 launcher.go:82: [DEBUG]identity: langgenius/openai_api_compatible:0.0.7@f20c7275bbcf055ec5d170dd5128e341986e2dcba5266d08fd080d4bdf2288f6
2025/03/12 17:50:11 launcher.go:109: [DEBUG]decoder: &{<nil> {0xc000808200 f20c7275bbcf055ec5d170dd5128e341986e2dcba5266d08fd080d4bdf2288f6} 0xc0001bee70 <nil> mgFtzr6tzcIgsQZS1LGvAjraKJldukBIZRxew4r9859j4Fl7v0JBUN16Y7n0dDxljZXKmEtWye4NJnxqY6806zs9RTfoAMO+GjQ5imCXLrnOV935A3oBrV59zeLypS8pOdniVL90Qsr0fAClyz/Wa2zrlT3/EnKGIbLWJIUW6FLTIbTme1f9faFQsZm9wEPj2dLwWMhn4WWRBuBF+gSstrU+aCj83BopGeW4gGwdzzkq1Yu0rgTJOuCikOKSB5rUaMQ6jzmirLM4pC7KbyrSgbiUqk2VrigM323qX4jmuC1LUuyBGkEg15yctEyrA3IGpGwxjYV0qvH8e3d2K8qqTD3TWk0XjkvVvTfvKwcjlwuhKrNluav8y4V8kY99n0piZe8kJBSZ3+D4JskdRxZR5Yg/ihHRdcz81hB95c5hklomoB2i+LV1E3lPcNX0AUBzotcRm57YI1qCELAi72SbPh2wauETzHqYT/uqVl7heHCIwdEnNkYA26hT7KcVKMXpRqW7WMrXyEW1CgzNWpa4NLsrcT+RukBgmjfPalqsIBfSEcX1vSe+MMDF1xyrJsQhmsPAPUNxjWaQLivXPM4or69rknNeJFRnw7cFwUtjC63UBue2FU/68Gx7kR+/Kz51IHGKz7vfTc5nq+8UE8jyo7cMJI5RCjXIvFYMnq1SKNo= 1741150230}
2025/03/12 17:50:11 launcher.go:161: [DEBUG]plugin Store: &{{3 {{0 0} {[] {} 0xc000124f20} map[langgenius/agent:0.0.9@f16916b704a20067317dbe9030f62aa28f0832021a3ef6d4ce699504074c5e13:0xc000186000 langgenius/echarts:0.0.1@fe95412f101f2735530ea05f479ab5e8fbe1d4f4b2847f09e490e7d1d0125de5:0xc00048a408 langgenius/openai_api_compatible:0.0.7@f20c7275bbcf055ec5d170dd5128e341986e2dcba5266d08fd080d4bdf2288f6:0xc00048a008] 1}} 52428800 storage/cwd plugins 0xc0001e31a0 0xc0001187c0 0xc0001187e0 [0x12da2a0] 0xc0001deb70 0xc0001188e0 /usr/bin/python3 120    true true  0xc0001287f0 0xc00011c5b0 local}
2025/03/12 17:50:11 launcher.go:178: [DEBUG]add max launching lock to prevent too many plugins launching at the same time
2025/03/12 17:50:11 launcher.go:185: [DEBUG]wait for plugin launched
2025/03/12 17:50:11 runtime_lifetime.go:40: [INFO]new plugin logged in: langgenius/openai_api_compatible:0.0.7
2025/03/12 17:50:11 runtime_lifetime.go:70: [INFO]init environment for plugin langgenius/openai_api_compatible:0.0.7
2025/03/12 17:50:11 watcher.go:78: [DEBUG]handle new local plugin: langgenius/regex:0.0.3@55439fc9083494e90856405256a1755c4ee47aa395cef50b6fc3614d4f11a479
2025/03/12 17:50:11 run.go:143: [INFO]plugin langgenius/openai_api_compatible:0.0.7 started
2025/03/12 17:50:11 launcher.go:76: [DEBUG]plugin: &{{{0 pending storage/cwd/langgenius/regex-0.0.3@55439fc9083494e90856405256a1755c4ee47aa395cef50b6fc3614d4f11a479 <nil> <nil> true <nil> []} {{0.0.3 plugin langgenius regex {Regex  正则表达式提取 Regex} {A tool for regex extraction.  一个用于正则表达式内容提取的工具。 A tool for regex extraction.} icon.svg {1048576 0xc00057b3e0} {[provider/regex.yaml] [] [] []} {0.0.1 [amd64 arm64] {python 3.12 main}} [utilities productivity] {658609186 63862416224 <nil>} <nil>} true <nil> <nil> 0xc0001c90e0 <nil>} []} 0xc000810360}
2025/03/12 17:50:11 launcher.go:82: [DEBUG]identity: langgenius/regex:0.0.3@55439fc9083494e90856405256a1755c4ee47aa395cef50b6fc3614d4f11a479
2025/03/12 17:50:11 launcher.go:109: [DEBUG]decoder: &{<nil> {0xc000649600 55439fc9083494e90856405256a1755c4ee47aa395cef50b6fc3614d4f11a479} 0xc000260000 <nil> Daq1Ou3rTs8tCXNJ6GP/+soIn6XpSlbfsfz1BIgL86eMUg89ATEviSqPE4S99yDZwmokNvvoIVeLqwE11Nf7zImCC9CNgWQgYpksUsmOhjF5M+lPCihA0Z0LsFlnKseRzkFgpR0+RqgMO+3/BgOW+fDJL/6HmSbH38pFVQd+to2qNuZpw22ErxGEJoH52ZnZ0hSQIZ0p0du7Mi3XCBv731IzsQcznP39+bhZit4mHQYP3jgVbILkIBNYIzQZ9Ea+8sDr29iI2EtDr14SBVsAI75WikFDo9uXmMX5ChSOd2jMJFuuolx/oAVhZ1zxZnxaz6q9GPOM4gKB8nklx0zUJM4/B1Whvp6el2MqJEWThSTjJPNQ+qD8ANkpUIlrJ6cZDAm4B71IXBsOgEwfU0USE9YQbb6oP0+zMT5YUBo44Eb5XUb+jXyTVQzZ9VVdeuDLNw+2TCTdbawP26YxCEMJkGd+6bJWTObnXshq2Qdhxjbk5ujzLC+u2REj7cJlIHyMFOcjMn4eXOKd+iq4OtldR+421SFYCaNoyW9MFP66/UvB6WoRDCs2PzjLr+ChcZtikcwT4yJ+TXQSIl06o2zSZo8VapeTbOXUtalG/GycykRtUt+a2lDMKM3n3kHcT4Z6Pa09Sa/EX7wBkZFRmvCtFOAQdun4lasZE40IfwxoOz0= 1739776273}
2025/03/12 17:50:11 launcher.go:161: [DEBUG]plugin Store: &{{4 {{0 0} {[] {} 0xc000124f20} map[langgenius/agent:0.0.9@f16916b704a20067317dbe9030f62aa28f0832021a3ef6d4ce699504074c5e13:0xc000186000 langgenius/echarts:0.0.1@fe95412f101f2735530ea05f479ab5e8fbe1d4f4b2847f09e490e7d1d0125de5:0xc00048a408 langgenius/openai_api_compatible:0.0.7@f20c7275bbcf055ec5d170dd5128e341986e2dcba5266d08fd080d4bdf2288f6:0xc00048a008 langgenius/regex:0.0.3@55439fc9083494e90856405256a1755c4ee47aa395cef50b6fc3614d4f11a479:0xc00048a058] 2}} 52428800 storage/cwd plugins 0xc0001e31a0 0xc0001187c0 0xc0001187e0 [0x12da2a0] 0xc0001deb70 0xc0001188e0 /usr/bin/python3 120    true true  0xc0001287f0 0xc00011c5b0 local}
2025/03/12 17:50:11 launcher.go:178: [DEBUG]add max launching lock to prevent too many plugins launching at the same time
2025/03/12 17:50:13 stdio_handle.go:128: [INFO]plugin langgenius/echarts:0.0.1: Installed tool: echarts
2025/03/12 17:50:14 stdio_handle.go:128: [INFO]plugin langgenius/agent:0.0.9: Installed agent: agent
2025/03/12 17:50:14 stdio_handle.go:128: [INFO]plugin langgenius/openai_api_compatible:0.0.7: Installed model: openai_api_compatible
@PittyXu commented on GitHub (Mar 12, 2025): > > > Looks like plugins are not installed fully, you can refer to `cwd` directory under `/storage`, it's the plugin that were installed successfully, I have fixed an issue related to this, you can try the latest image tag [6ce5373](https://github.com/langgenius/dify-plugin-daemon/commit/6ce5373848d1c25ec939a358a26ab5007f75b572)-local and observe will this happen again > > > > > > Still doesn't work, I switch the files in the `plugin` directory, 3 plugins can only be loaded, switching different plugins these three are able to work properly! > > Try to reinstall the plugins were not installed successfully with the latest image, or you can add my WeChat: Yeuoly, I will help with, It's hard for me to dig out the problem without reproducing it. I added part of the log to the code, the code and log are as follows: `internal/core/plugin_manager/launcher.go` ```go // launch a local plugin // returns a full duplex lifetime, a launched channel, an error channel, and an error // caller should always handle both the channels to avoid deadlock // 1. for launched channel, launch process will close the channel to notify the caller, just wait for it // 2. for error channel, it will be closed also, but no more error will be sent, caller should consume all errors func (p *PluginManager) launchLocal(pluginUniqueIdentifier plugin_entities.PluginUniqueIdentifier) ( plugin_entities.PluginFullDuplexLifetime, <-chan bool, <-chan error, error, ) { plugin, err := p.getLocalPluginRuntime(pluginUniqueIdentifier) log.Debug("plugin: %v", plugin) if err != nil { return nil, nil, nil, err } identity, err := plugin.decoder.UniqueIdentity() log.Debug("identity: %v", identity) if err != nil { return nil, nil, nil, err } // lock launch process p.localPluginLaunchingLock.Lock(identity.String()) defer p.localPluginLaunchingLock.Unlock(identity.String()) // check if the plugin is already running if lifetime, ok := p.m.Load(identity.String()); ok { lifetime, ok := lifetime.(plugin_entities.PluginFullDuplexLifetime) if !ok { return nil, nil, nil, fmt.Errorf("plugin runtime not found") } // returns a closed channel to indicate the plugin is already running, no more waiting is needed c := make(chan bool) close(c) errChan := make(chan error) close(errChan) return lifetime, c, errChan, nil } // extract plugin decoder, ok := plugin.decoder.(*decoder.ZipPluginDecoder) log.Debug("decoder: %v", decoder) if !ok { return nil, nil, nil, fmt.Errorf("plugin decoder is not a zip decoder") } // check if the working directory exists, if not, create it, otherwise, launch it directly if _, err := os.Stat(plugin.runtime.State.WorkingPath); err != nil { if err := decoder.ExtractTo(plugin.runtime.State.WorkingPath); err != nil { return nil, nil, nil, errors.Join(err, fmt.Errorf("extract plugin to working directory error")) } } success := false failed := func(message string) error { if !success { os.RemoveAll(plugin.runtime.State.WorkingPath) } return errors.New(message) } // get assets assets, err := plugin.decoder.Assets() if err != nil { return nil, nil, nil, failed(err.Error()) } localPluginRuntime := local_runtime.NewLocalPluginRuntime(local_runtime.LocalPluginRuntimeConfig{ PythonInterpreterPath: p.pythonInterpreterPath, PythonEnvInitTimeout: p.pythonEnvInitTimeout, HttpProxy: p.HttpProxy, HttpsProxy: p.HttpsProxy, PipMirrorUrl: p.pipMirrorUrl, PipPreferBinary: p.pipPreferBinary, PipExtraArgs: p.pipExtraArgs, }) localPluginRuntime.PluginRuntime = plugin.runtime localPluginRuntime.BasicChecksum = basic_runtime.BasicChecksum{ MediaTransport: basic_runtime.NewMediaTransport(p.mediaBucket), WorkingPath: plugin.runtime.State.WorkingPath, Decoder: plugin.decoder, } if err := localPluginRuntime.RemapAssets( &localPluginRuntime.Config, assets, ); err != nil { return nil, nil, nil, failed(errors.Join(err, fmt.Errorf("remap plugin assets error")).Error()) } success = true p.m.Store(identity.String(), localPluginRuntime) log.Debug("plugin Store: %v", p) // NOTE: you should always keep the size of the channel to 0 // we use this to synchronize the plugin launch process launchedChan := make(chan bool) errChan := make(chan error) // local plugin routine.Submit(map[string]string{ "module": "plugin_manager", "function": "LaunchLocal", }, func() { defer func() { if r := recover(); r != nil { log.Error("plugin runtime panic: %v", r) } p.m.Delete(identity.String()) }() log.Debug("add max launching lock to prevent too many plugins launching at the same time") // add max launching lock to prevent too many plugins launching at the same time p.maxLaunchingLock <- true routine.Submit(map[string]string{ "module": "plugin_manager", "function": "LaunchLocal", }, func() { log.Debug("wait for plugin launched") // wait for plugin launched <-launchedChan // release max launching lock <-p.maxLaunchingLock }) p.fullDuplexLifecycle(localPluginRuntime, launchedChan, errChan) }) return localPluginRuntime, launchedChan, errChan, nil } ``` logs: ```log 2025/03/12 17:50:10 pool.go:32: [INFO]init routine pool, size: 10 2025/03/12 17:50:11 init.go:152: [INFO]dify plugin db initialized 2025/03/12 17:50:11 manager.go:155: [INFO]start plugin manager daemon... 2025/03/12 17:50:11 init.go:19: [INFO]Persistence initialized 2025/03/12 17:50:11 watcher.go:16: [INFO]start to handle new plugins in path: plugins 2025/03/12 17:50:11 watcher.go:78: [DEBUG]handle new local plugin: langgenius/agent:0.0.9@f16916b704a20067317dbe9030f62aa28f0832021a3ef6d4ce699504074c5e13 2025/03/12 17:50:11 launcher.go:76: [DEBUG]plugin: &{{{0 pending storage/cwd/langgenius/agent-0.0.9@f16916b704a20067317dbe9030f62aa28f0832021a3ef6d4ce699504074c5e13 <nil> <nil> true <nil> []} {{0.0.9 plugin langgenius agent {Dify Agent Strategies Dify Agent 策略 } {Dify official Agent strategies collection Dify 官方 Agent 策略集合 } icon.svg {1048576 0xc0004862d0} {[] [] [] [provider/agent.yaml]} {0.0.1 [amd64 arm64] {python 3.12 main}} [agent] {658609186 63856368224 <nil>} <nil>} true <nil> <nil> <nil> 0xc000256900} []} 0xc000088fc0} 2025/03/12 17:50:11 launcher.go:82: [DEBUG]identity: langgenius/agent:0.0.9@f16916b704a20067317dbe9030f62aa28f0832021a3ef6d4ce699504074c5e13 2025/03/12 17:50:11 launcher.go:109: [DEBUG]decoder: &{<nil> {0xc00007f800 f16916b704a20067317dbe9030f62aa28f0832021a3ef6d4ce699504074c5e13} 0xc0005873b0 <nil> OrxTFFlJ/QEHawxlSgmRkTE2InwVs62fdXpziQiRfD2TFUlegltMjbFvCNSskIW9L1esLmBIDHz/RhVr/32VDBAHbbQv4ZbW7mfzzsowOjq6fpCxSswfKBwO+fflTKOx8yOcI1mANMSE/bKqCZ9/PLnvcuzwrhmzHcvWIGxDCkpP7KcmyxPwLRKoWq3boXd2aqSD+b6e5dtDjsoWRVYVq1G95m0rIkih8rNdudizegyi/HxrMGc35llHE9WiF28AOaEbQKaVwZK+yfJkOOz0qlHCL+21b+cwBXIGgdT6Bxz1uq3SvatNwXK674V1OmPAWXkMQqIEi642ClCFYLbqlW6/RznPu2Ry9qmFySrPY7qr9qPDGS4WiRAEJK1u/ieFj4ZZAQLdgatc6QIM9gqVYz/4kKhwL6fp5EHPQtX8gXQYU9NfoiNbsCZ9qZUpLNJLczj9QHTZ+Ykq1dV9Bn/q2r9fsRXc/sZqM8C2NYLWvcs1RcquatCGZ/S3Z9P3vEgfYeN1r4Ho4HpWcKp2VHCXi2K28Ey5+i/7oGqlrFZsDdvf0hdJXJCR75VpOIkNadnLAHVx0IJ0Zx6gu73PTbuoicBVMVRVnv27cNgpgAAW9wxASxH5wwHGklt8u0GHmzfwgrowUsr5hggWpsOSsRjRU6Pe2MnjCWLnn5bk6CE5MFM= 1741005967} 2025/03/12 17:50:11 launcher.go:161: [DEBUG]plugin Store: &{{1 {{0 0} {[] {} 0xc000480050} map[langgenius/agent:0.0.9@f16916b704a20067317dbe9030f62aa28f0832021a3ef6d4ce699504074c5e13:0xc000186000] 0}} 52428800 storage/cwd plugins 0xc0001e31a0 0xc0001187c0 0xc0001187e0 [0x12da2a0] 0xc0001deb70 0xc0001188e0 /usr/bin/python3 120 true true 0xc0001287f0 0xc00011c5b0 local} 2025/03/12 17:50:11 launcher.go:178: [DEBUG]add max launching lock to prevent too many plugins launching at the same time 2025/03/12 17:50:11 launcher.go:185: [DEBUG]wait for plugin launched 2025/03/12 17:50:11 runtime_lifetime.go:40: [INFO]new plugin logged in: langgenius/agent:0.0.9 2025/03/12 17:50:11 runtime_lifetime.go:70: [INFO]init environment for plugin langgenius/agent:0.0.9 [GIN] 2025/03/12 - 17:50:11 | 200 | 66.877µs | 10.71.5.182 | GET "/health/check" [gnet] 2025-03-12T17:50:11.307067457+08:00 INFO logging/logger.go:256 Launching gnet with 8 event-loops, listening on: tcp://0.0.0.0:5003 2025/03/12 17:50:11 watcher.go:78: [DEBUG]handle new local plugin: langgenius/echarts:0.0.1@fe95412f101f2735530ea05f479ab5e8fbe1d4f4b2847f09e490e7d1d0125de5 2025/03/12 17:50:11 run.go:143: [INFO]plugin langgenius/agent:0.0.9 started 2025/03/12 17:50:11 launcher.go:76: [DEBUG]plugin: &{{{0 pending storage/cwd/langgenius/echarts-0.0.1@fe95412f101f2735530ea05f479ab5e8fbe1d4f4b2847f09e490e7d1d0125de5 <nil> <nil> true <nil> []} {{0.0.1 plugin langgenius echarts {ECharts Chart Generator ECharts图表生成 } {ECharts Chart Generator is a tool for generating statistical ECharts charts like bar chart, line chart, pie chart, etc. ECharts图表生成是一个用于生成可视化ECharts图表的工具,你可以通过它来生成柱状图、折线图、饼图等各类图表 } icon.svg {1048576 0xc0003baff0} {[provider/echarts.yaml] [] [] []} {0.0.1 [amd64 arm64] {python 3.12 main}} [design productivity utilities] {557364500 63872330101 0x2273080} <nil>} true <nil> <nil> 0xc0001f0120 <nil>} []} 0xc000247e00} 2025/03/12 17:50:11 launcher.go:82: [DEBUG]identity: langgenius/echarts:0.0.1@fe95412f101f2735530ea05f479ab5e8fbe1d4f4b2847f09e490e7d1d0125de5 2025/03/12 17:50:11 launcher.go:109: [DEBUG]decoder: &{<nil> {0xc000478000 fe95412f101f2735530ea05f479ab5e8fbe1d4f4b2847f09e490e7d1d0125de5} 0xc0001bea10 <nil> GsJlH23X/3SjJMEWQ1YuAjasNGlScso9DLpCncDk+9wCVVnutYynztITAoh5pud6zcBSz85i1rhnn5VZICT9fZvfGMSpRonFjvh4NuO+mJ55fOZ4rAfI6G7Hj9pEbyJ20SQd97oH2UXHA5HZEEli/NM87swmwVy2dzOZd54byoP/rvHkyWdXwIO/Vno+ZQikZ33kV7/Zt6v8M/UGCsYt4mvoRBeEgBU9khb+1ULf9ZAzlXYIgzLtHhVwTxRhdgGkfNK6pq/iaEHeYoeSbnUr+TieCKdsPa8Dp8qUr8EaD/mYUElNTbQSdx7NvXh2XFEDjX3tJQka2fzwFol1XP74syDVrUdpK7HNRbACRSVQdgfmcQzgAvjpTGhS80JoIcu3NPufycelnVd8Bz1Px7VdWM/Lx6uYDBFo4bGgIkC/lu9f+suwoD+ExbSb2kEKS3DAp2USRXV1lKHnYpqv7YtXvG27q9pUaNFw1wn3g0+tTksAOucOgeolAaHz4UtYL3CO8p3qXbPgNXByFbPM8u1E1EKWYVI6zxYGgYUrxUJvi8S2ryGQ0Od/hGuXs1uHDKx3kupp40G8vWGqprw0LU+j22XLmQKAQi1Mp/7eYLr4ZjW/O1dkYUrkCFQfK95kWrhv0Dy1aUSJJtRR4t1KzFQeY1ZSIZx03WRguHnwuU3Lipo= 1740887584} 2025/03/12 17:50:11 launcher.go:161: [DEBUG]plugin Store: &{{2 {{0 0} {[] {} 0xc000124f20} map[langgenius/agent:0.0.9@f16916b704a20067317dbe9030f62aa28f0832021a3ef6d4ce699504074c5e13:0xc000186000 langgenius/echarts:0.0.1@fe95412f101f2735530ea05f479ab5e8fbe1d4f4b2847f09e490e7d1d0125de5:0xc00048a408] 0}} 52428800 storage/cwd plugins 0xc0001e31a0 0xc0001187c0 0xc0001187e0 [0x12da2a0] 0xc0001deb70 0xc0001188e0 /usr/bin/python3 120 true true 0xc0001287f0 0xc00011c5b0 local} 2025/03/12 17:50:11 launcher.go:178: [DEBUG]add max launching lock to prevent too many plugins launching at the same time 2025/03/12 17:50:11 launcher.go:185: [DEBUG]wait for plugin launched 2025/03/12 17:50:11 runtime_lifetime.go:40: [INFO]new plugin logged in: langgenius/echarts:0.0.1 2025/03/12 17:50:11 runtime_lifetime.go:70: [INFO]init environment for plugin langgenius/echarts:0.0.1 2025/03/12 17:50:11 watcher.go:78: [DEBUG]handle new local plugin: langgenius/openai_api_compatible:0.0.7@f20c7275bbcf055ec5d170dd5128e341986e2dcba5266d08fd080d4bdf2288f6 2025/03/12 17:50:11 run.go:143: [INFO]plugin langgenius/echarts:0.0.1 started 2025/03/12 17:50:11 launcher.go:76: [DEBUG]plugin: &{{{0 pending storage/cwd/langgenius/openai_api_compatible-0.0.7@f20c7275bbcf055ec5d170dd5128e341986e2dcba5266d08fd080d4bdf2288f6 <nil> <nil> true <nil> []} {{0.0.7 plugin langgenius openai_api_compatible {OpenAI-API-compatible } {Model providers compatible with OpenAI's API standard, such as LM Studio. 兼容 OpenAI API 的模型供应商,例如 LM Studio 。 } icon.svg {1048576 0xc00057a780} {[] [provider/openai_api_compatible.yaml] [] []} {0.0.1 [amd64 arm64] {python 3.12 main}} [] {658609186 63856368224 <nil>} <nil>} true <nil> 0xc00088e100 <nil> <nil>} []} 0xc00058a420} 2025/03/12 17:50:11 launcher.go:82: [DEBUG]identity: langgenius/openai_api_compatible:0.0.7@f20c7275bbcf055ec5d170dd5128e341986e2dcba5266d08fd080d4bdf2288f6 2025/03/12 17:50:11 launcher.go:109: [DEBUG]decoder: &{<nil> {0xc000808200 f20c7275bbcf055ec5d170dd5128e341986e2dcba5266d08fd080d4bdf2288f6} 0xc0001bee70 <nil> mgFtzr6tzcIgsQZS1LGvAjraKJldukBIZRxew4r9859j4Fl7v0JBUN16Y7n0dDxljZXKmEtWye4NJnxqY6806zs9RTfoAMO+GjQ5imCXLrnOV935A3oBrV59zeLypS8pOdniVL90Qsr0fAClyz/Wa2zrlT3/EnKGIbLWJIUW6FLTIbTme1f9faFQsZm9wEPj2dLwWMhn4WWRBuBF+gSstrU+aCj83BopGeW4gGwdzzkq1Yu0rgTJOuCikOKSB5rUaMQ6jzmirLM4pC7KbyrSgbiUqk2VrigM323qX4jmuC1LUuyBGkEg15yctEyrA3IGpGwxjYV0qvH8e3d2K8qqTD3TWk0XjkvVvTfvKwcjlwuhKrNluav8y4V8kY99n0piZe8kJBSZ3+D4JskdRxZR5Yg/ihHRdcz81hB95c5hklomoB2i+LV1E3lPcNX0AUBzotcRm57YI1qCELAi72SbPh2wauETzHqYT/uqVl7heHCIwdEnNkYA26hT7KcVKMXpRqW7WMrXyEW1CgzNWpa4NLsrcT+RukBgmjfPalqsIBfSEcX1vSe+MMDF1xyrJsQhmsPAPUNxjWaQLivXPM4or69rknNeJFRnw7cFwUtjC63UBue2FU/68Gx7kR+/Kz51IHGKz7vfTc5nq+8UE8jyo7cMJI5RCjXIvFYMnq1SKNo= 1741150230} 2025/03/12 17:50:11 launcher.go:161: [DEBUG]plugin Store: &{{3 {{0 0} {[] {} 0xc000124f20} map[langgenius/agent:0.0.9@f16916b704a20067317dbe9030f62aa28f0832021a3ef6d4ce699504074c5e13:0xc000186000 langgenius/echarts:0.0.1@fe95412f101f2735530ea05f479ab5e8fbe1d4f4b2847f09e490e7d1d0125de5:0xc00048a408 langgenius/openai_api_compatible:0.0.7@f20c7275bbcf055ec5d170dd5128e341986e2dcba5266d08fd080d4bdf2288f6:0xc00048a008] 1}} 52428800 storage/cwd plugins 0xc0001e31a0 0xc0001187c0 0xc0001187e0 [0x12da2a0] 0xc0001deb70 0xc0001188e0 /usr/bin/python3 120 true true 0xc0001287f0 0xc00011c5b0 local} 2025/03/12 17:50:11 launcher.go:178: [DEBUG]add max launching lock to prevent too many plugins launching at the same time 2025/03/12 17:50:11 launcher.go:185: [DEBUG]wait for plugin launched 2025/03/12 17:50:11 runtime_lifetime.go:40: [INFO]new plugin logged in: langgenius/openai_api_compatible:0.0.7 2025/03/12 17:50:11 runtime_lifetime.go:70: [INFO]init environment for plugin langgenius/openai_api_compatible:0.0.7 2025/03/12 17:50:11 watcher.go:78: [DEBUG]handle new local plugin: langgenius/regex:0.0.3@55439fc9083494e90856405256a1755c4ee47aa395cef50b6fc3614d4f11a479 2025/03/12 17:50:11 run.go:143: [INFO]plugin langgenius/openai_api_compatible:0.0.7 started 2025/03/12 17:50:11 launcher.go:76: [DEBUG]plugin: &{{{0 pending storage/cwd/langgenius/regex-0.0.3@55439fc9083494e90856405256a1755c4ee47aa395cef50b6fc3614d4f11a479 <nil> <nil> true <nil> []} {{0.0.3 plugin langgenius regex {Regex 正则表达式提取 Regex} {A tool for regex extraction. 一个用于正则表达式内容提取的工具。 A tool for regex extraction.} icon.svg {1048576 0xc00057b3e0} {[provider/regex.yaml] [] [] []} {0.0.1 [amd64 arm64] {python 3.12 main}} [utilities productivity] {658609186 63862416224 <nil>} <nil>} true <nil> <nil> 0xc0001c90e0 <nil>} []} 0xc000810360} 2025/03/12 17:50:11 launcher.go:82: [DEBUG]identity: langgenius/regex:0.0.3@55439fc9083494e90856405256a1755c4ee47aa395cef50b6fc3614d4f11a479 2025/03/12 17:50:11 launcher.go:109: [DEBUG]decoder: &{<nil> {0xc000649600 55439fc9083494e90856405256a1755c4ee47aa395cef50b6fc3614d4f11a479} 0xc000260000 <nil> Daq1Ou3rTs8tCXNJ6GP/+soIn6XpSlbfsfz1BIgL86eMUg89ATEviSqPE4S99yDZwmokNvvoIVeLqwE11Nf7zImCC9CNgWQgYpksUsmOhjF5M+lPCihA0Z0LsFlnKseRzkFgpR0+RqgMO+3/BgOW+fDJL/6HmSbH38pFVQd+to2qNuZpw22ErxGEJoH52ZnZ0hSQIZ0p0du7Mi3XCBv731IzsQcznP39+bhZit4mHQYP3jgVbILkIBNYIzQZ9Ea+8sDr29iI2EtDr14SBVsAI75WikFDo9uXmMX5ChSOd2jMJFuuolx/oAVhZ1zxZnxaz6q9GPOM4gKB8nklx0zUJM4/B1Whvp6el2MqJEWThSTjJPNQ+qD8ANkpUIlrJ6cZDAm4B71IXBsOgEwfU0USE9YQbb6oP0+zMT5YUBo44Eb5XUb+jXyTVQzZ9VVdeuDLNw+2TCTdbawP26YxCEMJkGd+6bJWTObnXshq2Qdhxjbk5ujzLC+u2REj7cJlIHyMFOcjMn4eXOKd+iq4OtldR+421SFYCaNoyW9MFP66/UvB6WoRDCs2PzjLr+ChcZtikcwT4yJ+TXQSIl06o2zSZo8VapeTbOXUtalG/GycykRtUt+a2lDMKM3n3kHcT4Z6Pa09Sa/EX7wBkZFRmvCtFOAQdun4lasZE40IfwxoOz0= 1739776273} 2025/03/12 17:50:11 launcher.go:161: [DEBUG]plugin Store: &{{4 {{0 0} {[] {} 0xc000124f20} map[langgenius/agent:0.0.9@f16916b704a20067317dbe9030f62aa28f0832021a3ef6d4ce699504074c5e13:0xc000186000 langgenius/echarts:0.0.1@fe95412f101f2735530ea05f479ab5e8fbe1d4f4b2847f09e490e7d1d0125de5:0xc00048a408 langgenius/openai_api_compatible:0.0.7@f20c7275bbcf055ec5d170dd5128e341986e2dcba5266d08fd080d4bdf2288f6:0xc00048a008 langgenius/regex:0.0.3@55439fc9083494e90856405256a1755c4ee47aa395cef50b6fc3614d4f11a479:0xc00048a058] 2}} 52428800 storage/cwd plugins 0xc0001e31a0 0xc0001187c0 0xc0001187e0 [0x12da2a0] 0xc0001deb70 0xc0001188e0 /usr/bin/python3 120 true true 0xc0001287f0 0xc00011c5b0 local} 2025/03/12 17:50:11 launcher.go:178: [DEBUG]add max launching lock to prevent too many plugins launching at the same time 2025/03/12 17:50:13 stdio_handle.go:128: [INFO]plugin langgenius/echarts:0.0.1: Installed tool: echarts 2025/03/12 17:50:14 stdio_handle.go:128: [INFO]plugin langgenius/agent:0.0.9: Installed agent: agent 2025/03/12 17:50:14 stdio_handle.go:128: [INFO]plugin langgenius/openai_api_compatible:0.0.7: Installed model: openai_api_compatible ```
Author
Owner

@nhha1602 commented on GitHub (Mar 24, 2025):

Hi,
I deployed plugin on k8s. I used NFS (as pv/pvc) for storage plugin with PLUGIN_WORKING_PATH & PLUGIN_STORAGE_LOCAL_ROOT. Then I tried to scale down then up. All files in PLUGIN_WORKING_PATH still ok but all files in PLUGIN_STORAGE_LOCAL_ROOT will be deleted - This raised error: [ERROR]PluginDaemonInternalServerError: no available node, plugin not found

@nhha1602 commented on GitHub (Mar 24, 2025): Hi, I deployed plugin on k8s. I used NFS (as pv/pvc) for storage plugin with PLUGIN_WORKING_PATH & PLUGIN_STORAGE_LOCAL_ROOT. Then I tried to scale down then up. All files in PLUGIN_WORKING_PATH still ok but all files in PLUGIN_STORAGE_LOCAL_ROOT will be deleted - This raised error: _`[ERROR]PluginDaemonInternalServerError: no available node, plugin not found`_
Author
Owner

@nhha1602 commented on GitHub (Mar 25, 2025):

Hi,

Just update: My wrong about configure of PLUGIN_STORAGE_LOCAL_ROOT in deployment. After change it to pv/pvc on NFS, It is OK now (no files deleted).

@nhha1602 commented on GitHub (Mar 25, 2025): Hi, Just update: My wrong about configure of PLUGIN_STORAGE_LOCAL_ROOT in deployment. After change it to pv/pvc on NFS, It is OK now (no files deleted).
Author
Owner

@nikkoyuthinkcol commented on GitHub (Mar 26, 2025):

This issue will consistently happen when deploying with Kubernetes.

I am currently using Azure Kubernetes (AKS), with the plugin daemon being linked to the persistentStorage of Azure Storage account's File Share. (Standard V2)

nodeCount: 2

To reproduce this, it is simple:

  1. https://github.com/Winson-030/dify-kubernetes (use upgrade/dify-version-100)
  2. update the version of api service and worker service to dify-api:1.1.0
  3. Change the following dify-deployment.yaml file to such (dify-plugin-daemon):
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: dify-plugin-daemon
  namespace: dify
  labels:
    app: dify-plugin-daemon
spec:
  replicas: 1
  revisionHistoryLimit: 1
  selector:
    matchLabels:
      app: dify-plugin-daemon
  template:
    metadata:
      labels:
        app: dify-plugin-daemon
    spec:
      nodeSelector:
        kubernetes.io/os: linux
      automountServiceAccountToken: false
      volumes:
      - name: dify-plugin-daemon-storage
        persistentVolumeClaim:
          claimName: plugin-daemon-pvc
        # hostPath:
        #   path: /root/dify/app/plugin/storage
        #   type: DirectoryOrCreate
      containers:
      - name: dify-plugin-daemon
        image: langgenius/dify-plugin-daemon:0.0.5-local
        resources:
          limits:
            memory: "1024Mi"
            cpu: "2000m"
          requests:
            memory: "256Mi"
            cpu: "500m"
        ports:
        - containerPort: 5003
          protocol: TCP
          name: debug-port
          
        - containerPort: 5002
          protocol: TCP
          name: service-port
        env:
          - name: DB_USERNAME
            value: postgres

          - name: DB_PASSWORD
            value: difyai123456

          - name: DB_HOST
            value: dify-postgres

          - name: DB_PORT
            value: '5432'

          - name: REDIS_HOST
            value: dify-redis

          - name: REDIS_PORT
            value: '6379'

          - name: REDIS_USERNAME
            value: ''

          - name: REDIS_PASSWORD
            value: difyai123456
          - name: REDIS_USE_SSL
            value: "false"
          - name: REDIS_DB
            value: "0"
          - name: CELERY_BROKER_URL
            value: >-
              redis://$(REDIS_USERNAME):$(REDIS_PASSWORD)@$(REDIS_HOST):$(REDIS_PORT)/1
          - name: 'DB_DATABASE'
            value: 'dify_plugin'
          - name: 'SERVER_PORT'
            value: '5002'
          - name: 'EXPOSE_PLUGIN_DAEMON_PORT'
            value: '5002'
          - name: 'SERVER_KEY'
            value: '' #REDACTED
          - name: 'MAX_PLUGIN_PACKAGE_SIZE'
            value: '52428800'
          - name: 'PPROF_ENABLED'
            value: 'false'
          - name: 'DIFY_INNER_API_URL'
            value: 'http://dify-api:5001'
          - name: 'DIFY_INNER_API_KEY'
            value: '' #REDACTED
          - name: 'PLUGIN_REMOTE_INSTALLING_HOST'
            value: '0.0.0.0'
          - name: 'PLUGIN_REMOTE_INSTALLING_PORT'
            value: '5003'
          - name: 'PLUGIN_WORKING_PATH'
            value: '/app/storage/cwd'
          - name: 'FORCE_VERIFYING_SIGNATURE'
            value: 'true'
          - name: 'EXPOSE_PLUGIN_DEBUGGING_HOST'
            value: 'localhost'
          - name: 'EXPOSE_PLUGIN_DEBUGGING_PORT'
            value: '5003'
          - name: 'PYTHON_ENV_INIT_TIMEOUT'
            value: '1000'
          # - name: 'ENDPOINT_URL_TEMPLATE'
          #   value: 'http://localhost/e/{hook_id}'
        volumeMounts:
        - name: dify-plugin-daemon-storage
          mountPath: /app/storage

---
  1. Add the dify-deployment.yaml file as such (add persistentVolume and persistentVolumeClaim)
    Note that the persistentVolume is using Azure File Storage.
---
apiVersion: v1
kind: PersistentVolume
metadata:
  annotations:
    pv.kubernetes.io/provisioned-by: file.csi.azure.com
  name: plugin-daemon-pv
  namespace: dify
spec:
  storageClassName: azurefile-csi
  capacity:
    storage: 30Gi
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  csi:
    driver: file.csi.azure.com
    volumeHandle: "REDACTED#REDACTED#REDACTED"  # make sure this volumeid is unique for every identical share in the cluster
    volumeAttributes:
      shareName: REDACTED
    nodeStageSecretRef:
      name: SECRET
      namespace: dify
  mountOptions:
    - dir_mode=0777
    - file_mode=0777
    - uid=0
    - gid=0
    - mfsymlinks
    - cache=strict
    - nosharesock
    - nobrl
---
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: plugin-daemon-pvc
  namespace: dify
spec:
  storageClassName: azurefile-csi
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 30Gi
---
  1. Install any plugins from the marketplace or whatever that's available in Dify.
  2. Upgrade the plugin-daemon from 0.0.5 to 0.0.6
  3. PluginDaemonInternalServerError: no available node, plugin not found

Temp fixes (not sure, but it is happening on my environment), sort of seal heal????

  1. remove one of the plugins
  2. others will automatically sort of download, install, compile and it is back.
@nikkoyuthinkcol commented on GitHub (Mar 26, 2025): This issue will consistently happen when deploying with Kubernetes. I am currently using Azure Kubernetes (AKS), with the plugin daemon being linked to the persistentStorage of Azure Storage account's File Share. (Standard V2) nodeCount: 2 To reproduce this, it is simple: 1. https://github.com/Winson-030/dify-kubernetes (use upgrade/dify-version-100) 2. update the version of **api service** and **worker service** to **dify-api:1.1.0** 3. **Change** the following `dify-deployment.yaml` file to such (dify-plugin-daemon): ``` --- apiVersion: apps/v1 kind: Deployment metadata: name: dify-plugin-daemon namespace: dify labels: app: dify-plugin-daemon spec: replicas: 1 revisionHistoryLimit: 1 selector: matchLabels: app: dify-plugin-daemon template: metadata: labels: app: dify-plugin-daemon spec: nodeSelector: kubernetes.io/os: linux automountServiceAccountToken: false volumes: - name: dify-plugin-daemon-storage persistentVolumeClaim: claimName: plugin-daemon-pvc # hostPath: # path: /root/dify/app/plugin/storage # type: DirectoryOrCreate containers: - name: dify-plugin-daemon image: langgenius/dify-plugin-daemon:0.0.5-local resources: limits: memory: "1024Mi" cpu: "2000m" requests: memory: "256Mi" cpu: "500m" ports: - containerPort: 5003 protocol: TCP name: debug-port - containerPort: 5002 protocol: TCP name: service-port env: - name: DB_USERNAME value: postgres - name: DB_PASSWORD value: difyai123456 - name: DB_HOST value: dify-postgres - name: DB_PORT value: '5432' - name: REDIS_HOST value: dify-redis - name: REDIS_PORT value: '6379' - name: REDIS_USERNAME value: '' - name: REDIS_PASSWORD value: difyai123456 - name: REDIS_USE_SSL value: "false" - name: REDIS_DB value: "0" - name: CELERY_BROKER_URL value: >- redis://$(REDIS_USERNAME):$(REDIS_PASSWORD)@$(REDIS_HOST):$(REDIS_PORT)/1 - name: 'DB_DATABASE' value: 'dify_plugin' - name: 'SERVER_PORT' value: '5002' - name: 'EXPOSE_PLUGIN_DAEMON_PORT' value: '5002' - name: 'SERVER_KEY' value: '' #REDACTED - name: 'MAX_PLUGIN_PACKAGE_SIZE' value: '52428800' - name: 'PPROF_ENABLED' value: 'false' - name: 'DIFY_INNER_API_URL' value: 'http://dify-api:5001' - name: 'DIFY_INNER_API_KEY' value: '' #REDACTED - name: 'PLUGIN_REMOTE_INSTALLING_HOST' value: '0.0.0.0' - name: 'PLUGIN_REMOTE_INSTALLING_PORT' value: '5003' - name: 'PLUGIN_WORKING_PATH' value: '/app/storage/cwd' - name: 'FORCE_VERIFYING_SIGNATURE' value: 'true' - name: 'EXPOSE_PLUGIN_DEBUGGING_HOST' value: 'localhost' - name: 'EXPOSE_PLUGIN_DEBUGGING_PORT' value: '5003' - name: 'PYTHON_ENV_INIT_TIMEOUT' value: '1000' # - name: 'ENDPOINT_URL_TEMPLATE' # value: 'http://localhost/e/{hook_id}' volumeMounts: - name: dify-plugin-daemon-storage mountPath: /app/storage --- ``` 3. **Add** the `dify-deployment.yaml` file as such (add persistentVolume and persistentVolumeClaim) **Note that the persistentVolume is using Azure File Storage**. ``` --- apiVersion: v1 kind: PersistentVolume metadata: annotations: pv.kubernetes.io/provisioned-by: file.csi.azure.com name: plugin-daemon-pv namespace: dify spec: storageClassName: azurefile-csi capacity: storage: 30Gi accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain csi: driver: file.csi.azure.com volumeHandle: "REDACTED#REDACTED#REDACTED" # make sure this volumeid is unique for every identical share in the cluster volumeAttributes: shareName: REDACTED nodeStageSecretRef: name: SECRET namespace: dify mountOptions: - dir_mode=0777 - file_mode=0777 - uid=0 - gid=0 - mfsymlinks - cache=strict - nosharesock - nobrl --- --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: plugin-daemon-pvc namespace: dify spec: storageClassName: azurefile-csi accessModes: - ReadWriteMany resources: requests: storage: 30Gi --- ``` 4. Install any plugins from the marketplace or whatever that's available in Dify. 5. Upgrade the plugin-daemon from 0.0.5 to 0.0.6 6. PluginDaemonInternalServerError: no available node, plugin not found Temp fixes (not sure, but it is happening on my environment), sort of seal heal???? 1. remove one of the plugins 2. others will automatically sort of download, install, compile and it is back.
Author
Owner

@qkzsky commented on GitHub (Apr 7, 2025):

I also encountered this problem. I installed about 10 plugins, but after upgrading, downgrading, and upgrading one of them, I encountered a situation where any plugin failed to access. It took about 10 minutes for the service to function properly
Observing the plugin installation directory, it was found that the size of the plugin directory was abnormal at the time of the exception. It is suspected that this may have affected the generation of plugin cache during the plugin upgrade process

@qkzsky commented on GitHub (Apr 7, 2025): I also encountered this problem. I installed about 10 plugins, but after upgrading, downgrading, and upgrading one of them, I encountered a situation where any plugin failed to access. It took about 10 minutes for the service to function properly Observing the plugin installation directory, it was found that the size of the plugin directory was abnormal at the time of the exception. It is suspected that this may have affected the generation of plugin cache during the plugin upgrade process
Author
Owner

@nikkoyuthinkcol commented on GitHub (Apr 7, 2025):

After I ran some experiments in Azure, I observed the following (for AKS):

  1. The Azure storage account file share (Standard v2) would be extremely slow. It takes about 30 minutes to install one plugin, and there is no guarantee that you can reproduce it even if you set PYTHON_ENV_INIT_TIMEOUT to more than 1000.
  2. The Azure storage account file share (Premium v2) is slightly better; it takes around 5-10 minutes to install one plugin. However, the behaviour is pretty inconsistent, you cannot make sure that some plugins can always be installed.
  3. Azure Disks perform extremely fast and have no downloading, installing, or upgrading errors. However, there's a catch: Azure Disks does not support file structure (i.e. ext4) ReadWriteMany, it is in block mode /dev/sda, meaning that you might need to do some tweaks (i.e. converting it to ext4) to use it.

In summary,
Lower tier I/O disks will suffer from extremely slow plugin installation and errors, and the easiest way is to get yourself better I/O disks or SSD.

There's something I'd like to know:

  1. Would there be any optimization to decrease the time of installation/downloading for third party plugins?
@nikkoyuthinkcol commented on GitHub (Apr 7, 2025): After I ran some experiments in Azure, I observed the following (for AKS): 1. The Azure storage account file share (Standard v2) would be extremely slow. It takes about 30 minutes to install one plugin, and there is no guarantee that you can reproduce it even if you set `PYTHON_ENV_INIT_TIMEOUT` to more than `1000`. 2. The Azure storage account file share (Premium v2) is slightly better; it takes around 5-10 minutes to install one plugin. However, the behaviour is pretty inconsistent, you cannot make sure that some plugins can always be installed. 3. Azure Disks perform extremely fast and have no downloading, installing, or upgrading errors. However, there's a catch: [Azure Disks does not support file structure (i.e. ext4)](https://github.com/kubernetes-sigs/azuredisk-csi-driver/tree/master/deploy/example/sharedisk) `ReadWriteMany`, it is in block mode `/dev/sda`, meaning that you might need to do some tweaks (i.e. converting it to `ext4`) to use it. In summary, Lower tier I/O disks will suffer from extremely slow plugin installation and errors, and the easiest way is to get yourself better I/O disks or SSD. There's something I'd like to know: 1. Would there be any optimization to decrease the time of installation/downloading for third party plugins?
Author
Owner

@weweibuy commented on GitHub (Apr 11, 2025):

老哥我遇到类似的问题, 不过把配置里的 PIP_MIRROR_URL 改成国内的就好

@weweibuy commented on GitHub (Apr 11, 2025): 老哥我遇到类似的问题, 不过把配置里的 PIP_MIRROR_URL 改成国内的就好
Author
Owner

@weweibuy commented on GitHub (Oct 13, 2025):

我用docker 部署的. 修改 dify/docker/.env 文件中的PIP_MIRROR_URL=http://mirrors.aliyun.com/pypi/simple/ 我是这样的

发送自 Windows 10 版邮件应用

发件人: mkbaka7
发送时间: 2025年10月13日 15:52
收件人: langgenius/dify-plugin-daemon
抄送: weweibuy; Comment
主题: Re: [langgenius/dify-plugin-daemon] PluginDaemonInternalServerError:no available node, plugin not found (Issue #71)

woshiyigshuaig left a comment (langgenius/dify-plugin-daemon#71)
老哥我遇到类似的问题, 不过把配置里的 PIP_MIRROR_URL 改成国内的就好
image.png (view on web) 这里吗

Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: @.***>

@weweibuy commented on GitHub (Oct 13, 2025): 我用docker 部署的. 修改 dify/docker/.env 文件中的PIP_MIRROR_URL=http://mirrors.aliyun.com/pypi/simple/ 我是这样的 发送自 Windows 10 版邮件应用 发件人: mkbaka7 发送时间: 2025年10月13日 15:52 收件人: langgenius/dify-plugin-daemon 抄送: weweibuy; Comment 主题: Re: [langgenius/dify-plugin-daemon] PluginDaemonInternalServerError:no available node, plugin not found (Issue #71) woshiyigshuaig left a comment (langgenius/dify-plugin-daemon#71) 老哥我遇到类似的问题, 不过把配置里的 PIP_MIRROR_URL 改成国内的就好 image.png (view on web) 这里吗 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: ***@***.***>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-daemon#27