This repository has been archived by the owner. It is now read-only.

Get : 301 response missing Location header #51

Open
ET-CS opened this Issue Jun 5, 2014 · 5 comments

Comments

Projects
None yet
5 participants
@ET-CS
Copy link

ET-CS commented Jun 5, 2014

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

This comment has been minimized.

Copy link

ET-CS commented Jun 5, 2014

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

@lafolle

This comment has been minimized.

Copy link

lafolle commented Jun 24, 2014

+1

@arosenhagen

This comment has been minimized.

Copy link
Contributor

arosenhagen commented Oct 13, 2014

@kamoljan

This comment has been minimized.

Copy link

kamoljan commented Sep 3, 2015

+1

@biztos

This comment has been minimized.

Copy link

biztos commented Jun 2, 2016

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.