{"record":{"id":"1172df38d874cd4f","repo":"alibaba/nacos","slug":"resource-not-found-1172df","errorCode":"RESOURCE_NOT_FOUND","errorMessage":"Plugin not found: {pluginId}","messagePattern":"Plugin not found: (.+?)","errorType":"exception","errorClass":"NacosApiException","httpStatus":404,"severity":"warning","filePath":"core/src/main/java/com/alibaba/nacos/core/plugin/PluginManager.java","lineNumber":241,"sourceCode":"     * @throws NacosApiException if plugin not found or is critical\n     */\n    public void setPluginEnabled(String pluginId, boolean enabled) throws NacosApiException {\n        setPluginEnabled(pluginId, enabled, false);\n    }\n    \n    /**\n     * Set plugin enabled/disabled state.\n     *\n     * @param pluginId plugin ID\n     * @param enabled whether to enable\n     * @param localOnly if true, only update local node without Raft sync (for emergency use)\n     * @throws NacosApiException if plugin not found or is critical\n     */\n    public void setPluginEnabled(String pluginId, boolean enabled, boolean localOnly)\n        throws NacosApiException {\n        PluginInfo info = pluginRegistry.get(pluginId);\n        if (info == null) {\n            throw new NacosApiException(NacosException.NOT_FOUND, ErrorCode.RESOURCE_NOT_FOUND,\n                \"Plugin not found: \" + pluginId);\n        }\n        \n        try {\n            validateRuntimeChangeSupported(info, \"state\");\n            validateStateChangeInternal(info, enabled);\n        } catch (IllegalArgumentException e) {\n            throw new NacosApiException(NacosException.INVALID_PARAM,\n                ErrorCode.PARAMETER_VALIDATE_ERROR, e.getMessage());\n        }\n        if (info.isEnabled() == enabled) {\n            LOGGER.debug(\"[PluginManager] Plugin {} already has enabled={}\", pluginId, enabled);\n            return;\n        }\n        \n        // LocalOnly mode: only update local memory, skip cluster sync\n        if (localOnly) {\n            LOGGER.warn(","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/core/src/main/java/com/alibaba/nacos/core/plugin/PluginManager.java#L223-L259","documentation":"PluginManager.setPluginEnabled throws NacosApiException(NacosException.NOT_FOUND 404, ErrorCode.RESOURCE_NOT_FOUND 20004) when the pluginId is absent from pluginRegistry. The pluginId is composed as {type}:{name} (e.g. \"trace:test\", \"auth:nacos\"). This method backs PUT /v3/console/plugin/status.","triggerScenarios":"PUT /v3/console/plugin/status?pluginType=auth&pluginName=ldap for a plugin that is not installed/registered; a typo in the type or name; calling before startup plugin scanning finished.","commonSituations":"Plugin jar missing from the classpath/plugins dir; using a plugin name that differs from its registered id; the plugin type abbreviation is wrong (e.g. \"authentication\" instead of \"auth\").","solutions":["Call GET /v3/console/plugin/list first and use an exact pluginId/type+name from the result.","Ensure the plugin jar is present on the server classpath and loaded at startup.","Check the server log for plugin load failures."],"exampleFix":"// before\nPUT /v3/console/plugin/status?pluginType=auth&pluginName=ldap&enabled=false\n// after (verify id first)\nGET /v3/console/plugin/list?pluginType=auth  -> use the real pluginName","handlingStrategy":"validation","validationCode":"// Resolve exact plugin id from the server before toggling\nList<PluginInfoVO> plugins = pluginClient.list(\"auth\");\nboolean exists = plugins.stream().anyMatch(p -> p.getPluginName().equals(name));\nif (!exists) throw new IllegalArgumentException(\"unknown plugin auth:\" + name);\npluginClient.setEnabled(\"auth\", name, enabled, localOnly);","typeGuard":null,"tryCatchPattern":"try {\n    pluginClient.setEnabled(type, name, enabled, localOnly);\n} catch (NacosApiException e) {\n    if (e.getErrCode() == 20004 && e.getMessage().contains(\"Plugin not found\")) {\n        // refresh the plugin list and retry with the real id\n    } else { throw e; }\n}","preventionTips":["Always list plugins first and use the exact type+name.","Ensure the plugin jar is deployed before toggling.","Check startup logs for plugin load errors."],"tags":["plugin","not-found","validation","console-api"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}