goamz icon indicating copy to clipboard operation
goamz copied to clipboard

Get : 301 response missing Location header

Open ET-CS opened this issue 11 years ago • 5 comments

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.

ET-CS avatar Jun 05 '14 15:06 ET-CS

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

ET-CS avatar Jun 05 '14 15:06 ET-CS

+1

lafolle avatar Jun 24 '14 20:06 lafolle

https://github.com/lmars/packer-post-processor-vagrant-s3/issues/3 has the same issue.

arosenhagen avatar Oct 13 '14 17:10 arosenhagen

+1

kamoljan avatar Sep 03 '15 05:09 kamoljan

+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.

biztos avatar Jun 02 '16 08:06 biztos