Closed nnul closed 2 years ago
As a work around you can force uninstall the elasticsearch gem and install v7.17.0.
gem uninstall -I elasticsearch
gem install elasticsearch -v 7.17.0
I believe this is the root cause and should instead be versioned: https://github.com/uken/fluent-plugin-elasticsearch/blob/9cafce0c01fa9e21b36784ac82e9526d2f4767e4/fluent-plugin-elasticsearch.gemspec#L27
Additional information on the release that triggered this: https://github.com/elastic/elasticsearch-ruby/releases/tag/v8.0.0
Hi @nnul can you prepare a PR? If this plugin however wants to be backwards compatible with pre 8.0 releases of elasticsearch, there should be a single version pinning it down and then go up to elasticsearch 8.0.0 anyway.
As a work around you can force uninstall the elasticsearch gem and install v7.17.0.
gem uninstall -I elasticsearch gem install elasticsearch -v 7.17.0
This is how I did it in my custom image, works like a charm. :+1:
My error was similar, but seems related: cannot load such file -- elasticsearch/xpack (LoadError)
Inspired by the hint above this worked in my Dockerfile
:
FROM fluent/fluentd:edge
USER root
RUN apk add --no-cache --update --virtual .build-deps \
sudo build-base ruby-dev \
&& sudo gem install 'elasticsearch:7.17.0' \
'elasticsearch-api:7.17.0' \
'elasticsearch-xpack:7.17.0' \
fluent-plugin-elasticsearch \
oj \
fluent-plugin-rewrite-tag-filter \
&& sudo gem sources --clear-all \
&& apk del .build-deps \
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem
USER fluent
Hi @nnul can you prepare a PR?
Unfortunately, I am not familiar enough with Ruby gems to be able to make the needed changes to the gemspec file and test it currently. I was hoping this issue would provide enough information for another maintainer to make the required changes to this plugin.
In the meantime, I'm glad to see the workaround I provided is helping people get unstuck. :smile:
Pls, keep in mind that gem CI is falsely green on master, cos elasticsearch-ruby gem was released after the latest CI execution. Yet another possible workaround https://github.com/bitnami/bitnami-docker-fluentd/issues/35#issuecomment-1046420417
I noticed that the fix in #949 adds support for v8.0 which has fixed the issue, however it does not address the underlying time bomb of relying on an unversioned elasticsearch
dependency in the gemspec file. I'm unaware of how semver packages work in Ruby/Gems but ideally this package should be versioned and only allow implicit minor upgrades w/o forcing a major version upgrade upon installation. If this package remains unversioned, then this issue has the potential to arise again in the future when another breaking change is introduced in that dependency.
(check apply)
Problem
The release of the Elasticsearch 8.0 ruby package has broken this plugin. The Gemspec does not version the elasticsearch dependency and v8.0 has breaking changes related to the transport code. The easy fix is to version the elasticsearch gem dependency to v7.x until v8.x support is added.
Callstack:
Steps to replicate
Run the fluentd plugin from a new install.
Expected Behavior or What you need to ask
The plugin runs as expected.
Using Fluentd and ES plugin versions
Affects all versions and all platforms