fluent / fluent-plugin-opensearch

OpenSearch Plugin for Fluentd
Apache License 2.0
56 stars 20 forks source link

error=":excon is not registered on Faraday::Adapter" occurs on newly install #70

Closed ashie closed 2 years ago

ashie commented 2 years ago

(check apply)

Steps to replicate

$ git clone https://github.com/fluent/fluent-plugin-opensearch.git
$ cd fluent-plugin-opensearch
$ bundle install
$ bundle exec rake test

I got this:

$ bundle exec rake test
/usr/bin/ruby3.0 -I"lib:test" /home/aho/Projects/Fluentd/fluent-plugin-opensearch/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb "test/plugin/test_filter_opensearch_genid.rb" "test/plugin/test_in_opensearch.rb" "test/plugin/test_oj_serializer.rb" "test/plugin/test_opensearch_error_handler.rb" "test/plugin/test_opensearch_fallback_selector.rb" "test/plugin/test_opensearch_tls.rb" "test/plugin/test_out_opensearch.rb" "test/plugin/test_out_opensearch_data_stream.rb" "test/test_log-ext.rb" 
Loaded suite /home/aho/Projects/Fluentd/fluent-plugin-opensearch/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader
Started
.F
===============================================================================================================================================================
Failure: test_fallback_on_info(OpenSearchFallbackSelectorTest)
/home/aho/Projects/Fluentd/fluent-plugin-opensearch/test/plugin/test_opensearch_fallback_selector.rb:89:in `test_fallback_on_info'
     86:       reload_after 10
     87:       catch_transport_exception_on_retry false # For fallback testing
     88:     ]
  => 89:     assert_raise(OpenSearch::Transport::Transport::Errors::NotFound) do
     90:       driver(config)
     91:     end
     92:     driver.run(default_tag: 'test') do

<OpenSearch::Transport::Transport::Errors::NotFound> expected but was
<#<Faraday::Error #<Faraday::Error: :excon is not registered on Faraday::Adapter>>>

diff:
? OpenSearch::Transport::Transport::Errors         ::N                 ot               Found             
? #<F            d          y             #<Faraday  Error: :excon is n   registered on  ara ay::Adapter>>
===============================================================================================================================================================

Expected Behavior or What you need to ask

bundle exec rake test should success.

Using Fluentd and OpenSearch plugin versions

$ bundle exec fluent-gem list

*** LOCAL GEMS ***

addressable (2.8.0)
aws-eventstream (1.2.0)
aws-partitions (1.613.0)
aws-sdk-core (3.131.5)
aws-sigv4 (1.5.1)
bundler (2.2.17)
concurrent-ruby (1.1.10)
cool.io (1.7.1)
crack (0.4.5)
docile (1.4.0)
excon (0.92.4)
faraday (2.4.0)
faraday-net_http (2.1.0)
faraday_middleware-aws-sigv4 (0.5.0)
flexmock (2.3.6)
fluent-plugin-opensearch (1.0.7)
fluentd (1.15.1)
hashdiff (1.0.1)
http_parser.rb (0.8.0)
io-console (0.5.11)
irb (1.4.1)
jmespath (1.6.1)
minitest (5.16.2)
msgpack (1.5.4)
multi_json (1.15.0)
oj (3.13.19)
opensearch-api (2.0.2)
opensearch-ruby (2.0.3)
opensearch-transport (2.0.1)
power_assert (2.0.1)
public_suffix (4.0.7)
rake (13.0.6)
reline (0.3.1)
rexml (3.2.5)
ruby2_keywords (0.0.5)
serverengine (2.3.0)
sigdump (0.2.4)
simplecov (0.21.2)
simplecov-html (0.12.3)
simplecov-lcov (0.8.0)
simplecov_json_formatter (0.1.4)
strptime (0.2.5)
test-unit (3.3.9)
tzinfo (2.0.5)
tzinfo-data (1.2022.1)
webmock (3.14.0)
webrick (1.7.0)
yajl-ruby (1.4.3)
ashie commented 2 years ago

From https://github.com/fluent/fluentd-docker-image/issues/338

This is because opensearch-transport 2.0.1 and 1.0.1 released at July 26 unlocks faraday 2.x and fluent-plugin-opensearch doesn't require faraday-excon. As described in https://github.com/opensearch-project/opensearch-ruby/blob/main/opensearch-transport/README.md faraday-excon is additionally required since faraday 2.0.

ashie commented 2 years ago

There are 2 options to resolve this: