AWS S3 Issues with Uppy

Hi,

I seem to be running into permission issues when trying to get Uppy to connect to my S3 Bukkit.
It’s the first time I’ve used S3 & Uppy, and seem to be stuck in a bit of a rut.

I’ve got a companion server up and running, which seems to be acknowledging my requests, but i keep getting a 403 error when trying to connect to AWS.

I’ve setup the buckets as per the tutorial from what i can see.

My CORS configuration is:
image

I’ve tried various configurations for the AllowedOrigin. Do I use the companion server address, or the domain of the site? I did originally have it as sliceofapi.co.uk but also had the same issue.

The block public access of the bucket is set to off on all options.

When uploading an image, my companion server outputs the below:

::ffff:81.96.121.249 - - [09/Jun/2019:14:24:24 +0000] "OPTIONS /s3/params?filename=Front.png&type=image%2Fpng HTTP/1.1" 200 8 "http://www.sliceofapi.co.uk/pod/book/upload.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
::ffff:81.96.121.249 - - [09/Jun/2019:14:24:24 +0000] "GET /s3/params?filename=Front.png&type=image%2Fpng HTTP/1.1" 200 916 "http://www.sliceofapi.co.uk/pod/book/upload.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"

But I get the below response from AWS:

<Error><Code>AccessForbidden</Code><Message>CORSResponse: This CORS request is not allowed. This is usually because the evalution of Origin, request method / Access-Control-Request-Method or Access-Control-Request-Headers are not whitelisted by the resource's CORS spec.</Message><Method>POST</Method><ResourceType>BUCKET</ResourceType><RequestId>*****************</RequestId><HostId>***********************</HostId></Error>

I can only imagine its the way in which i’ve setup the bucket, but after hours of comparison I just can’t see where!

Can you see anything wrong?

Many Thanks

Alex

Is it definitely going to that bucket?

did you try allowing all origins and all headers to see if uppy can reach the bucket? something like this:

<CORSRule>
    <AllowedOrigin>*</AllowedOrigin>
    <AllowedMethod>GET</AllowedMethod>
    <AllowedMethod>PUT</AllowedMethod>
    <AllowedMethod>POST</AllowedMethod>
    <MaxAgeSeconds>3000</MaxAgeSeconds>
    <ExposeHeader>ETag</ExposeHeader>
    <AllowedHeader>*</AllowedHeader>
</CORSRule>