apache/hadoop · error · FileNotFoundException
Missing parent:${f}
Error message
Missing parent:${f} What it means
Error "Missing parent:${f}" thrown in apache/hadoop.
Source
Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DelegateToFileSystem.java:96
@Override
@SuppressWarnings("deprecation") // call to primitiveCreate
public FSDataOutputStream createInternal (Path f,
EnumSet<CreateFlag> flag, FsPermission absolutePermission, int bufferSize,
short replication, long blockSize, Progressable progress,
ChecksumOpt checksumOpt, boolean createParent) throws IOException {
checkPath(f);
// Default impl assumes that permissions do not matter
// calling the regular create is good enough.
// FSs that implement permissions should override this.
if (!createParent) { // parent must exist.
// since this.create makes parent dirs automatically
// we must throw exception if parent does not exist.
Optional<Path> parentPath = f.getOptionalParentPath();
if (!parentPath.isPresent()) {
throw new FileNotFoundException("Missing parent:" + f);
}
final FileStatus stat = getFileStatus(parentPath.get());
if (stat == null) {
throw new FileNotFoundException("Missing parent:" + f);
}
if (!stat.isDirectory()) {
throw new ParentNotDirectoryException("parent is not a dir:" + f);
}
// parent does exist - go ahead with create of file.
}
return fsImpl.primitiveCreate(f, absolutePermission, flag,
bufferSize, replication, blockSize, progress, checksumOpt);
}
@Override
public boolean delete(Path f, boolean recursive) throws IOException {
checkPath(f);
return fsImpl.delete(f, recursive);View on GitHub (pinned to 2add963021)
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.
When it happens
Trigger: Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DelegateToFileSystem.java:96 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/6c5de4b9f3e5bc1f.
Report an issue: GitHub.