Checksum issue using latest version of the aws-sdk-s3 Ruby gem with R2

AWS recently updated S3 with new integrity protections

https://github.com/aws/aws-sdk-ruby/issues/3166

The aws-sdk-s3 Ruby gem recently implemented these, and since that update my Rails app using ActiveStorage not longer works with R2.

Essentially I see the error:

12:56:01 web.1    | Aws::S3::Errors::InvalidRequest (You can only specify one checksum at a time.):


I'm aware that this gem is mainly geared for S3 but since R2 is S3 compatible, it has worked perfectly until this latest update.
GitHub
In aws-sdk-s3 v1.178.0, we released changes to the S3 client that adopts new default integrity protections. For more information on default integrity behavior, please refer to the official SDK docu...
Was this page helpful?