{"record":{"id":"cb5a7941af4786ae","repo":"apache/hadoop","slug":"parent-is-not-a-dir-f","errorCode":null,"errorMessage":"parent is not a dir:${f}","messagePattern":"parent is not a dir:(.+?)","errorType":"exception","errorClass":"ParentNotDirectoryException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DelegateToFileSystem.java","lineNumber":103,"sourceCode":"    checkPath(f);\n    \n    // Default impl assumes that permissions do not matter\n    // calling the regular create is good enough.\n    // FSs that implement permissions should override this.\n\n    if (!createParent) { // parent must exist.\n      // since this.create makes parent dirs automatically\n      // we must throw exception if parent does not exist.\n      Optional<Path> parentPath = f.getOptionalParentPath();\n      if (!parentPath.isPresent()) {\n        throw new FileNotFoundException(\"Missing parent:\" + f);\n      }\n      final FileStatus stat = getFileStatus(parentPath.get());\n      if (stat == null) {\n        throw new FileNotFoundException(\"Missing parent:\" + f);\n      }\n      if (!stat.isDirectory()) {\n          throw new ParentNotDirectoryException(\"parent is not a dir:\" + f);\n      }\n      // parent does exist - go ahead with create of file.\n    }\n    return fsImpl.primitiveCreate(f, absolutePermission, flag,\n        bufferSize, replication, blockSize, progress, checksumOpt);\n  }\n\n  @Override\n  public boolean delete(Path f, boolean recursive) throws IOException {\n    checkPath(f);\n    return fsImpl.delete(f, recursive);\n  }\n\n  @Override\n  public BlockLocation[] getFileBlockLocations(Path f, long start, long len)\n      throws IOException {\n    checkPath(f);\n    return fsImpl.getFileBlockLocations(f, start, len);","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DelegateToFileSystem.java#L85-L121","documentation":"Error \"parent is not a dir:${f}\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DelegateToFileSystem.java:103 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the parent path exists as a directory, not a regular file.","Remove or relocate the conflicting file at the parent path, or choose a different target 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-22T20:17:22.307Z"}