Issue with Deleting Variants in Rails 7.1 using R2 and AWS S3: Aws::S3::Errors::NoSuchKey

Hello,

I’m encountering an issue with AWS S3 and R2 in several of our Rails 7.1 applications. While the overall functionality works well for our users, we consistently face the Aws::S3::Errors::NoSuchKey error when attempting to delete variants. This seems to be a recurring issue, as indicated in a reported issue on the Rails GitHub repository (link below).

Error Encountered: Aws::S3::Errors::NoSuchKey

The error arises specifically when Rails tries to delete variants. I’ve been monitoring the discussion on the following Rails issue for a resolution: Rails Issue #50583.

However, since it’s yet to be resolved, I’m reaching out to see if anyone has encountered a similar issue and found a workaround or a temporary fix.

Any insights or suggestions would be greatly appreciated.

Thank you for your assistance.