Skip to content

Conversation

@jules-w2
Copy link

@jules-w2 jules-w2 commented Oct 7, 2025

The current implementation uses the deprecated Aws::S3::Object#upload_file method, which triggers this warning:

#################### DEPRECATION WARNING ####################
Called deprecated method upload_file of Aws::S3::Object. Use Aws::S3::TransferManager#upload_file instead.
Method upload_file will be removed in next major version.
#############################################################

Additionally, this causes the first file upload to fail when starting the application or a background task. Subsequent uploads work correctly, but the initial failure is problematic for production environments.

Fixes #190

Changes

  • Updated CarrierWave::Storage::AWSFile#store to use Aws::S3::TransferManager
  • Maintained multipart upload threshold of 15MB (MULTIPART_THRESHOLD)
  • Preserved all existing options: ACL, content_type, encryption_key, etc.
  • Updated test spec to properly mock TransferManager
  • Adjusted Metrics/ClassLength in .rubocop.yml from 102 to 105 lines to maintain code readability

Testing

All existing tests pass:

  • 47 examples, 0 failures
  • RuboCop: 0 offenses

Compatibility

This change maintains backward compatibility while ensuring compatibility with future AWS SDK versions.

@fabian-as
Copy link

Any chance on getting this merged soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aws-sdk-s3 1.197.0+ deprecation warnings for upload_file, download_file, upload_stream methods

3 participants