Closed Sebov1c closed 1 year ago
I'm having this issue too. I've tried with different versions but so far every 5.x version has this problem.
Tried with 4.x versions and the error becomes:
fluentd_1 | /usr/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require': cannot load such file -- elasticsearch/transport/transport/connections/selector (LoadError)
fluentd_1 | from /usr/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluent-plugin-elasticsearch-4.3.3/lib/fluent/plugin/elasticsearch_fallback_selector.rb:1:in `<top (required)>'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluent-plugin-elasticsearch-4.3.3/lib/fluent/plugin/out_elasticsearch.rb:30:in `require_relative'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluent-plugin-elasticsearch-4.3.3/lib/fluent/plugin/out_elasticsearch.rb:30:in `<top (required)>'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluent-plugin-elasticsearch-4.3.3/lib/fluent/plugin/out_elasticsearch_dynamic.rb:2:in `require_relative'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluent-plugin-elasticsearch-4.3.3/lib/fluent/plugin/out_elasticsearch_dynamic.rb:2:in `<top (required)>'
fluentd_1 | from /usr/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
fluentd_1 | from /usr/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluentd-1.15.2/lib/fluent/registry.rb:103:in `block in search'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluentd-1.15.2/lib/fluent/registry.rb:100:in `each'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluentd-1.15.2/lib/fluent/registry.rb:100:in `search'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluentd-1.15.2/lib/fluent/registry.rb:44:in `lookup'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluentd-1.15.2/lib/fluent/plugin.rb:169:in `new_impl'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluentd-1.15.2/lib/fluent/plugin.rb:114:in `new_output'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluentd-1.15.2/lib/fluent/agent.rb:130:in `add_match'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluentd-1.15.2/lib/fluent/agent.rb:74:in `block in configure'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluentd-1.15.2/lib/fluent/agent.rb:64:in `each'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluentd-1.15.2/lib/fluent/agent.rb:64:in `configure'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluentd-1.15.2/lib/fluent/root_agent.rb:149:in `configure'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluentd-1.15.2/lib/fluent/engine.rb:105:in `configure'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluentd-1.15.2/lib/fluent/engine.rb:80:in `run_configure'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluentd-1.15.2/lib/fluent/supervisor.rb:712:in `run_supervisor'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluentd-1.15.2/lib/fluent/command/fluentd.rb:361:in `<top (required)>'
fluentd_1 | from /usr/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
fluentd_1 | from /usr/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
fluentd_1 | from /usr/local/lib/ruby/gems/2.7.0/gems/fluentd-1.15.2/bin/fluentd:15:in `<top (required)>'
fluentd_1 | from /usr/local/bundle/bin/fluentd:23:in `load'
fluentd_1 | from /usr/local/bundle/bin/fluentd:23:in `<main>'
Same issue.
I installed faraday 1.10.0 and it seems to work RUN gem install faraday -v 1.10.0
OK, so here is the temporary fix while this repository is not updated:
FROM fluent/fluentd:v1.15.2-debian-1.0
USER root
RUN gem install fluent-plugin-elasticsearch --no-document --version 5.2.3 \
&& gem uninstall --ignore-dependencies faraday \
&& gem install faraday --no-document --version 1.10.0 \
&& gem sources --clear-all \
&& apt-get purge -y --auto-remove \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem
USER fluent
Seems to be the same issue as https://github.com/fluent/fluent-plugin-opensearch/issues/70 resulting from Faraday 2.x not including excon
same workaround as above for alpine image
FROM fluent/fluentd:edge
USER root
RUN apk add --no-cache --update --virtual .build-deps build-base ruby-dev \
&& gem install fluent-plugin-elasticsearch --no-document --version 5.2.3 \
&& gem uninstall --ignore-dependencies faraday \
&& gem install faraday --no-document --version 1.10.0 \
&& gem sources --clear-all \
&& apk del .build-deps \
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem
Same issue.
Thanks for your report. I'd released the patch for this issue as v5.2.4.
So I did a bit of digging on this issue, this is caused by Faraday gem moving its http backend adaptors out into their own respective gems. So to fix this issue, you'll need to install https://github.com/lostisland/faraday-excon, and run require faraday/excon
, but seems like there's a bug with Faraday with Ruby 2.7 https://github.com/lostisland/faraday/issues/1444, and this is where I got up to. I'll pick up the further investigation once I have more time https://github.com/uken/fluent-plugin-elasticsearch/pull/1012
but seems like there's a bug with Faraday with Ruby 2.7 lostisland/faraday#1444, and this is where I got up to. I'll pick up the further investigation once I have more time #1012
Ruby 2.7 is reached to EOL. No need to take care of.
(check apply)
Problem
When I try to read a fluent.conf containing an elastic output the following error occurs:
Steps to replicate
Dockerfile
fluent.conf
Expected Behavior
Fluentd does not produce an error when reading a config containing elastic output plugin:
The OpenSearch plugin had a similar issue. Maybe this helps:
Using Fluentd and ES plugin versions
fluentd --version
ortd-agent --version
fluent-gem list
,td-agent-gem list
or your Gemfile.lock