{"record":{"id":"6c5de4b9f3e5bc1f","repo":"apache/hadoop","slug":"missing-parent-f","errorCode":null,"errorMessage":"Missing parent:${f}","messagePattern":"Missing parent:(.+?)","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DelegateToFileSystem.java","lineNumber":96,"sourceCode":"  \n  @Override\n  @SuppressWarnings(\"deprecation\") // call to primitiveCreate\n  public FSDataOutputStream createInternal (Path f,\n      EnumSet<CreateFlag> flag, FsPermission absolutePermission, int bufferSize,\n      short replication, long blockSize, Progressable progress,\n      ChecksumOpt checksumOpt, boolean createParent) throws IOException {\n    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);","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DelegateToFileSystem.java#L78-L114","documentation":"Error \"Missing parent:${f}\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DelegateToFileSystem.java:96 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create the parent directory before creating the file.","Verify the path is correct; a missing parent usually indicates a typo or a relative path resolved against an unexpected working directory."],"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"}