{"record":{"id":"1dc8082791aff1f6","repo":"apache/hadoop","slug":"s01","errorCode":"S01","errorMessage":"Dir [{0}] does not exist","messagePattern":"Dir \\[(.+?)\\] does not exist","errorType":"error_code","errorClass":"ServerException","httpStatus":null,"severity":"critical","filePath":"hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/server/Server.java","lineNumber":400,"sourceCode":"      throw ex;\n    }\n    Status status = Status.valueOf(getConfig().get(getPrefixedName(CONF_STARTUP_STATUS), Status.NORMAL.toString()));\n    setStatus(status);\n    log.info(\"Server [{}] started!, status [{}]\", name, status);\n  }\n\n  /**\n   * Verifies the specified directory exists.\n   *\n   * @param dir directory to verify it exists.\n   *\n   * @throws ServerException thrown if the directory does not exist or it the\n   * path it is not a directory.\n   */\n  private void verifyDir(String dir) throws ServerException {\n    File file = new File(dir);\n    if (!file.exists()) {\n      throw new ServerException(ServerException.ERROR.S01, dir);\n    }\n    if (!file.isDirectory()) {\n      throw new ServerException(ServerException.ERROR.S02, dir);\n    }\n  }\n\n  /**\n   * Initializes Log4j logging.\n   *\n   * @throws ServerException thrown if Log4j could not be initialized.\n   */\n  protected void initLog() throws ServerException {\n    verifyDir(logDir);\n    LogManager.resetConfiguration();\n    File log4jFile = new File(configDir, name + \"-log4j.properties\");\n    if (log4jFile.exists()) {\n      PropertyConfigurator.configureAndWatch(log4jFile.toString(), 10 * 1000); //every 10 secs\n      log = LoggerFactory.getLogger(Server.class);","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/server/Server.java#L382-L418","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before\n$ /usr/hadoop/sbin/httpfs.sh run\n... ServerException: S01, [/var/log/hadoop-httpfs] does not exist\n\n# after\n$ mkdir -p /var/log/hadoop-httpfs\n$ chown httpfs:hadoop /var/log/hadoop-httpfs\n$ /usr/hadoop/sbin/httpfs.sh run","handlingStrategy":"validation","validationCode":"# pre-start: create and own every runtime dir\nfor d in \"${HTTPFS_HOME:-/usr/hadoop}\" \"${HTTPFS_CONFIG:-/etc/hadoop/httpfs/conf}\" \\\n         \"${HTTPFS_LOG:-/var/log/hadoop-httpfs}\" \"${HTTPFS_TEMP:-/var/tmp/hadoop-httpfs}\"; do\n  mkdir -p \"$d\" || exit 1\n  chown httpfs:hadoop \"$d\" || exit 1\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["httpfs","server-startup","missing-directory","configuration"],"backgroundTag":"missing-directory","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}