S3 Not Deleting Images

32 views
Skip to first unread message

Code Daemon

unread,
May 20, 2013, 4:27:14 AM5/20/13
to dragonf...@googlegroups.com
I'm storing my images using S3 and they upload just fine but when I destroy my object I get the following warning and the image remains on S3:


1.9.3-p194 :002 > Contest.first.destroy
[WARNING] fog: the specified s3 bucket name(mybucket813_development) is not a valid dns name, which will negatively impact performance.  For details see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/BucketRestrictions.html



Here is my bucket name as defined in dragonfly.rb:

c.bucket_name = "mybucket813_#{Rails.env}"

Code Daemon

unread,
May 22, 2013, 6:17:47 AM5/22/13
to dragonf...@googlegroups.com
I figured out the problem. I posted on the fog's github and someone quickly pointed out that the bucket name should not have an underscore, it should have a hyphen, that cleared up the error.

I found that the reason the S3 file was not getting deleted is because it was an embedded Mongo doc. When I delete the embedded mongo doc manually, it works fine, but when deleting the parent doc, the files stay on disk for the embedded docs.

I'll create an issue for this if it doesn't already exist.
Reply all
Reply to author
Forward
0 new messages