Uploads in cloudflare R2 are not added to the backup: Failed to download ******* because Aws::S3::Errors::Http501Error

I’m trying a few things on cloudflare and was thinking of leaving R2 in the future. That’s why, when I was examining the backups, I saw that the installations were not included and it gave an error. When making a backup manually, it gives the same error in the transaction logs. Pictures and files in local are backed up, but pictures in Cloudflare R2 are not backed up.

An example error code:

Failed to download original/1X/4b8754c367e54bc5271454a09b8bd4c1a8b882d5.png because Aws::S3::Errors::Http501Error
/var/www/discourse/lib/s3_helper.rb:280:in `rescue in download_file'
/var/www/discourse/lib/s3_helper.rb:277:in `download_file'
/var/www/discourse/lib/file_store/s3_store.rb:338:in `download_file'
/var/www/discourse/lib/backup_restore/backuper.rb:321:in `block in add_remote_uploads_to_archive'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord- `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord- `block in find_each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord- `block in find_in_batches'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord- `block in in_batches'
<internal:kernel>:187:in `loop'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord- `in_batches'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord- `find_in_batches'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord- `find_each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord- `find_each'
/var/www/discourse/lib/backup_restore/backuper.rb:315:in `add_remote_uploads_to_archive'
/var/www/discourse/lib/backup_restore/backuper.rb:248:in `create_archive'
/var/www/discourse/lib/backup_restore/backuper.rb:40:in `run'
/var/www/discourse/script/spawn_backup_restore.rb:9:in `backup'
/var/www/discourse/script/spawn_backup_restore.rb:31:in `block in <main>'
/var/www/discourse/script/spawn_backup_restore.rb:4:in `fork'
/var/www/discourse/script/spawn_backup_restore.rb:4:in `<main>'

My configuration is like this:


That is expected, and mostly the point of S3/R2 is that you don’t need to back the stuff up. But there is a hidden setting that will download all of the images from S3 and put them in the backup.


So maybe R2 doesn’t work as originally suggested. I thought I’d tested and had it work, but I didn’t try downloading images to the backup and I likely didn’t try doing a restore or downloading a backup file.

This probably belongs in that other topic since it seems to contract the “maybe it works” hypothesis presented there.

This setting is active, but unfortunately it does not import the images from R2 when backing up. You can see this in the log when taking a manual backup.

I’m undecided and I’m thinking of leaving cdn and using local storage. In fact, this is expected to happen, in case the opinions change.

Thank you for taking the time to respond.