all.
I've got everything working fine: images are being uploaded and can be accessed via Web with paperclip and S3, except when I log into rails c
and type something like this:
> User.first.avatar.exists?
[AWS S3 400 0.093287 0 retries] head_object(:bucket_name=>"mozg-staging-static",:key=>"users/avatars/000/000/001/original/289736.jpg") AWS::S3::Errors::BadRequest AWS::S3::Errors::BadRequest
=> false
The same thing is with the clear
method. Found no solution yet.
I have this permission policy:
{
"Sid": "Stmt1436958517000",
"Effect": "Allow",
"Action": [
"s3:AbortMultipartUpload",
"s3:DeleteObject",
"s3:DeleteObjectVersion",
"s3:GetBucketAcl",
"s3:GetBucketCORS",
"s3:GetObject",
"s3:GetObjectAcl",
"s3:GetObjectVersion",
"s3:GetObjectVersionAcl",
"s3:ListBucket",
"s3:ListBucketMultipartUploads",
"s3:ListBucketVersions",
"s3:ListMultipartUploadParts",
"s3:ListObjects",
"s3:PutObject",
"s3:PutObjectAcl",
"s3:PutObjectVersionAcl",
"s3:RestoreObject"
],
"Resource": [
"arn:aws:s3:::mozg-staging-static",
"arn:aws:s3:::mozg-staging-static/*"
]
}
Thank you for support.
exists?
andclear
work when running a server even though they don't work in the console? (i.e. add that line you ran in the console to a controller somewhere--does it log the same error?) – Tsosie