cain icon indicating copy to clipboard operation
cain copied to clipboard

Recieve "BucketRegionError: incorrect region"... error when trying to backup to S3

Open maze88 opened this issue 4 years ago • 1 comments

Background conditions:

~$ aws configure list | grep region
region           ap-southeast-2      config-file    ~/.aws/config
~$ aws s3 mb s3://cassandra-snapshot-test
make_bucket: cassandra-snapshot-test-mz
$ aws s3api get-bucket-location --bucket cassandra-snapshot-test
{
    "LocationConstraint": "ap-southeast-2"
}
$ kubectl describe statefulsets.apps cassandra | egrep 'Namespace|Labels'
Namespace:          default
Labels:             app=cassandra
  Labels:  app=cassandra
  Labels:        <none>

In addition, I have a Keyspace on Cassandra named 'mykeyspace'.

Command and error:

$ ./cain backup -n default -l app=cassandra -k mykeyspace --dst s3://cassandra-snapshot-test
2020/05/19 12:47:24 Backup started!
2020/05/19 12:47:24 Getting clients
2020/05/19 12:47:29 BucketRegionError: incorrect region, the bucket is not in 'eu-central-1' region
    status code: 301, request id: , host id:

I don't understand where this 'eu-central-1' comes from, as I do not have anything in that region in my AWS config file or cloud.

Let me know about any additional info required...!

maze88 avatar May 19 '20 11:05 maze88

cain uses skbn to do the actual copy. Take a look at https://github.com/nuvo/skbn/blob/master/README.md#aws

maorfr avatar May 20 '20 17:05 maorfr