I’m not sure if this can be called a bug, but it is an unexpected behavior:
Steps to reproduce:
- Add a new file extension like
tif
toauthorized_extensions
- Attach a file with that extension to a post
- Remove the file extension from
authorized_extensions
- Rebake all posts using
rake posts:rebake
Expected behavior:
Rebaking of all posts should work, even though the previously attached file extension isn’t allowed anymore.
Actual behavior:
Rebaking of posts fails for all posts that have attachments which aren’t allowed anymore. They are stuck in the sidekiq retry queue. The error message is:
Job exception: Wrapped ActiveRecord::RecordInvalid: Validation failed: Original filename Sorry, the file you are trying to upload is not authorized (authorized extensions: jpg, jpeg, png, gif).
Additional information:
This error happens only with images. It doesn’t seem to happen with other file types.
Lowering max_image_size_kb
also results in errors:
Job exception: Wrapped ActiveRecord::RecordInvalid: Validation failed: Filesize Sorry, the image you are trying to upload is too big (maximum size is 3072KB), please resize it and try again.