{"record":{"id":"5a99f49a3b587835","repo":"apache/hadoop","slug":"parent-path-is-not-a-directory-parentpath","errorCode":null,"errorMessage":"Parent path is not a directory: <parentPath>","messagePattern":"Parent path is not a directory: <parentPath>","errorType":"exception","errorClass":"ParentNotDirectoryException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java","lineNumber":2049,"sourceCode":"        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\n  /**\n   * Set the last allocated inode id when fsimage or editlog is loaded.\n   */","sourceCodeStart":2031,"sourceCodeEnd":2067,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2031-L2067","documentation":"Error \"Parent path is not a directory: <parentPath>\" thrown in apache/hadoop.","triggerScenarios":"Creating a file or directory under a parent path that exists but is a file or symlink, not a directory.","commonSituations":"See trigger scenarios.","solutions":["The parent path must be a directory; remove or relocate the conflicting file, or choose another path."],"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-23T01:17:44.959Z"}