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

Faraday 2.0.0 breaks diplomat #223

Closed
fquesnel opened this issue Jan 5, 2022 · 4 comments
Closed

Faraday 2.0.0 breaks diplomat #223

fquesnel opened this issue Jan 5, 2022 · 4 comments

Comments

@fquesnel
Copy link

fquesnel commented Jan 5, 2022

In short: faraday 2.0.0 now requires to specify an adapter.

Currently, calling Datacenter::get results in the following error message:

An attempt to run a request with a Faraday::Connection without adapter has been made.
Please set Faraday.default_adapter or provide one when initializing the connection.
For more info, check https://lostisland.github.io/faraday/usage/.

Example stacktrace:

/bundle/ruby/2.7.0/gems/faraday-2.0.0/lib/faraday/rack_builder.rb:230:in 'ensure_adapter!'
/bundle/ruby/2.7.0/gems/faraday-2.0.0/lib/faraday/rack_builder.rb:166:in 'app'
/bundle/ruby/2.7.0/gems/faraday-2.0.0/lib/faraday/rack_builder.rb:153:in 'build_response'
/bundle/ruby/2.7.0/gems/faraday-2.0.0/lib/faraday/connection.rb:445:in 'run_request'
/bundle/ruby/2.7.0/gems/faraday-2.0.0/lib/faraday/connection.rb:200:in 'get'
/bundle/ruby/2.7.0/gems/diplomat-2.6.0/lib/diplomat/rest_client.rb:253:in 'send_get_request'
/bundle/ruby/2.7.0/gems/diplomat-2.6.0/lib/diplomat/datacenter.rb:13:in 'get'

Known mitigation: use faraday <= 1.8.0

@pierresouchay
Copy link
Member

@fquesnel Do you think you might provide a patch to support both?

@pierresouchay
Copy link
Member

@fquesnel Issue fixed, released version 2.6.1 that enforce Faraday < 2.x
If you want to support Faraday 2.x, feel free to provide a PR!

Thanks for reporting the issue

@fquesnel
Copy link
Author

fquesnel commented Jan 6, 2022

@pierresouchay thank you for quickly fixing the issue 🙂

@pierresouchay
Copy link
Member

Since https://github.com/lostisland/faraday/blob/main/CHANGELOG.md#201-2022-01-05 has been released with lostisland/faraday#1366, diplomat can now rely again on Faraday 2.0.1+

pierresouchay pushed a commit that referenced this issue Aug 22, 2022
* 2022-07-28 Dashkevych Oleksii (@Jesterovskiy) Add option to filter services
  Pass a `:filter` hash as an option to `Diplomat::Service.get` to filter https://www.consul.io/api-docs/catalog#filtering-1.
* Relax dependency on Faraday, so 2.x versions can be used again (#223)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants