2

There's a similar question with answers here. However, the top answer there does not work for me:

If I use:

gsutil -m rsync -r gs://your-gcs-bucket s3://your-s3-bucket

It fails for me with:

The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'eu-west-2'

Ok, rclone does work but, still, why not with gsutil rync?

I'm in London region by the way.

alanwilter
  • 498
  • 1
  • 3
  • 20
  • 1
    One possible clue might be this article in AWS which describes some reasons and fixes ... does any of this sound applicable to your story? https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/http-400-bad-request.html – Kolban May 25 '20 at 17:19
  • I'm familiar to that and in almost all commands involved in GCP or AWS there is an option for `--region` or `--zone`. In this particular case, which is more complicated, I want to set the region for AWS within a call from a GCP command. I've tried using ENV set up or default setup with GCP and AWS but for no avail so far. I wish I could understand hor `rclone` is sorting this issue. – alanwilter May 25 '20 at 20:28
  • Just a wild guess ... maybe edit ~/.boto I'm sesnsing a couple of possibilities ... either host=s3.eu-west-2.amazonaws.com under an s3 section or https_validate_certificates = false under the Boto section. – Kolban May 25 '20 at 21:29
  • Thanks for your tip @Kolban, indeed, editing `~/.boto` and adding under `[Credentials]` `s3_host = s3.eu-west-2.amazonaws.com` did solve the issue. – alanwilter May 25 '20 at 23:12

1 Answers1

5

Associated with the gsutil command is a configuration file called ~/.boto. Within this file one can add/code:

[Credentials]
s3_host=s3.eu-west-2.amazonaws.com

For details on this file and related information, please see:

config - Obtain credentials and create configuration file

SapphireSun
  • 9,170
  • 11
  • 46
  • 59
Kolban
  • 13,794
  • 3
  • 38
  • 60