Uploads migration to S3 fails

Can you pls elaborate what you did here (you showed double inverted commas here).
And what’s the relevance of this edit? I mean, how did you know that this was the culprit or how did it solve this?

I’m facing with this error while migrating my images/assets from local to S3: “S3 migration failed for db ‘default’” (my branding logos don’t show anywhere).

1 Like
> FileStore::ToS3MigrationError: Some uploads could not be migrated to the new scheme. You need to fix this manually.
> /var/www/discourse/lib/file_store/to_s3_migration.rb:151:in `migrate_to_s3'
> /var/www/discourse/lib/file_store/to_s3_migration.rb:61:in `migrate'
> /var/www/discourse/lib/tasks/uploads.rake:239:in `migrate_to_s3'
> /var/www/discourse/lib/tasks/uploads.rake:218:in `block in migrate_to_s3_all_sites'
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rails_multisite-2.1.1/lib/rails_multisite/connection_management.rb:64:in `with_connection'
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rails_multisite-2.1.1/lib/rails_multisite/connection_management.rb:74:in `each_connection'
> /var/www/discourse/lib/tasks/uploads.rake:216:in `migrate_to_s3_all_sites'
> /var/www/discourse/lib/tasks/uploads.rake:212:in `block in <top (required)>'

image
Generally, I have these files. All the files are (I guess) except the original folder - there is no pictures
Why? Maybe it is better to just copy it by hand ctr +C and that’s it … ?

assets folder:

1 Like

I tried to change it, but it’s no longer at lib/tasks/uploads.rake . So what could be wrong ?

1 Like

Pls tell exactly where to put this line, and whether the double quotes after equal to sign are to be put in as they are (blank), or are we supposed to insert our own S3 CDN Url in side those quotes? Pls guide.

1 Like

The export instruction was issued on the command line
export DISCOURSE_S3_CDN_URL=""

So that linux knows it as a system variable. I had to set that variable with the empty quotes even if I don’t use a CDN.

2 Likes

The above said lines no longer exist in the file lib/tasks/upload.rake
I searched the whole (above-said) file very carefully.

Thanks for the reply, but which command line are you talking? Is this command to be given inside the web_only container?

1 Like

They might have updated since then, it was two years ago.

I meant your Linux server. I “entered” in the container (sudo ./launcher enter app), and exported the environment variables so that the system know their values. Hope this helps.

3 Likes