Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Done
-
2.3.0
-
None
-
None
Description
Currently, When we pass the invalid ak&&sk create table will be the success.
when the S3AFileSystem is initialized, verifyBucketExists() is called, which will return True as the status code 403 (BUCKET_ACCESS_FORBIDDEN_STATUS_CODE) from following as bucket exists.
public boolean doesBucketExist(String bucketName) throws AmazonClientException, AmazonServiceException { try { headBucket(new HeadBucketRequest(bucketName)); return true; } catch (AmazonServiceException ase) { // A redirect error or a forbidden error means the bucket exists. So // returning true. if ((ase.getStatusCode() == Constants.BUCKET_REDIRECT_STATUS_CODE) || (ase.getStatusCode() == Constants.BUCKET_ACCESS_FORBIDDEN_STATUS_CODE)) { return true; } if (ase.getStatusCode() == Constants.NO_SUCH_BUCKET_STATUS_CODE) { return false; } throw ase; } }
Attachments
Issue Links
- depends upon
-
HADOOP-16711 S3A bucket existence checks to support v2 API and "no checks at all"
-
- Resolved
-
- is related to
-
HADOOP-15990 S3AFileSystem.verifyBucketExists to move to s3.doesBucketExistV2
-
- Resolved
-
-
HADOOP-15409 S3AFileSystem.verifyBucketExists to move to s3.doesBucketExistV2
-
- Resolved
-