Skip to content

Commit 1773b1a

Browse files
authored
fix PluginDaemonInternalServerError: no available node, plugin runtime not found (#549)
* fix PluginDaemonInternalServerError: no available node, plugin runtime not found Fix the bug where after a plugin is successfully upgraded, new requests result in the plugin daemon service responding with "no available node, plugin runtime not found". The root cause is that when the plugin is upgraded successfully, the corresponding value in Redis is not updated. Consequently, when a new request arrives, it reads the outdated plugin version from Redis and fails to locate the correct runtime. * raise error if failed
1 parent 66fa57e commit 1773b1a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

internal/types/models/curd/atomic.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package curd
22

33
import (
44
"errors"
5+
"github.com/langgenius/dify-plugin-daemon/pkg/utils/cache"
6+
"github.com/langgenius/dify-plugin-daemon/pkg/utils/cache/helper"
57

68
"github.com/langgenius/dify-plugin-daemon/internal/db"
79
"github.com/langgenius/dify-plugin-daemon/internal/types/models"
@@ -602,6 +604,10 @@ func UpgradePlugin(
602604
if err != nil {
603605
return nil, err
604606
}
605-
607+
pluginId := newPluginUniqueIdentifier.PluginID() // get the pluginId
608+
pluginInstallationCacheKey := helper.PluginInstallationCacheKey(pluginId, tenantId) // make cache key
609+
if _, err = cache.AutoDelete[models.PluginInstallation](pluginInstallationCacheKey); err != nil {
610+
return nil, err
611+
}
606612
return &response, nil
607613
}

0 commit comments

Comments
 (0)