Open vnosov93 opened 4 years ago
@vnosov93 , will you be able to post your solution here?
I had the same issue many times on stage and live instances on two projects after media upload using the AWS CLI tool (about 10GB of media in my case) with --acl public-read
.
After the upload, I've found many 403 issues for images in random places. Eventually, I found that ACL sometimes not set after upload (it can be checked using aws s3api get-object-acl
command), so it could be an AWS CLI issue or something else.
I've solved it by manually accessing (calling almost any method of Image object) all the images via custom management command to find the list of "access denied" images and then manually set ACL for them using the command mentioned above: aws s3api put-object-acl --bucket bucket_name --key file_path --acl public-read
.
Probably we could develop a script that loops over all images to check for 403 error and call the aws s3api
command to fix AWS CLI. I'll try to implement it next time when I meet this issue.
cc @macolo @victor-yunenko
@vnosov93 is it possible that this is a duplicate of #36 ? If yes, can you mark this as duplicate and close this ticket? If no, can you change the issue title to clearly distinguish this from #36?