bradleyg / django-s3direct

Directly upload files to S3 compatible services with Django.
MIT License
661 stars 234 forks source link

403 Access Denied #167

Closed arsensokolov closed 5 years ago

arsensokolov commented 5 years ago

I create IAM user with AmazonS3FullAccess policy, create bucket, write correct CORS, and after upload file see this logs:

Adding django-s3direct handlers…
bundled.js:6060 Checking file and initiating upload…
bundled.js:2020 Starting uploads/media/our-masters4.png reason: first file
bundled.js:2429 
bundled.js:3585 initiate getPayloadSha256Content: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
bundled.js:3661 initiate V4 CanonicalRequest: POST
/regamma/uploads/media/our-masters4.png
uploads=
content-type:image/png
host:s3-eu-west-1.amazonaws.com
x-amz-acl:public-read
x-amz-date:20181212T093244Z

content-type;host;x-amz-acl;x-amz-date
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
bundled.js:3539 V4 stringToSign: AWS4-HMAC-SHA256
20181212T093244Z
20181212/eu-west-1/s3/aws4_request
cc0c31197c781871e487d9bbf0b1d9c0906dd1f60b7117d2cc2d44405a6e0987
bundled.js:3017 initiate signature: 17e3a1481c3e994e27b47b5bbdf5a7d74b3b844db60a91aa5fa741cdb9cfe66b
bundled.js:3585 initiate getPayloadSha256Content: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
s3-eu-west-1.amazonaws.com/regamma/uploads/media/our-masters4.png?uploads:1 POST https://s3-eu-west-1.amazonaws.com/regamma/uploads/media/our-masters4.png?uploads 403 (Forbidden)
bundled.js:2895 initiate error: regamma/uploads/media/our-masters4.png AWS Code: AccessDenied, Message:Access Deniedstatus:403

I don't understand where this error and how to fix this problem?

arsensokolov commented 5 years ago

I check correct IAM user, and was all right working.

bradleyg commented 5 years ago

Closing out, if this is still an issue please reopen.

Thanks