From 901dc024c0c544167e04f7b9cbe4229b8e9a6497 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 9 Aug 2026 08:19:01 +1000 Subject: [PATCH] [bug] Fix for plugin fetching (#12590) - Prevent operation on stale plugin --- src/backend/InvenTree/plugin/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/InvenTree/plugin/api.py b/src/backend/InvenTree/plugin/api.py index c8967f5da1..9b1685e158 100644 --- a/src/backend/InvenTree/plugin/api.py +++ b/src/backend/InvenTree/plugin/api.py @@ -358,7 +358,10 @@ def check_plugin( if not plugin_cfg.active: raise NotFound(detail=f"Plugin '{ref}' is not active") - plugin = plugin_cfg.plugin + # Look up via the registry rather than `plugin_cfg.plugin`: the latter can be a + # stale, un-instantiated plugin class in this worker if the plugin was activated + # by a different process (registry.get_plugin() forces a reload check first). + plugin = registry.get_plugin(plugin_cfg.key) if not plugin: raise NotFound(detail=f"Plugin '{ref}' not installed")