AWS S3 → ローカル → DO Spaces への移行が原因で、同様の問題に遭遇しました。最終的に、Ruby で古い壊れたアップロード URL を、機能する新しい URL フォーマットに手動で置換するコードを書き、問題が解決したようです。
私の場合、最初の移行ではすべてのファイルが DO Spaces に正常に移動しましたが、migrate_to_s3 はそれらを失敗として記録していました。最初は添付ファイルに問題はありませんでしたが、rebuild(rebake)を実行すると添付ファイルが壊れてしまいました。詳細はリンク先のトピックをご覧ください。
FileStore::ToS3MigrationError: 182 of 21512 uploads are not migrated to S3. S3 migration failed for db ‘default’.
then some stack trace from ‘raise_or_log’, ‘migration_successful?’, ‘migrate_to_s3’, ‘migrate’, ‘block in migrate_to_s3_all_sites’
I ran into these errors twice when running the task uploads:migrate_to_s3 . About 1% of the files were not successfully migrated, leading to broken attachments on the site after a rebake. These all seem to be older files around the initial few month…