{"record":{"id":"7290b6b376e2ad10","repo":"apache/hadoop","slug":"parent-directory-doesn-t-exist-parentpath","errorCode":null,"errorMessage":"Parent directory doesn't exist: <parentPath>","messagePattern":"Parent directory doesn't exist: <parentPath>","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java","lineNumber":2046,"sourceCode":"        blocksize,\n        inode.getModificationTime(snapshot),\n        inode.getAccessTime(snapshot),\n        inode.getFsPermission(snapshot),\n        inode.getUserName(snapshot),\n        inode.getGroupName(snapshot),\n        symlink,\n        new Path(iip.getPath()));\n  }\n\n  /**\n   * Verify that parent directory of src exists.\n   */\n  void verifyParentDir(INodesInPath iip)\n      throws FileNotFoundException, ParentNotDirectoryException {\n    if (iip.length() > 2) {\n      final INode parentNode = iip.getINode(-2);\n      if (parentNode == null) {\n        throw new FileNotFoundException(\"Parent directory doesn't exist: \"\n            + iip.getParentPath());\n      } else if (!parentNode.isDirectory()) {\n        throw new ParentNotDirectoryException(\"Parent path is not a directory: \"\n            + iip.getParentPath());\n      }\n    }\n  }\n\n  /** Allocate a new inode ID. */\n  long allocateNewInodeId() {\n    return inodeId.nextValue();\n  }\n\n  /** @return the last inode ID. */\n  public long getLastInodeId() {\n    return inodeId.getCurrentValue();\n  }\n","sourceCodeStart":2028,"sourceCodeEnd":2064,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2028-L2064","documentation":"Error \"Parent directory doesn't exist: <parentPath>\" thrown in apache/hadoop.","triggerScenarios":"Creating a file or directory whose parent path does not exist.","commonSituations":"See trigger scenarios.","solutions":["Create the parent directory first with 'hdfs dfs -mkdir -p'."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}