{"record":{"id":"de2f78288b7e562a","repo":"alibaba/nacos","slug":"server-error-de2f78","errorCode":"SERVER_ERROR","errorMessage":"Failed to apply local-only plugin config: {pluginId}","messagePattern":"Failed to apply local-only plugin config: (.+?)","errorType":"exception","errorClass":"NacosApiException","httpStatus":500,"severity":"error","filePath":"core/src/main/java/com/alibaba/nacos/core/plugin/PluginManager.java","lineNumber":350,"sourceCode":"                e.getMessage());\n        }\n        \n        // LocalOnly mode: only update local memory, skip cluster sync\n        if (localOnly) {\n            LOGGER.warn(\n                \"[PluginManager] LocalOnly mode: applying config change to this node only, pluginId={}\",\n                pluginId);\n            try {\n                pluginConfigService.updateLocalOnlyConfig(info, pluginInstances.get(pluginId),\n                    normalizedConfig);\n            } catch (IllegalArgumentException e) {\n                throw new NacosApiException(NacosException.INVALID_PARAM,\n                    ErrorCode.PARAMETER_VALIDATE_ERROR, e.getMessage());\n            } catch (PluginConfigApplyException e) {\n                throw new NacosApiException(NacosException.SERVER_ERROR, ErrorCode.SERVER_ERROR, e,\n                    e.getMessage());\n            } catch (RuntimeException e) {\n                throw new NacosApiException(NacosException.SERVER_ERROR, ErrorCode.SERVER_ERROR, e,\n                    \"Failed to apply local-only plugin config: \" + pluginId);\n            }\n            return;\n        }\n        \n        if (EnvUtil.getStandaloneMode()) {\n            applyStandaloneConfigChange(pluginId, normalizedConfig);\n        } else {\n            getClusterSynchronizer().syncConfigChange(pluginId, normalizedConfig);\n        }\n        \n        LOGGER.info(\"[PluginManager] Plugin {} config updated\", pluginId);\n    }\n    \n    /**\n     * List all plugins.\n     *\n     * @return list of plugin info","sourceCodeStart":332,"sourceCodeEnd":368,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/core/src/main/java/com/alibaba/nacos/core/plugin/PluginManager.java#L332-L368","documentation":"In localOnly mode, PluginManager.updatePluginConfig calls pluginConfigService.updateLocalOnlyConfig; an unexpected RuntimeException (anything other than IllegalArgumentException or PluginConfigApplyException) is wrapped as NacosApiException(SERVER_ERROR 500) with message \"Failed to apply local-only plugin config: {pluginId}\". The real cause is in the wrapped exception.","triggerScenarios":"PUT /v3/console/plugin/config with localOnly=true where applying the new config throws an uncaught runtime error: an NPE/class-cast inside the plugin, or an IO failure writing the local plugin state/config file.","commonSituations":"Plugin implementation bug; corrupted local plugin state file; read-only or missing plugin config directory; invalid config value that passed schema validation but broke the plugin's apply path.","solutions":["Read the server log for the wrapped RuntimeException cause right after this 500.","Fix file permissions / free disk for the plugin state directory.","Correct the config values and retry; if the plugin impl is broken, update/remove the plugin jar."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// localOnly apply failures are server-side; best you can do is sanity-check config shape\nif (config == null || config.isEmpty()) throw new IllegalArgumentException(\"empty config\");","typeGuard":null,"tryCatchPattern":"try {\n    pluginClient.updateConfig(type, name, config, /*localOnly*/ true);\n} catch (NacosApiException e) {\n    if (e.getErrCode() == 30000 && e.getMessage().contains(\"local-only plugin config\")) {\n        // inspect server log for wrapped cause, fix plugin/permissions, then retry\n        log.error(\"local-only config apply failed for \" + type + \":\" + name, e);\n    } else { throw e; }\n}","preventionTips":["Watch server logs for the wrapped RuntimeException cause.","Keep the plugin state/config directory writable.","Validate config values against the plugin schema before applying."],"tags":["plugin","configuration","local-only","server-error"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}