apache/hadoop · critical · ServerException
S05
S05
Error message
[{0}] is not a file What it means
While loading site configuration, Server.initConfig() accepts a missing httpfs-site.xml (warn only) but if the path exists yet is not a regular file — typically a directory — it throws ServerException S05('[<path>] is not a file') and aborts startup.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/server/Server.java:469
defaultConf = new Configuration(false);
} else {
try {
defaultConf = new Configuration(false);
ConfigurationUtils.load(defaultConf, inputStream);
} catch (Exception ex) {
throw new ServerException(ServerException.ERROR.S03, defaultConfig, ex.getMessage(), ex);
}
}
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()) {View on GitHub (pinned to 2add963021)
Solutions
- Check ls -ld on the exact path from the message; if it is a directory, remove it and install the XML file (or point httpfs.config.dir at the right directory).
- For configMap-style mounts, mount the key as a subPath/file so the final path is a regular file.
- Re-run startup and confirm it reaches init of services.
Example fix
# before $ ls -ld /etc/hadoop/httpfs/conf/httpfs-site.xml drwxr-xr-x 2 root root ... /etc/hadoop/httpfs/conf/httpfs-site.xml # directory! # after $ rmdir /etc/hadoop/httpfs/conf/httpfs-site.xml $ cp httpfs-site.xml /etc/hadoop/httpfs/conf/httpfs-site.xml
Defensive patterns
Strategy: validation
Validate before calling
# pre-start: site file must be a regular file if present
SITE="${HTTPFS_CONFIG}/httpfs-site.xml"
if [ -e "$SITE" ] && [ ! -f "$SITE" ]; then
echo "FATAL: $SITE exists but is not a regular file"; exit 1
fi Prevention
- Mount configMap keys as files (subPath), not as directories over the file path.
- Lint config trees after every config-management run: find path -type d where a file is expected.
- Keep the config dir vs config file distinction explicit in scripts.
When it happens
Trigger: /etc/hadoop/conf/httpfs-site.xml created as a directory (e.g. by mkdir -p gone wrong or a mount point placeholder); a bind-mount that mounted a directory over the expected file path; tooling that creates empty directory stubs for config paths.
Common situations: Config-management systems (Puppet/Chef/Ansible) managing the path as a directory resource; Kubernetes configMap volume mounts that expose a directory where a single file was expected; operators confusing the config DIR and the site FILE path.
Related errors
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/26cdff37bff4959c.
Report an issue: GitHub.