Get : 301 response missing Location header
Hello.
I am using this code to download file from S3 bucket
// key, secret and bucketNames are valid vars auth, err := aws.GetAuth(key, secret) if err != nil { panic(err.Error()) } conn := s3.New(auth, aws.USEast) bucket := conn.Bucket(bucketName) data, err := bucket.Get("aws-programmatic-access-test-object") if err != nil { return err }
The .Get() function return error : "Get : 301 response missing Location header" I can't find what the reason or any solution. Does anybody knows what the problem is?
Thank you in advance.
Found the problem. needed to connect to USWest2 instead of USEast Is there a way to find the region of the Bucket without asking the user? Is there an implementation for this API call in goamz? http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html
+1
https://github.com/lmars/packer-post-processor-vagrant-s3/issues/3 has the same issue.
+1
+1
I found it confusing to get the 301 response missing Location header error even though the location should have been set, but maybe that's an Amazon bug?
It would definitely be nice to be able to get the location via the API linked above. I'm sure there are cases where you wouldn't need that, but for those of us doing cross-regional work it'd make a big difference.
Thanks for your work on this.