Closed jstockwin closed 6 years ago
I'm seeing this same error and I have no idea where to look after random debugging :\
I get the same error when I run KeystoneJS from docker container. If I run KeystoneJS with the same File.js configuration from a local machine (not docker), it works and a file is uploaded to S3.
@JedWatson Should I have installed aws-cli
on machine? Because I have it on local, but not in container.
I've installed and configure aws
on Docker container and Field errors
still persist.
I had the 'Field Errors' problem and it was because I had not added the Amazon S3 Permission to my IAM User's Group
My understanding of this issue was to do with certain AWS regions now requiring checksum signing before upload. The library that this uses to upload does not support the new AWS skd requirements and some quick research looks like the project has been abandoned. EU-West-2 (London) and AP-southeast-2 (Sydney) both have the new requirements.
As an aside @stevenkaspar I’d suggest using a more specific permission set on AWS rather than full access. You can build policies to limit it to a single bucket.
@mrprkr Thanks for the heads up - relatively new to AWS. Went ahead and created a new policy
So should it be updated to use aws-sdk/clients/s3
? I am planning to use this a lot so I can update it if it should be
I haven’t looked at this in almost a year, from memory there wasn’t good node support from AWS when they changed the requirements. I think this should be a pretty straight forward pull request, I’m on my iPad and can’t easily look at the code but there’s a library in here that handles the upload. This library has been abandoned and doesn’t support the new AWS-SDK. Updating the upload part of this module should flex the field errors issue.
FYI the library in question is Knox
@stevenkaspar what did you end up doing?
@bflopez I ended up forking the repo and created a PR but it hasn't been accepted
https://github.com/keystonejs/keystone-storage-adapter-s3/pull/29 https://github.com/stevenkaspar/keystone-storage-adapter-s3
@stevenkaspar Saw that shortly after commenting. Swapped in your code and it works like a charm. Thank you.
@stevenkaspar Alright mate, your solution just works !! <3 <3 <3
This issue has been resolved in v2.0.0. See #35
I'm currently failing to make S3 work at all...
I'll paste my entire model below.
Firstly, I can't always create a new item, which only requires
name
to be entered in the initial form. All I get then is "Unknown Error". It seems to occur when creating the first item. A page refresh fixes this.After this, when trying to upload a file, I almost always get a flash message saying "Field errors", and nothing more. There is nothing logged anywhere, and my pre-save hook doesn't seem to be reached.
I'm not really sure how to get at more detailed errors either... help!