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 months when I first created this Discourse instance.
In digging into the S3 bucket, the files do seem to have been successfully uploaded to S3, they are just not linked correctly after rebaking.
Rerunning the migration (prior to another rebake) seems to have fixed the issue for some reason. The same error still occurs during the migrate_to_s3 task.
However, if I run rebake again, it re-breaks the attachment links.
I don’t think these are errors, but I’ll include the output during the rebake
/var/www/discourse/lib/file_store/base_store.rb:6: warning: already initialized constant FileStore::BaseStore::UPLOAD_PATH_REGEX
/var/www/discourse/lib/file_store/base_store.rb:6: warning: previously definition of UPLOAD_PATH_REGEX was here
/var/www/discourse/lib/file_store/base_store.rb:7: warning: already initialized constant FileStore::BaseStore::OPTIMIZED_IMAGE_PATH_REGEX
/var/www/discourse/lib/file_store/base_store.rb:7: warning: previous definition of OPTIMIZED_IMAGE_PATH_REGEX was here
Running rake posts:missing_uploads
or PostCustomField.where(name: Post::MISSING_UPLOADS)
does not surface any issues, so this seems unrelated.