{"record":{"id":"1defe6b568b87dd4","repo":"apache/hadoop","slug":"specified-path-path-does-not-exist","errorCode":null,"errorMessage":"Specified path ${path}does not exist","messagePattern":"Specified path (.+?)does not exist","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DF.java","lineNumber":113,"sourceCode":"  public long getAvailable() {\n    return dirFile.getUsableSpace();\n  }\n\n  /** @return the amount of the volume full, as a percent. */\n  public int getPercentUsed() {\n    double cap = (double) getCapacity();\n    double used = (cap - (double) getAvailable());\n    return (int) (used * 100.0 / cap);\n  }\n\n  /**\n   * @return the filesystem mount point for the indicated volume.\n   * @throws IOException raised on errors performing I/O.\n   */\n  public String getMount() throws IOException {\n    // Abort early if specified path does not exist\n    if (!dirFile.exists()) {\n      throw new FileNotFoundException(\"Specified path \" + dirFile.getPath()\n          + \"does not exist\");\n    }\n\n    if (Shell.WINDOWS) {\n      // Assume a drive letter for a mount point\n      this.mount = dirFile.getCanonicalPath().substring(0, 2);\n    } else {\n      run();\n      verifyExitCode();\n      parseOutput();\n    }\n\n    return mount;\n  }\n  \n  @Override\n  public String toString() {\n    return","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DF.java#L95-L131","documentation":"DF is the wrapper around the unix 'df' command used for storage-volume accounting (capacity, usage, mount point). getMount() first checks that the wrapped java.io.File exists and throws FileNotFoundException naming the configured path when it does not - a fail-fast so daemons report a bad volume directory rather than running 'df' against nothing.","triggerScenarios":"Constructing DF with a path (new DF(dir)) that does not exist on the local filesystem and calling getMount() - typically invoked by DataNode/NodeManager/local-dir management, DU usage trackers, or anything calling DF.getMount()/getDirUsage() on a configured storage directory that was never created or was deleted.","commonSituations":"dfs.datanode.data.dir or yarn.nodemanager.local-dirs / log dirs pointing at a directory absent on a new node; mount point not yet created in deployment scripts; directory removed by a cleanup task after the daemon started; typo in the config path.","solutions":["Create the directory before starting the daemon: mkdir -p <dir> (plus chown to the daemon user).","Fix the configuration value (dfs.datanode.data.dir, yarn.nodemanager.local-dirs, etc.) to point at the intended existing path.","Verify with ls -ld <dir> as the daemon user; if it is a mount point, confirm the mount actually happened (df -h <dir>)."],"exampleFix":"# before\n# hdfs-site.xml: dfs.datanode.data.dir = /grid/1/dn  (directory absent)\n# DataNode start -> DF.getMount(): FileNotFoundException: Specified path /grid/1/dn does not exist\n\n# after\nsudo mkdir -p /grid/1/dn && sudo chown hdfs:hadoop /grid/1/dn\n# then restart the DataNode","handlingStrategy":"validation","validationCode":"java.io.File dir = new java.io.File(configuredDir);\nif (!dir.exists()) {\n  throw new IllegalStateException(\"configured dir missing: \" + configuredDir\n      + \" - create it or fix dfs.datanode.data.dir / yarn.nodemanager.local-dirs\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  String mount = df.getMount();\n} catch (FileNotFoundException e) { // 'Specified path ... does not exist'\n  // create the directory (mkdir -p) with correct ownership and retry\n}","preventionTips":["Provisioning scripts must mkdir -p and chown every configured storage dir before daemon start.","Validate configured dirs in a pre-flight check at daemon startup and report all missing at once.","Re-check after mount changes - a fstab edit without creating the mountpoint will resurface this."],"tags":["hadoop","datanode","storage-dir","disk","path-not-found","configuration"],"backgroundTag":"configured-path-missing","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}