I’m trying to move uploads to s3 on a relatively busy site.
Everything goes as planned except when I run
rake uploads:migrate_to_s3, I am presented with the following error:
Updating the URLs in the database... Removing old optimized images... Flagging all posts containing lightboxes for rebake... 2023 posts were flagged for a rebake rake aborted! FileStore::ToS3MigrationError: 1 of 9629 uploads are not migrated to S3. S3 migration failed for db 'default'. /var/www/discourse/lib/file_store/to_s3_migration.rb:132:in `raise_or_log' /var/www/discourse/lib/file_store/to_s3_migration.rb:79:in `migration_successful?' /var/www/discourse/lib/file_store/to_s3_migration.rb:373:in `migrate_to_s3' /var/www/discourse/lib/file_store/to_s3_migration.rb:66:in `migrate' /var/www/discourse/lib/tasks/uploads.rake:123:in `migrate_to_s3' /var/www/discourse/lib/tasks/uploads.rake:102:in `block in migrate_to_s3_all_sites' /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rails_multisite-4.0.0/lib/rails_multisite/connection_management.rb:80:in `with_connection' /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rails_multisite-4.0.0/lib/rails_multisite/connection_management.rb:90:in `each_connection' /var/www/discourse/lib/tasks/uploads.rake:100:in `migrate_to_s3_all_sites' /var/www/discourse/lib/tasks/uploads.rake:96:in `block in <main>' /usr/local/bin/bundle:23:in `load' /usr/local/bin/bundle:23:in `<main>' Tasks: TOP => uploads:migrate_to_s3 (See full trace by running task with --trace)
This line in particular caught my attention
FileStore::ToS3MigrationError: 1 of 9629 uploads are not migrated to S3. S3 migration failed for db 'default'.
I’m assuming it means there is one problematic file that is causing the entire take task to fail? is there a way to figure out which file is causing the problem and maybe just remove it so the rest of the task completes peacefully?