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

  1. Read the message for the underlying IOException cause and fix the storage/classpath issue it points to.
  2. Check filesystem health/permissions on the directory serving the resource.
  3. Retry the migration; this is usually transient if caused by I/O hiccups.
  4. 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

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


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)