{"record":{"id":"90cf299832b71f09","repo":"alibaba/nacos","slug":"failed-to-read-plugin-persistence-file-filename","errorCode":null,"errorMessage":"Failed to read plugin persistence file: {fileName}","messagePattern":"Failed to read plugin persistence file: (.+?)","errorType":"exception","errorClass":"PluginPersistenceException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/com/alibaba/nacos/core/plugin/storage/FilePluginStatePersistenceImpl.java","lineNumber":246,"sourceCode":"    }\n    \n    private <T> T readJsonFromFile(String fileName, TypeReference<T> typeRef,\n        boolean failOnError) {\n        Path filePath = Paths.get(dataDir, fileName);\n        if (!Files.exists(filePath)) {\n            return createEmptyMap(typeRef);\n        }\n        \n        try {\n            String content = new String(Files.readAllBytes(filePath), StandardCharsets.UTF_8);\n            if (StringUtils.isBlank(content)) {\n                return createEmptyMap(typeRef);\n            }\n            return JacksonUtils.toObj(content, typeRef);\n        } catch (Exception e) {\n            LOGGER.error(\"[FilePluginStatePersistenceImpl] Failed to read file: {}\", fileName, e);\n            if (failOnError) {\n                throw new PluginPersistenceException(\n                    \"Failed to read plugin persistence file: \" + fileName, e);\n            }\n            return createEmptyMap(typeRef);\n        }\n    }\n    \n    @SuppressWarnings(\"unchecked\")\n    private <T> T createEmptyMap(TypeReference<T> typeRef) {\n        return (T) new HashMap<>(16);\n    }\n    \n    private void writeJsonToFile(String fileName, Object data) throws IOException {\n        ensureDataDirExists();\n        Path filePath = Paths.get(dataDir, fileName);\n        String content = JacksonUtils.toJson(data);\n        Files.write(filePath, content.getBytes(StandardCharsets.UTF_8));\n    }\n}","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/core/src/main/java/com/alibaba/nacos/core/plugin/storage/FilePluginStatePersistenceImpl.java#L228-L264","documentation":"Error \"Failed to read plugin persistence file: {fileName}\" thrown in alibaba/nacos.","triggerScenarios":"Thrown at core/src/main/java/com/alibaba/nacos/core/plugin/storage/FilePluginStatePersistenceImpl.java:246 when the library encounters an invalid state.","commonSituations":"Reading a plugin persistence file from 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"}