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

aws-sdk-core-3.110.0/lib/seahorse/client/h2/connection.rb throws /http/2/compressor.rb:333:in `initialize': wrong number of arguments (given 1, expected 0) #2455

Closed
3 tasks done
rgaufman opened this issue Dec 27, 2020 · 8 comments
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@rgaufman
Copy link

rgaufman commented Dec 27, 2020

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug

This is my code:

require 'aws-sdk'
require 'net-http2'

Aws.config.update(
  credentials: Aws::Credentials.new('REMOVED', 'REMOVED')
)

async_client = Aws::TranscribeStreamingService::AsyncClient.new(
  region: 'eu-west-2',
)

It throws the following exception:

$ ruby transcribe.rb
/opt/homebrew/lib/ruby/gems/3.0.0/gems/http-2-0.10.2/lib/http/2/compressor.rb:333:in `initialize': wrong number of arguments (given 1, expected 0) (ArgumentError)
	from /opt/homebrew/lib/ruby/gems/3.0.0/gems/http-2-0.10.2/lib/http/2/connection.rb:79:in `new'
	from /opt/homebrew/lib/ruby/gems/3.0.0/gems/http-2-0.10.2/lib/http/2/connection.rb:79:in `initialize'
	from /opt/homebrew/lib/ruby/gems/3.0.0/gems/http-2-0.10.2/lib/http/2/client.rb:28:in `initialize'
	from /opt/homebrew/lib/ruby/gems/3.0.0/gems/aws-sdk-core-3.110.0/lib/seahorse/client/h2/connection.rb:45:in `new'
	from /opt/homebrew/lib/ruby/gems/3.0.0/gems/aws-sdk-core-3.110.0/lib/seahorse/client/h2/connection.rb:45:in `initialize'
	from /opt/homebrew/lib/ruby/gems/3.0.0/gems/aws-sdk-core-3.110.0/lib/seahorse/client/async_base.rb:16:in `new'
	from /opt/homebrew/lib/ruby/gems/3.0.0/gems/aws-sdk-core-3.110.0/lib/seahorse/client/async_base.rb:16:in `initialize'
	from /opt/homebrew/lib/ruby/gems/3.0.0/gems/aws-sdk-transcribestreamingservice-1.24.0/lib/aws-sdk-transcribestreamingservice/async_client.rb:235:in `initialize'
	from /opt/homebrew/lib/ruby/gems/3.0.0/gems/aws-sdk-core-3.110.0/lib/seahorse/client/base.rb:102:in `new'
	from transcribe.rb:9:in `<main>'

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

Version of Ruby, OS environment

Romans-MacBook-Pro-2.local ➜  bin  ruby -v
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [arm64-darwin20]

To Reproduce (observed behavior)
Provided steps above to reproduce - it seems like net-http2 made some API changes?

Expected behavior
It shouldn't throw an exception

@rgaufman rgaufman added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 27, 2020
@rgaufman
Copy link
Author

Seems this is possibly an issue with Ruby3 compatibility? - filed a bug here: ostinelli/net-http2#44

@ostinelli
Copy link

Seems this is possibly an issue with Ruby3 compatibility? - filed a bug here: ostinelli/net-http2#44

Please note that aws-sdk-ruby doesn't use https://github.com/ostinelli/net-http2, rather https://github.com/igrigorik/http-2.

@rgaufman
Copy link
Author

Ah, my bad, filed the bug in the correct place: igrigorik/http-2#158

@HoneyryderChuck
Copy link
Contributor

In case it helps, I've forked http-2 more than one year ago, and have kept it API-compatible and up-to-date (it supports ruby 3 for 3/4 weeks).

The reasons for having forked it are outlined here. It's also a transitive dependency of httpx, which also supports streaming.

@rgaufman
Copy link
Author

rgaufman commented Dec 29, 2020

Ah, interesting, we recently switched to Faraday which seems to be well supported, is there an argument to switch from http-2 to faraday (or similar)?

@HoneyryderChuck
Copy link
Contributor

It's apples and oranges in this case, http-2 and faraday are two different things. http-2 is just a parser, and can't do much by itself. faraday is a "wrapper" on top of multiple http clients, which in theory allows you to choose the client library performing the actual calls (and if you're not, you're using net-http).

Back to the original thread, which is the aws-sdk-core issue you're complaining about: this sdk ships with its own "wrapper" implementation for net-http, except for async clients (I guess you're using kinesis perhaps?), which are using http-2, as the APIs are probably HTTP/2 only(?). Given that http-2 isn't a direct dependency and you might have had to install, I'd suggest you try installing http-2-next and add the following snippet:

require "http/2/next"
HTTP2 = HTTP2Next

and see if that fixes your problem.

@alextwoods
Copy link
Contributor

A new version of http-2 has been published that resolves this issue.

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

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. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

4 participants