apache/hadoop · critical · ServerException
S01
S01
Error message
Dir [{0}] does not exist What it means
Server.verifyDir() checks that each runtime directory — homeDir, configDir (during initConfig), logDir (initLog) and tempDir — exists, throwing ServerException S01('[<dir>] does not exist') for the first missing one. It runs during daemon construction, so HttpFS aborts startup.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/server/Server.java:400
throw ex;
}
Status status = Status.valueOf(getConfig().get(getPrefixedName(CONF_STARTUP_STATUS), Status.NORMAL.toString()));
setStatus(status);
log.info("Server [{}] started!, status [{}]", name, status);
}
/**
* Verifies the specified directory exists.
*
* @param dir directory to verify it exists.
*
* @throws ServerException thrown if the directory does not exist or it the
* path it is not a directory.
*/
private void verifyDir(String dir) throws ServerException {
File file = new File(dir);
if (!file.exists()) {
throw new ServerException(ServerException.ERROR.S01, dir);
}
if (!file.isDirectory()) {
throw new ServerException(ServerException.ERROR.S02, dir);
}
}
/**
* Initializes Log4j logging.
*
* @throws ServerException thrown if Log4j could not be initialized.
*/
protected void initLog() throws ServerException {
verifyDir(logDir);
LogManager.resetConfiguration();
File log4jFile = new File(configDir, name + "-log4j.properties");
if (log4jFile.exists()) {
PropertyConfigurator.configureAndWatch(log4jFile.toString(), 10 * 1000); //every 10 secs
log = LoggerFactory.getLogger(Server.class);View on GitHub (pinned to 2add963021)
Solutions
- Create the directory named in the message with correct ownership: mkdir -p <dir> && chown httpfs:hadoop <dir>.
- Fix the corresponding property (httpfs.home.dir / httpfs.config.dir / httpfs.log.dir / httpfs.temp.dir) if it points at the wrong location.
- Ensure the underlying volume/mount is present before start (systemd RequiresMountsFor, container volume mounts).
- If temp state is disposable, prefer a dedicated path outside /tmp to survive reboots/cleaners.
Example fix
# before $ /usr/hadoop/sbin/httpfs.sh run ... ServerException: S01, [/var/log/hadoop-httpfs] does not exist # after $ mkdir -p /var/log/hadoop-httpfs $ chown httpfs:hadoop /var/log/hadoop-httpfs $ /usr/hadoop/sbin/httpfs.sh run
Defensive patterns
Strategy: validation
Validate before calling
# pre-start: create and own every runtime dir
for d in "${HTTPFS_HOME:-/usr/hadoop}" "${HTTPFS_CONFIG:-/etc/hadoop/httpfs/conf}" \
"${HTTPFS_LOG:-/var/log/hadoop-httpfs}" "${HTTPFS_TEMP:-/var/tmp/hadoop-httpfs}"; do
mkdir -p "$d" || exit 1
chown httpfs:hadoop "$d" || exit 1
done Prevention
- Provision dirs in packages/images, not at first run.
- Point temp dirs at persistent paths outside /tmp cleanup zones.
- Mount volumes before start; add systemd RequiresMountsFor= on the dirs.
When it happens
Trigger: httpfs.log.dir points to /var/log/hadoop-httpfs which was never created; temp dir on a wiped /tmp after reboot while config still references it; config dir missing on a new node cloned incompletely; NFS/VM volume holding the dirs not mounted.
Common situations: First start on a freshly installed node where only the RPM/tarball was unpacked; /tmp cleaners removing the temp dir between runs; HA deployments where the standby node lacks the directories; containers with missing hostPath/volume mounts.
Related errors
- [{0}] must be an absolute path [{1}]
- S02
- S06
- numLevels must be at least 1
- callqueue.capacity.weights must specify ${priorityLevels} ca
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/1dc8082791aff1f6.
Report an issue: GitHub.