diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java index df7bd77335..e6eab8a4fa 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java @@ -1826,16 +1826,20 @@ private boolean innerDelete(S3AFileStatus status, boolean recursive) */ private boolean rejectRootDirectoryDelete(S3AFileStatus status, boolean recursive) throws IOException { - LOG.info("s3a delete the {} root directory of {}", bucket, recursive); + LOG.info("s3a delete the {} root directory. Path: {}. Recursive: {}", + bucket, status.getPath(), recursive); boolean emptyRoot = status.isEmptyDirectory() == Tristate.TRUE; if (emptyRoot) { return true; } if (recursive) { + LOG.error("Cannot delete root path: {}", status.getPath()); return false; } else { // reject - throw new PathIOException(bucket, "Cannot delete root path"); + String msg = "Cannot delete root path: " + status.getPath(); + LOG.error(msg); + throw new PathIOException(bucket, msg); } }