apache/hadoop · critical · ServerException
S06
S06
Error message
Could not load file [{0}], {1} What it means
After confirming httpfs-site.xml is a regular file, Server.initConfig() opens and parses it; an IOException during open/read/parse is wrapped as ServerException S06('Could not load file [<file>], <cause>'). Common causes: XML not well-formed, unreadable permissions, or read errors on the underlying storage.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/server/Server.java:477
}
if (config == null) {
Configuration siteConf;
File siteFile = new File(file, name + "-site.xml");
if (!siteFile.exists()) {
log.warn("Site configuration file [{}] not found in config directory", siteFile);
siteConf = new Configuration(false);
} else {
if (!siteFile.isFile()) {
throw new ServerException(ServerException.ERROR.S05, siteFile.getAbsolutePath());
}
try {
log.debug("Loading site configuration from [{}]", siteFile);
inputStream = Files.newInputStream(siteFile.toPath());
siteConf = new Configuration(false);
ConfigurationUtils.load(siteConf, inputStream);
} catch (IOException ex) {
throw new ServerException(ServerException.ERROR.S06, siteFile, ex.getMessage(), ex);
}
}
config = new Configuration(false);
ConfigurationUtils.copy(siteConf, config);
}
ConfigurationUtils.injectDefaults(defaultConf, config);
ConfigRedactor redactor = new ConfigRedactor(config);
for (String name : System.getProperties().stringPropertyNames()) {
String value = System.getProperty(name);
if (name.startsWith(getPrefix() + ".")) {
config.set(name, value);
String redacted = redactor.redact(name, value);
log.info("System property sets {}: {}", name, redacted);
}
}
View on GitHub (pinned to 2add963021)
Solutions
- Validate syntax: xmllint --noout /etc/hadoop/httpfs/conf/httpfs-site.xml and fix reported line/column.
- Check permissions: the httpfs run user must read the file (chown/chmod as needed).
- Escape special characters (& < >) in property values or wrap them in CDATA.
- Keep a pre-restart config check (xmllint) in your deployment pipeline so bad XML never reaches the daemon.
Example fix
<!-- before: invalid XML --> <property><name>httpfs.admin.group</name><value>a&b</value></property> <!-- after --> <property><name>httpfs.admin.group</value>a&b</value></property>
Defensive patterns
Strategy: validation
Validate before calling
# pre-start: site XML must be well-formed and readable
SITE="${HTTPFS_CONFIG}/httpfs-site.xml"
xmllint --noout "$SITE" || { echo 'FATAL: malformed XML'; exit 1; }
sudo -u httpfs test -r "$SITE" || { echo 'FATAL: not readable by httpfs'; exit 1; } Prevention
- Run xmllint on httpfs-site.xml in CI and in pre-start hooks.
- Escape XML specials (&, <) in property values.
- Use atomic writes (write temp + rename) when pushing config so the daemon never reads a half-written file.
When it happens
Trigger: Editing httpfs-site.xml and leaving an unclosed tag or stray '&' ; file owned by root with no read for the httpfs user; NFS stale handle or disk fault when reading; concurrent edit that truncated the file mid-read.
Common situations: Manual edits without validation before restart; automated config pushes that race with the daemon start; permission drift after security hardening; XML containing raw '<' in values (e.g. passwords).
Related errors
- Could not read HttpFS signature secret file: {0}
- [{0}] must be an absolute path [{1}]
- S01
- S02
- Could not read signature secret file: ${signatureSecretFile}
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/5145e86d3a42bb43.
Report an issue: GitHub.