A painful issue with corrupted ActiveStorageAttachment's #3986
Replies: 4 comments 1 reply
-
@ok32 can you post some more info on where/how it fails? That would be very helpful in trying to understand where is the problem 🙏 This might be related: rails/rails#31985 |
Beta Was this translation helpful? Give feedback.
-
I think I was able to reproduce this by uploading a |
Beta Was this translation helpful? Give feedback.
-
I've created #4017. This is a bug and we should fix it before releasing Solidus 3.0, which has Active Storage set as the default adapter. |
Beta Was this translation helpful? Give feedback.
-
Hey, this is solved thanks to @cpfergus1 with #4021 and #4026. 🎉 |
Beta Was this translation helpful? Give feedback.
-
Hey guys!
I have an issue using
ActiveStorageAttachment
for product images.I'm using an S3-compatible service for storing attachments, and it's working ok. But if the service returns an error (it is down at the moment the user attempts to upload an image or there's a permission error, etc), a product image record and ActiveStorage blob record are created anyway despite the image processing error. So it produces a corrupted state of the system. And then any code which calls
.url(style)
on this image gets anActiveStorage::FileNotFoundError
exception, because it tries to run image processing to create the requested image variant, but it can't find the original image because its upload never finished (it happens on any page which needs to display the image).Ideally, I would like it to be "all or nothing", so the database records get committed only after the storage service responded with a success.
Is it a problem of how ActiveStorage works itself or is it a Solidus wrapper's one? How do I prevent the situation when one failed image upload breaks down the whole store (you can't even delete the corrupted image, because the admin product page is also broken)?
Beta Was this translation helpful? Give feedback.
All reactions