Logstash 6.2.1 - unable to install unbundled filter plugin


#1

Hi Team,

I am trying to install an unbundled logstash plugin, namely logstash-filter-age.

I've exported both http_proxy and https_proxy and verified that I can connect to the internet and ran this command to try to install the filter:

bin/logstash-plugin install logstash-filter-age

But it is throwing me back with this error:

Validating logstash-filter-age
Unable to download data from https://rubygems.org - SocketError: Failed to open TCP connection to rubygems.org:443 (initialize: name or service not known) (https://rubygems.org/latest_specs.4.8.gz)
ERROR: Installation aborted, verification failed for logstash-filter-age

Any ideas how to get around this problem please?

On a side note, I also tried downloading the gem and installing it manually:

bin/logstash-plugin install --local --no-verify file:///path/to/the.gem

However it throws me this:

ERROR: Invalid pack for: file:///path/to/the.gem, reason: Invalid format, the pack must be in zip format, message: Invalid format, the pack must be in zip format

What is the best way to install a gem locally?

Thanks a lot for your help,


#2

You can create a zip format plugin pack on a server that has connectivity, then copy it to an offline server. Documentation is here. For me that meant building the pack at home and sending it to myself at work :frowning:


#3

Thanks for the tip. While checking out your suggestion I stumbled upon this doc: https://www.elastic.co/guide/en/logstash/current/working-with-plugins.html#installing-local-plugins

Apparently gem files can be used - but I should drop the file:/// bit - will try and report back.


#4

So it does not work either but I figured out the problem is due to this:

Installing logstash-filter-age
Error Bundler::Fetcher::CertificateFailureError, retrying 1/10
Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.

In the long run, I should set up my certs correctly.

Meanwhile, what I have done to overcome this problem was to modify the Gemfile within the Logstash installation dir to use http link instead and add the age filter to the bundle then force install:

perl -pi -e "s/https:\/\/rubygems.org/http:\/\/rubygems.org/g" /path/to/logstash/Gemfile
echo 'gem "logstash-filter-age"' >> /path/to/logstash/Gemfile
/path/to/logstash/bin/logstash-plugin install --no-verify

(system) #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.