{"record":{"id":"2e6504ccaff12d1f","repo":"MyCATApache/Mycat-Server","slug":"e-getmessage","errorCode":null,"errorMessage":"{e.getMessage()}","messagePattern":"\\{e\\.getMessage\\(\\)\\}","errorType":"exception","errorClass":"ConfigException","httpStatus":null,"severity":"warning","filePath":"src/main/java/io/mycat/util/dataMigrator/ConfigComparer.java","lineNumber":266,"sourceCode":"\t\t\tthrow new ConfigException(schemaName+\":\"+tableName+\" old & new rule Algorithm is not same!\");\n\t\t}\n\t}\n\t\n\tprivate Properties loadDnIndexProps() {\n\t\tProperties prop = new Properties();\n\t\tInputStream is = null;\n\t\ttry {\n\t\t\tis = ConfigComparer.class.getResourceAsStream(DN_INDEX_FILE);\n\t\t\tprop.load(is);\n\t\t} catch (Exception e) {\n\t\t\tthrow new ConfigException(\"please check file \\\"dnindex.properties\\\" \"+e.getMessage());\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif(is !=null){\n\t\t\t\t\tis.close();\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new ConfigException(e.getMessage());\n\t\t\t}\n\t\t}\n\t\treturn prop;\n\t}\n}\n","sourceCodeStart":248,"sourceCodeEnd":272,"githubUrl":"https://github.com/MyCATApache/Mycat-Server/blob/65f8d8beb752f935752f2a0eec0ab017facab9ef/src/main/java/io/mycat/util/dataMigrator/ConfigComparer.java#L248-L272","documentation":"In loadDnIndexProps' finally block, closing the InputStream can itself throw IOException, and the code rethrows it as a ConfigException containing only e.getMessage(). This is a rare error indicating the stream was opened but could not be cleanly closed, and it may mask a successful load.","triggerScenarios":"InputStream.close() throws IOException — typically when the underlying resource/stream is broken or already closed during close; only occurs if dnindex.properties was actually opened but closing failed.","commonSituations":"Corrupted underlying file handle; stream already closed by another path; filesystem/NFS issues in containerized deployments.","solutions":["Read the message for the underlying IOException cause and fix the storage/classpath issue it points to.","Check filesystem health/permissions on the directory serving the resource.","Retry the migration; this is usually transient if caused by I/O hiccups.","As a code-level fix, log the close failure instead of throwing, so it does not mask a successful property load."],"exampleFix":"// before\ncatch (IOException e) { throw new ConfigException(e.getMessage()); }\n// after\ncatch (IOException e) { LOGGER.warn(\"failed to close dnindex stream\", e); }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    comparer.compare();\n} catch (ConfigException e) {\n    // thrown from stream close in loadDnIndexProps; usually transient IO\n    LOGGER.warn(\"dnindex stream close failed: \" + e.getMessage());\n    // retry once after checking filesystem health\n}","preventionTips":["Ensure stable local filesystem for conf resources (avoid flaky NFS mounts)","Fix code to log rather than throw on close failure so a successful load isn't masked","Retry transient IO errors before restarting the migration"],"tags":["java","io","resource-cleanup","data-migration"],"backgroundTag":"file-read-failed","analyzedSha":"65f8d8beb752f935752f2a0eec0ab017facab9ef","analyzedAt":"2026-09-11T00:12:21.696Z","contentChangedAt":"2026-09-11T00:12:21.696Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}