apache/hadoop · error · PathIsNotEmptyDirectoryException
path.toString()
Error message
path.toString()
What it means
Error "path.toString()" thrown in apache/hadoop.
Source
Thrown at hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/DeleteOperation.java:222
if (status.isDirectory()) {
LOG.debug("delete: Path is a directory: {}", path);
checkArgument(
status.isEmptyDirectory() != Tristate.UNKNOWN,
"File status must have directory emptiness computed");
if (!key.endsWith("/")) {
key = key + "/";
}
if ("/".equals(key)) {
LOG.error("S3A: Cannot delete the root directory."
+ " Path: {}. Recursive: {}",
status.getPath(), recursive);
return false;
}
if (!recursive && status.isEmptyDirectory() == Tristate.FALSE) {
throw new PathIsNotEmptyDirectoryException(path.toString());
}
if (status.isEmptyDirectory() == Tristate.TRUE) {
LOG.debug("deleting empty directory {}", path);
deleteObjectAtPath(path, key, false);
} else {
deleteDirectoryTree(path, key);
}
} else {
// simple file.
LOG.debug("deleting simple file {}", path);
deleteObjectAtPath(path, key, true);
}
LOG.debug("Deleted {} objects", filesDeleted);
return true;
}
/**View on GitHub (pinned to 2add963021)
Solutions
- This is an internal path-handling error; verify the path being deleted is valid and retry.
When it happens
Trigger: Thrown at hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/DeleteOperation.java:222 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/09c9f318db400a95.
Report an issue: GitHub.