Error Message "The bucket you are attempting to access must be addressed using the specified endpoint"
This surfaces when fs.s3a.endpoint
is configured to use S3 service
endpoint which is neither the original AWS one (s3.amazonaws.com
) nor the one
where the bucket is hosted.
org.apache.hadoop.fs.s3a.AWSS3IOException: purging multipart uploads on landsat-pds: com.amazonaws.services.s3.model.AmazonS3Exception: The bucket you are attempting to access must be addressed usingthe specified endpoint. Please send all future requests to this endpoint. (Service: Amazon S3; Status Code: 301; Error Code: PermanentRedirect; Request ID: 5B7A5D18BE596E4B), S3 Extended Request ID: uE4pbbmpxi8Nh7rycS6GfIEi9UH/SWmJfGtM9IeKvRyBPZp/hN7DbPyz272eynz3PEMM2azlhjE=: at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1182) at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:770) at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:489) at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:310) at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:3785) at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:3738) at com.amazonaws.services.s3.AmazonS3Client.listMultipartUploads(AmazonS3Client.java:2796) at com.amazonaws.services.s3.transfer.TransferManager.abortMultipartUploads(TransferManager.java:1217) at org.apache.hadoop.fs.s3a.S3AFileSystem.initMultipartUploads(S3AFileSystem.java:454) at org.apache.hadoop.fs.s3a.S3AFileSystem.initialize(S3AFileSystem.java:289) at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2715) at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:96) at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2749) at org.apache.hadoop.fs.FileSystem$Cache.getUnique(FileSystem.java:2737) at org.apache.hadoop.fs.FileSystem.newInstance(FileSystem.java:430)
To resolve the issue, use the specific endpoint of the bucket's S3 service. Using the explicit endpoint for the region is recommended for speed and the ability to use the V4 signing API.
If not using "V4" authentication, you can use the original S3 endpoint:
<property> <name>fs.s3a.endpoint</name> <value>s3.amazonaws.com</value> </property>