Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Knox in KeystoneJS throws error code 307 for amazon S3 #3054

Closed
justinwen opened this issue Jun 19, 2016 · 2 comments
Closed

Knox in KeystoneJS throws error code 307 for amazon S3 #3054

justinwen opened this issue Jun 19, 2016 · 2 comments

Comments

@justinwen
Copy link

justinwen commented Jun 19, 2016

As dig around on KNOX Github , It is existing bug on KNOX . KNOW didn't handle the 307 redirect in their code. I haven't spent any time to read the bug report pages.
For those who interested:
Automattic/knox#66

Expected behavior

Keystone can upload files to any S3 region server.

Actual behavior

Keystone admin UI throws an error with [Error: Amazon returned Http Code: 307].

Steps to reproduce the behavior

  1. It only supports S3 bucket setup to US standard region. Recreate the bucket and point to US standard region. Problem solved.
  2. Bucket name shouldn't contain "DOT", otherwise, admin UI will throw 301 error code.
@jstockwin
Copy link
Contributor

@justinwen You can actually set the region config option for S3, which allows you to point at other locations, for example Ireland; either set S3_REGION=eu-west-1 in your .env file, or add the following to keystone.js.

keystone.set('s3 config', { 
    bucket: 'my-bucket', 
    key: 'my-key', 
    secret: 'my-secret',
    region: 'eu-west-1'
});

You can see a list of region names here: http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region

However, you'll get an error when trying to use a region which only supports Signature Version 4, at least until this knox issue is fixed: Automattic/knox#254

@mxstbr
Copy link
Collaborator

mxstbr commented Jun 20, 2016

I'll close this, since it doesn't seems like this is something we can act upon/fix. Thanks for reporting this issue @justinwen!

@mxstbr mxstbr closed this as completed Jun 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants