Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-24000

S3A: Create Table should fail on invalid AK/SK

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Done
    • 2.3.0
    • None
    • Spark Shell
    • 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

          Activity

            People

              Unassigned Unassigned
              brahmareddy Brahma Reddy Battula
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: