aws/aws-sdk-ruby

NameError: uninitialized constant Aws::Rest::ContentTypeHandler after upgrading aws-sdk-s3 from 1.146.1 to 1.147.0

Closed this issue · 7 comments

Describe the bug

After upgrading aws-sdk-s3 from 1.146.1 to 1.147.0 I started seeing the following error:

NameError: uninitialized constant Aws::Rest::ContentTypeHandler

Expected Behavior

No error thrown.

Current Behavior

This is the stacktrace after the error:

sign_but_dont_send/vendor/bundle/ruby/3.0.0/gems/aws-sdk-s3-1.147.0/lib/aws-sdk-s3/presigner.rb:202)
_presigned_request/vendor/bundle/ruby/3.0.0/gems/aws-sdk-s3-1.147.0/lib/aws-sdk-s3/presigner.rb:145)
presigned_url/vendor/bundle/ruby/3.0.0/gems/aws-sdk-s3-1.147.0/lib/aws-sdk-s3/presigner.rb:79)
presigned_url/vendor/bundle/ruby/3.0.0/gems/aws-sdk-s3-1.147.0/lib/aws-sdk-s3/customizations/object.rb:227)
private_url/vendor/bundle/ruby/3.0.0/gems/activestorage-6.1.7.7/lib/active_storage/service/s3_service.rb:100)
block in url/vendor/bundle/ruby/3.0.0/gems/activestorage-6.1.7.7/lib/active_storage/service.rb:118)
block in instrument/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/notifications.rb:203)
instrument/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/notifications/instrumenter.rb:24)
instrument/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/notifications.rb:203)
instrument/vendor/bundle/ruby/3.0.0/gems/activestorage-6.1.7.7/lib/active_storage/service.rb:155)
url/vendor/bundle/ruby/3.0.0/gems/activestorage-6.1.7.7/lib/active_storage/service.rb:113)
url/vendor/bundle/ruby/3.0.0/gems/activestorage-6.1.7.7/app/models/active_storage/blob.rb:199)
call/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/deprecation/method_wrappers.rb:65)
block (3 levels) in deprecate_methods/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/deprecation/method_wrappers.rb:65)
public_send/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/core_ext/module/delegation.rb:310)
method_missing/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/core_ext/module/delegation.rb:310)
public_send/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/core_ext/module/delegation.rb:310)
method_missing/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7.7/lib/active_support/core_ext/module/delegation.rb:310)

Reproduction Steps

This is the method that triggers the error:

def find_file_path
  return file.service_url
end

Possible Solution

No response

Additional Information/Context

No response

Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version

aws-sdk-s3

Environment details (Version of Ruby, OS environment)

Ruby 3.0.3

Aws::Rest::ContentTypeHandler was introduced in aws-sdk-core version 3.192, which is the minimum version required by aws-sdk-s3@1.147.0.

What version of aws-sdk-core do you have?

I have aws-sdk-core 3.191.6. I guess that is it.

What do you use to manage your dependencies? Do you use bundler? If so, it should have installed the correct, required minimum version of aws-sdk-core for the s3 gem.

I am using bundler.

aws-eventstream (1.3.0) 
aws-partitions (1.907.0)
aws-sdk-core (3.191.6)

Hmm - bundler should have automatically updated aws-sdk-core. Can you share your Gemfile and the version of bundler you are using?

The user that made the update yesterday was using an older version of Bundler 2.3.22 but he also mentioned that he rebased the commits. Perhaps something went a miss there.

I ran bundler update aws-sdk-core and it updated aws-sdk-core to 3.192.0 and I confirm the issue is fixed.

Sorry for the false alarm and thank you for your help.

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.