MyCATApache/Mycat-Server · warning · ConfigException
{e.getMessage()}
Error message
{e.getMessage()} What it means
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.
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.
Example fix
// before
catch (IOException e) { throw new ConfigException(e.getMessage()); }
// after
catch (IOException e) { LOGGER.warn("failed to close dnindex stream", e); } Defensive patterns
Strategy: try-catch
Try / catch
try {
comparer.compare();
} catch (ConfigException e) {
// thrown from stream close in loadDnIndexProps; usually transient IO
LOGGER.warn("dnindex stream close failed: " + e.getMessage());
// retry once after checking filesystem health
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: Corrupted underlying file handle; stream already closed by another path; filesystem/NFS issues in containerized deployments.
Understand the failure class
Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.
Related errors
- dbType: is not support for the moment!
- error while calling spill() on
- error while calling spill() on
- Failed to create local dir in $newDir.
- Failed to delete:
AI-assisted analysis of MyCATApache/Mycat-Server@65f8d8beb7 (2026-09-11).
Data as JSON: /api/errors/2e6504ccaff12d1f.
Report an issue: GitHub.
Appendix: source
Thrown at src/main/java/io/mycat/util/dataMigrator/ConfigComparer.java:266
throw new ConfigException(schemaName+":"+tableName+" old & new rule Algorithm is not same!");
}
}
private Properties loadDnIndexProps() {
Properties prop = new Properties();
InputStream is = null;
try {
is = ConfigComparer.class.getResourceAsStream(DN_INDEX_FILE);
prop.load(is);
} catch (Exception e) {
throw new ConfigException("please check file \"dnindex.properties\" "+e.getMessage());
} finally {
try {
if(is !=null){
is.close();
}
} catch (IOException e) {
throw new ConfigException(e.getMessage());
}
}
return prop;
}
}
View on GitHub (pinned to 65f8d8beb7)