From 671a4612c33893238569af0708a1bb2c828985a7 Mon Sep 17 00:00:00 2001 From: "Lugh (Druid Bot)" Date: Wed, 11 Feb 2026 21:22:18 +0100 Subject: [PATCH] Fix: Check if plugin file exists before loading - Add explicit check for plugin file existence in LoadGoPlugin - Return clearer error message showing all searched paths - Allows --allow-plugin-errors flag to work properly - Prevents confusing 'unable to generate checksum' error when file doesn't exist This fixes the issue where missing plugin files cause cryptic errors during daemon startup, even when plugins are optional. --- internal/core/services/plugin_manager.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/core/services/plugin_manager.go b/internal/core/services/plugin_manager.go index 4d521b4..f42bce3 100644 --- a/internal/core/services/plugin_manager.go +++ b/internal/core/services/plugin_manager.go @@ -120,6 +120,11 @@ func (pm *PluginManager) LoadGoPlugin(name string) (commons.DruidPluginInterface path = "./druid_" + name } + // Check if the plugin file exists before attempting to load it + if _, err := os.Stat(path); os.IsNotExist(err) { + return nil, fmt.Errorf("plugin file not found: %s (looked in %s and ./druid_%s)", path, exPath+"/druid_"+name, name) + } + var cmd *exec.Cmd if os.Getenv("DRUID_DEBUG_PATH") != "" {