Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
albertski opened this issue Apr 18, 2024 · 7 comments
Labels
bug This issue is a bug. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@albertski
Copy link

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

@albertski albertski added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 18, 2024
@alextwoods
Copy link
Contributor

Aws::Rest::ContentTypeHandler was introduced in aws-sdk-core version 3.192, which is the minimum version required by [email protected].

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

@albertski
Copy link
Author

albertski commented Apr 18, 2024

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

@alextwoods
Copy link
Contributor

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.

@albertski
Copy link
Author

I am using bundler.

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

@alextwoods
Copy link
Contributor

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

@jterapin jterapin added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Apr 18, 2024
@albertski
Copy link
Author

albertski commented Apr 18, 2024

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.

Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

3 participants