AWS S3: The bucket you are attempting to access must be addressed using the specified endpoint

后端 未结 15 419
南旧
南旧 2020-12-02 10:33

I am trying to delete uploaded image files with the AWS-SDK-Core Ruby Gem.

I have the following code:

require \'aws-sdk-core\'

def pull_picture(pict         


        
相关标签:
15条回答
  • 2020-12-02 11:20

    I had same error. It occurred when s3 client was created with different endpoint than the one which was set up while creating bucket.

    • ERROR CODE - The bucket was set up with EAST Region.

    s3Client = New AmazonS3Client(AWS_ACCESS_KEY, AWS_SECRET_KEY, RegionEndpoint.USWest2)

    • FIX

    s3Client = New AmazonS3Client(AWS_ACCESS_KEY, AWS_SECRET_KEY, RegionEndpoint.USEast1)

    0 讨论(0)
  • 2020-12-02 11:22

    Check your bucket location in the console, then use this as reference to which endpoint to use: http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region

    0 讨论(0)
  • 2020-12-02 11:26

    I Have faced the same issue.After a lot of struggle I found that the real issue is with the com.amazonaws dependencies.After adding dependencies this error got disappeared.

    0 讨论(0)
  • 2020-12-02 11:27

    I was facing a similar error because the bucket was in region us-west-2 and the URL pattern had bucketname in the path. Once, I changed the URL pattern to have bucketname as URL subdomain to grab the files and it worked.

    For eg previous URL was

    https://s3.amazonaws.com/bucketname/filePath/filename
    

    Then I replaced it as

    https://bucketname.s3.amazonaws.com/filePath/filename
    
    0 讨论(0)
  • 2020-12-02 11:27

    I got this error when I tried to access a bucket that didn't exist.

    I mistakenly switched a path variable with the bucket name variable and so the bucket name had the file path value. So maybe double-check, if the bucket name that you set on your request is correct.

    0 讨论(0)
  • 2020-12-02 11:31

    For many S3 API packages (I recently had this problem the npm s3 package) you can run into issues where the region is assumed to be US Standard, and lookup by name will require you to explicitly define the region if you choose to host a bucket outside of that region.

    0 讨论(0)
提交回复
热议问题