{"record":{"id":"8164f1f54036ec80","repo":"alibaba/nacos","slug":"failed-to-replace-all-plugin-states","errorCode":null,"errorMessage":"Failed to replace all plugin states","messagePattern":"Failed to replace all plugin states","errorType":"exception","errorClass":"PluginPersistenceException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/com/alibaba/nacos/core/plugin/storage/FilePluginStatePersistenceImpl.java","lineNumber":119,"sourceCode":"                writeJsonToFile(PLUGIN_STATE_FILE, states);\n                LOGGER.debug(\"[FilePluginStatePersistenceImpl] Saved plugin state: {}={}\", pluginId,\n                    enabled);\n            } catch (Exception e) {\n                throw new PluginPersistenceException(\"Failed to save plugin state: \" + pluginId, e);\n            }\n        }\n    }\n    \n    @Override\n    public void replaceAllStates(Map<String, Boolean> states) {\n        synchronized (stateLock) {\n            try {\n                Map<String, Boolean> statesToStore = states == null\n                    ? new HashMap<>() : new HashMap<>(states);\n                writeJsonToFile(PLUGIN_STATE_FILE, statesToStore);\n                LOGGER.debug(\"[FilePluginStatePersistenceImpl] Replaced all plugin states\");\n            } catch (Exception e) {\n                throw new PluginPersistenceException(\"Failed to replace all plugin states\", e);\n            }\n        }\n    }\n    \n    /**\n     * Save plugin configuration.\n     *\n     * @param pluginId plugin ID\n     * @param config configuration key-value pairs\n     */\n    @Override\n    public void saveConfig(String pluginId, Map<String, String> config) {\n        synchronized (configLock) {\n            try {\n                Map<String, Map<String, String>> configs = loadAllConfigs();\n                configs.put(pluginId, config);\n                writeJsonToFile(PLUGIN_CONFIG_FILE, configs);\n                LOGGER.debug(\"[FilePluginStatePersistenceImpl] Saved plugin config for {}\",","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/core/src/main/java/com/alibaba/nacos/core/plugin/storage/FilePluginStatePersistenceImpl.java#L101-L137","documentation":"Error \"Failed to replace all plugin states\" thrown in alibaba/nacos.","triggerScenarios":"Thrown at core/src/main/java/com/alibaba/nacos/core/plugin/storage/FilePluginStatePersistenceImpl.java:119 when the library encounters an invalid state.","commonSituations":"Replacing all plugin states on disk failed.","solutions":["Inspect the server logs for the underlying cause, fix it, and retry the operation."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}