Bug: S3 multipart backup upload fails with undefined method 'downcase' for nil

Hello,

I am running a Docker-based Discourse setup, I have the following AWS environment variables configured:

env:
AWS_REQUEST_CHECKSUM_CALCULATION: "WHEN_REQUIRED"
AWS_RESPONSE_CHECKSUM_VALIDATION: "WHEN_REQUIRED"

When I trigger a backup from the UI to be uploaded to S3, it fails during the multipart upload phase.

The issue originates in /var/www/discourse/lib/backup_restore/s3_backup_store.rb at this line:

obj.upload_file(source_path, content_type: content_type)

Here is the exact error from the logs:

[2026-07-11 10:18:38 UTC] /var/www/discourse/vendor/bundle/ruby/3.4.0/gems/aws-sdk-s3-1.182.0/lib/aws-sdk-s3/multipart_file_uploader.rb:186:in block (2 levels) in Aws::S3::MultipartFileUploader#upload_in_threads': undefined method downcase' for nil (NoMethodError)

        k = "checksum_#{algorithm.downcase}".to_sym

I was able to temporarily fix the issue by explicitly passing a checksum_algorithm to upload_file like this:

obj.upload_file(
source_path,
content_type: content_type,
checksum_algorithm: "CRC32"
)

With this change applied, the upload works perfectly. However, since this is a manual change inside the container, it will be wiped out the next time I rebuild the container.

Could you please look into fixing this bug in the core codebase?

Thank you!