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

**URL:** https://meta.discourse.org/t/bug-s3-multipart-backup-upload-fails-with-undefined-method-downcase-for-nil/407551
**Category:** Bug
**Created:** [July 14, 2026, 8:51am UTC](https://meta.discourse.org/t/bug-s3-multipart-backup-upload-fails-with-undefined-method-downcase-for-nil/407551 "2026-07-14T08:51:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![saeid\_ezzati](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saeid_ezzati/32/524376_2.png) [@saeid\_ezzati](https://meta.discourse.org/u/saeid_ezzati)
#### Post date: [July 14, 2026, 8:51am UTC](https://meta.discourse.org/t/bug-s3-multipart-backup-upload-fails-with-undefined-method-downcase-for-nil/407551/1 "2026-07-14T08:51:16Z")

</div>

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:

```plaintext
[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!

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [July 15, 2026, 12:30pm UTC](https://meta.discourse.org/t/bug-s3-multipart-backup-upload-fails-with-undefined-method-downcase-for-nil/407551/4 "2026-07-15T12:30:02Z")

</div>

Thanks for the report @saeid_ezzati 👍 It’ll be fixed by

> <https://github.com/discourse/discourse/pull/41732>
>
> Previously, S3 backups and uploads larger than the multipart threshold crashed w…ith \`undefined method 'downcase' for nil\` whenever \`AWS\_REQUEST\_CHECKSUM\_CALCULATION\` was set to \`when\_required\` (a common setup for S3-compatible providers such as Cloudflare R2, Backblaze B2, and MinIO), because of a bug in \`aws-sdk-s3\` 1.182.0's multipart uploader.
> 
> This change bumps \`aws-sdk-s3\` to 1.227.0 — which respects \`when\_required\` in multipart uploads — and adapts to its API changes: moving off the newly-deprecated \`Aws::S3::Object#upload\_file\`/\`#download\_file\` onto \`Aws::S3::TransferManager\`, and reading the ETag back from the destination now that multipart copies no longer return a response.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [July 18, 2026, 6:00am UTC](https://meta.discourse.org/t/bug-s3-multipart-backup-upload-fails-with-undefined-method-downcase-for-nil/407551/6 "2026-07-18T06:00:29Z")

</div>

This topic was automatically closed after 2 days. New replies are no longer allowed.
