{"record":{"id":"bec4564719c1e527","repo":"apache/hadoop","slug":"0-must-be-an-absolute-path-1","errorCode":null,"errorMessage":"[{0}] must be an absolute path [{1}]","messagePattern":"\\[(.+?)\\] must be an absolute path \\[(.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/server/Server.java","lineNumber":237,"sourceCode":"    }\n    status = Status.UNDEF;\n  }\n\n  /**\n   * Validates that the specified value is an absolute path (starts with '/').\n   *\n   * @param value value to verify it is an absolute path.\n   * @param name name to use in the exception if the value is not an absolute\n   * path.\n   *\n   * @return the value.\n   *\n   * @throws IllegalArgumentException thrown if the value is not an absolute\n   * path.\n   */\n  private String checkAbsolutePath(String value, String name) {\n    if (!new File(value).isAbsolute()) {\n      throw new IllegalArgumentException(\n        MessageFormat.format(\"[{0}] must be an absolute path [{1}]\", name, value));\n    }\n    return value;\n  }\n\n  /**\n   * Returns the current server status.\n   *\n   * @return the current server status.\n   */\n  public Status getStatus() {\n    return status;\n  }\n\n  /**\n   * Sets a new server status.\n   * <p>\n   * The status must be settable.","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/server/Server.java#L219-L255","documentation":"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.","triggerScenarios":"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.","commonSituations":"Custom systemd/docker wrappers around httpfs.sh; k8s deployments templating relative mount paths; defaults overridden for convenience in dev then reused in prod packaging.","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."],"exampleFix":"# before (httpfs-env.sh)\nexport HTTPFS_LOG_DIR=logs\n\n# after\nexport HTTPFS_LOG_DIR=/var/log/hadoop-httpfs","handlingStrategy":"validation","validationCode":"# pre-start: all four dirs must be absolute\nfor v in HTTPFS_HOME HTTPFS_CONFIG HTTPFS_LOG HTTPFS_TEMP \\\n         httpfs.home.dir httpfs.config.dir httpfs.log.dir httpfs.temp.dir; do\n  val=\"${!v}\"; [ -z \"$val\" ] && continue\n  case \"$val\" in /*) ;; *) echo \"FATAL: $v='$val' is not absolute\"; exit 1;; esac\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["httpfs","server-startup","path-validation","configuration","illegal-argument"],"backgroundTag":"config-path-validation","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}