S3 migration error with oneboxed posts

Hi all,

I’m trying to migrate from local upload storage to S3 using the rake uploads:migrate_to_s3 command. It is currently failing during the migration_successful? checks with this error:

1 posts are not remapped to new S3 upload URL. S3 migration failed for db 'default'

https://github.com/discourse/discourse/blob/v2.6.0.beta4/lib/file_store/to_s3_migration.rb#L85

My site doesn’t use a CDN, so that part of the script simply looks for posts where the cooked content contains /uploads/default/original

I edited the script to display the post that was failing, and it turned out to be a post that included a onebox to another discourse forum. The cooked HTML included a link to the other forum’s logo. The other forum doesn’t use a CDN either, so the logo URL includes that string.

The test seems like it needs to be tightened up somehow so that it only picks up local references. Maybe it needs to be split into 2 tests, one for absolute URLs that include the site name, and one for relative references?

Thanks in advance for any suggestions.

1 Like