apache/hadoop · critical · IllegalArgumentException
[{0}] must be an absolute path [{1}]
Error message
[{0}] must be an absolute path [{1}] What it means
During Server (the lib/server base under HttpFS and similar daemons) initialization, checkAbsolutePath() validates that homeDir, configDir, logDir and tempDir are absolute filesystem paths; a relative value throws IllegalArgumentException('[<name>] must be an absolute path [<value>]', name first, offending value second). The daemon aborts immediately at construction.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/server/Server.java:237
}
status = Status.UNDEF;
}
/**
* Validates that the specified value is an absolute path (starts with '/').
*
* @param value value to verify it is an absolute path.
* @param name name to use in the exception if the value is not an absolute
* path.
*
* @return the value.
*
* @throws IllegalArgumentException thrown if the value is not an absolute
* path.
*/
private String checkAbsolutePath(String value, String name) {
if (!new File(value).isAbsolute()) {
throw new IllegalArgumentException(
MessageFormat.format("[{0}] must be an absolute path [{1}]", name, value));
}
return value;
}
/**
* Returns the current server status.
*
* @return the current server status.
*/
public Status getStatus() {
return status;
}
/**
* Sets a new server status.
* <p>
* The status must be settable.View on GitHub (pinned to 2add963021)
Solutions
- Find which of homeDir/configDir/logDir/tempDir is relative from the message ([0] names it) and set the corresponding system property (httpfs.home.dir, httpfs.config.dir, httpfs.log.dir, httpfs.temp.dir) to an absolute path in httpfs-env.sh or the launch command.
- In container wrappers, derive absolute paths at start: e.g. HTTPFS_LOG_DIR=${HTTPFS_BASE}/logs.
- Re-run the start script and confirm the daemon reaches the running state.
Example fix
# before (httpfs-env.sh) export HTTPFS_LOG_DIR=logs # after export HTTPFS_LOG_DIR=/var/log/hadoop-httpfs
Defensive patterns
Strategy: validation
Validate before calling
# pre-start: all four dirs must be absolute
for v in HTTPFS_HOME HTTPFS_CONFIG HTTPFS_LOG HTTPFS_TEMP \
httpfs.home.dir httpfs.config.dir httpfs.log.dir httpfs.temp.dir; do
val="${!v}"; [ -z "$val" ] && continue
case "$val" in /*) ;; *) echo "FATAL: $v='$val' is not absolute"; exit 1;; esac
done Prevention
- Always export HTTPFS_*_DIR env vars as absolute paths derived from a single base (${HTTPFS_BASE}/logs etc.).
- Add a pre-start lint for path properties in httpfs-env.sh.
- Test container entrypoints from different working directories to catch relative-path assumptions.
When it happens
Trigger: Starting httpfs.sh with -Dhttpfs.log.dir=logs or httpfs.temp.dir=tmp (relative); httpfs-env.sh exporting HTTPFS_LOG_DIR as a relative path after customization; a wrapper script that cd's elsewhere and passes relative dirs; container images where the workdir-relative value was not absolutized.
Common situations: Custom systemd/docker wrappers around httpfs.sh; k8s deployments templating relative mount paths; defaults overridden for convenience in dev then reused in prod packaging.
Related errors
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/bec4564719c1e527.
Report an issue: GitHub.