Migrate_to_s3 fails

Looking at the error message from your previous post, it’s the count on line 85 which is of interest. @Falco’s suggestion for editing the script is to increase that count to ignore some number of failures.

The simplest way to achieve that is by entering the container and using sed to make an in-place substitution on that specific line.

cd /var/discourse
./launcher enter app
sed -i '85s/0/100/' lib/file_store/to_s3_migration.rb

Run the rake task again after that and it will ignore up to 100 “post not remapped to new S3 upload URL” errors. The change will disappear the next time you rebuild.

For the error message in the original post, line 77 is the one of interest as @Falco referenced. Just replace the line number in the sed command:

sed -i '77s/0/100/' lib/file_store/to_s3_migration.rb
7 Likes