Error when doing "bundle exec rake s3:upload_assets" - Could not locate Gemfile or .bundle/ directory

@Eviepayne

Fixed it by doing the following - there were two errors.

First, I fixed the second error by doing the following:

rails c
Upload.find(386).destroy!
exit

This fixed the corrupt post(malformatted text or something)

Then the red errors on the screen were from using the random subdomain(provided by cloudflare) and uploading to that. I had to upload the files to the new domain(which includes my connected domain)

Using:

sudo -E -u discourse bundle exec rake s3:upload_assets

Then:

sudo -E -u discourse bundle exec rake uploads:migrate_to_s3

Then the forum properly loaded and right clicking and opening images in a new tab shows they are hosted on the R2. Then I did a backup.

Finally, I cleaned everything up using:

sudo -E -u discourse bundle exec rake uploads:clean_up

Which freed the respective storage space of the files(note I still have a local backup of both files(OS level) and discourse level before migration.

Now everything works perfectly!

3 Likes