Skip to content

Commit eec1937

Browse files
author
Mehakmeet Singh
committed
HADOOP-17817. Throw an exception if S3 client-side encryption is enabled on S3Guard enabled bucket
1 parent f813554 commit eec1937

3 files changed

Lines changed: 29 additions & 0 deletions

File tree

hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,9 @@ public void initialize(URI name, Configuration originalConf)
539539
if (hasMetadataStore()) {
540540
LOG.debug("Using metadata store {}, authoritative store={}, authoritative path={}",
541541
getMetadataStore(), allowAuthoritativeMetadataStore, allowAuthoritativePaths);
542+
if (isCSEEnabled) {
543+
throw new RuntimeException("Disable S3-CSE if S3Guard is enabled.");
544+
}
542545
}
543546

544547
// LOG if S3Guard is disabled on the warn level set in config

hadoop-tools/hadoop-aws/src/site/markdown/tools/hadoop-aws/encryption.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,7 @@ clients where S3-CSE has not been enabled.
601601

602602
### Limitations
603603

604+
- S3Guard is not supported with S3-CSE.
604605
- Performance will be reduced. All encrypt/decrypt is now being done on the
605606
client.
606607
- Writing files may be slower, as only a single block can be encrypted and

hadoop-tools/hadoop-aws/src/site/markdown/tools/hadoop-aws/troubleshooting_s3a.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,6 +1435,31 @@ The user trying to use the KMS Key ID should have the right permissions to acces
14351435
If not, then add permission(or IAM role) in "Key users" section by selecting the
14361436
AWS-KMS CMK Key on AWS console.
14371437

1438+
### Disable S3-CSE if S3Guard is enabled
1439+
1440+
S3-CSE not supported for S3Guard enabled buckets.
1441+
```
1442+
java.lang.RuntimeException: Disable S3-CSE if S3Guard is enabled.
1443+
at org.apache.hadoop.fs.s3a.S3AFileSystem.initialize(S3AFileSystem.java:543)
1444+
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:3460)
1445+
at org.apache.hadoop.fs.FileSystem.access$300(FileSystem.java:172)
1446+
at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:3565)
1447+
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:3512)
1448+
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:539)
1449+
at org.apache.hadoop.fs.Path.getFileSystem(Path.java:366)
1450+
at org.apache.hadoop.fs.shell.PathData.expandAsGlob(PathData.java:342)
1451+
at org.apache.hadoop.fs.shell.Command.expandArgument(Command.java:252)
1452+
at org.apache.hadoop.fs.shell.Command.expandArguments(Command.java:235)
1453+
at org.apache.hadoop.fs.shell.FsCommand.processRawArguments(FsCommand.java:105)
1454+
at org.apache.hadoop.fs.shell.Command.run(Command.java:179)
1455+
at org.apache.hadoop.fs.FsShell.run(FsShell.java:327)
1456+
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:81)
1457+
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:95)
1458+
at org.apache.hadoop.fs.FsShell.main(FsShell.java:390)
1459+
```
1460+
If you want to use S3Guard then disable S3-CSE or disable S3Guard if you want
1461+
to use S3-CSE.
1462+
14381463
### <a name="not_all_bytes_were_read"></a> Message appears in logs "Not all bytes were read from the S3ObjectInputStream"
14391464

14401465

0 commit comments

Comments
 (0)