Logstash 2.1 fails to start after logstash-output-elasticsearch update


#1

I just ran a bin/plugin update and the logstash-output-elasticsearch plugin was upgraded from 2.3.0 to 2.3.1. When I tried restarting logstash I get the following error:

The error reported is:

you might need to reinstall the gem which depends on the missing jar or in case there is Jars.lock then resolve the jars with lock_jars command

no such file to load -- org/apache/httpcomponents/httpclient/4.5/httpclient-4.5 (LoadError)

Any way to resolve this quickly?


Logstash 2.1.1 Fresh ELK Install Errors
#2

I did look through the history when running the bin/plugin update and saw these 2 errors:

Updating logstash-codec-collectd, logstash-codec-dots, logstash-codec-edn, logstash-codec-edn_lines, logstash-codec-es_bulk, logstash-codec-fluent, logstash-codec-graphite, logstash-code c-json, logstash-codec-json_lines, logstash-codec-line, logstash-codec-msgpack, logstash-codec-multiline, logstash-codec-netflow, logstash-codec-oldlogstashjson, logstash-codec-plain, lo gstash-codec-rubydebug, logstash-filter-anonymize, logstash-filter-checksum, logstash-filter-clone, logstash-filter-csv, logstash-filter-date, logstash-filter-dns, logstash-filter-drop, logstash-filter-fingerprint, logstash-filter-geoip, logstash-filter-grok, logstash-filter-json, logstash-filter-kv, logstash-filter-metrics, logstash-filter-multiline, logstash-filter-mu tate, logstash-filter-ruby, logstash-filter-sleep, logstash-filter-split, logstash-filter-syslog_pri, logstash-filter-throttle, logstash-filter-translate, logstash-filter-urldecode, logs tash-filter-useragent, logstash-filter-uuid, logstash-filter-xml, logstash-input-beats, logstash-input-couchdb_changes, logstash-input-elasticsearch, logstash-input-eventlog, logstash-in put-exec, logstash-input-file, logstash-input-ganglia, logstash-input-gelf, logstash-input-generator, logstash-input-graphite, logstash-input-heartbeat, logstash-input-http, logstash-inp ut-imap, logstash-input-irc, logstash-input-jdbc, logstash-input-kafka, logstash-input-log4j, logstash-input-lumberjack, logstash-input-pipe, logstash-input-rabbitmq, logstash-input-redi s, logstash-input-s3, logstash-input-snmptrap, logstash-input-sqs, logstash-input-stdin, logstash-input-syslog, logstash-input-tcp, logstash-input-twitter, logstash-input-udp, logstash-i nput-unix, logstash-input-xmpp, logstash-input-zeromq, logstash-output-cloudwatch, logstash-output-csv, logstash-output-elasticsearch, logstash-output-email, logstash-output-exec, logsta sh-output-file, logstash-output-ganglia, logstash-output-gelf, logstash-output-graphite, logstash-output-hipchat, logstash-output-http, logstash-output-irc, logstash-output-juggernaut, l ogstash-output-kafka, logstash-output-lumberjack, logstash-output-nagios, logstash-output-nagios_nsca, logstash-output-null, logstash-output-opentsdb, logstash-output-pagerduty, logstash -output-pipe, logstash-output-rabbitmq, logstash-output-redis, logstash-output-s3, logstash-output-sns, logstash-output-sqs, logstash-output-statsd, logstash-output-stdout, logstash-outp ut-tcp, logstash-output-udp, logstash-output-xmpp, logstash-output-zeromq, logstash-patterns-core
Error Bundler::InstallError, retrying 1/10
An error occurred while installing jruby-kafka (1.5.0), and Bundler cannot continue.
Make sure that gem install jruby-kafka -v '1.5.0' succeeds before bundling.
WARNING: SSLSocket#session= is not supported
Error Bundler::InstallError, retrying 2/10
An error occurred while installing manticore (0.5.2), and Bundler cannot continue.
Make sure that gem install manticore -v '0.5.2' succeeds before bundling.
WARNING: SSLSocket#session= is not supported

When I try running gem install manticore -v '0.5.2' I get the following error:

ERROR: Could not find a valid gem 'manticore' (= 0.5.2), here is why:
Found manticore (0.5.2), but was for platform java
ERROR: Possible alternatives: MINT-core, handscore, antidote, antinode, fat_core


#3

Digging deeper into the rabbit hole I discovered I needed to specify the path to jruby to run the gem install command. When running the following command I now see missing dependency for manticore v0.5.2.

env GEM_HOME=/opt/logstash/vendor/bundle/jruby/1.9 /opt/logstash/vendor/jruby/bin/jruby /opt/logstash/vendor/jruby/bin/gem install manticore -v '0.5.2'

it was missing an xml file that was supposed to be included with ruby-maven 3.3.8.

The following 2 commands got me back up and running with logstash-output-elasticsearch v2.3.1:

[user@host ~]# env GEM_HOME=/opt/logstash/vendor/bundle/jruby/1.9 /opt/logstash/vendor/jruby/bin/jruby /opt/logstash/vendor/jruby/bin/gem install ruby-maven

this installed the lastest v.3.3.8 of ruby-maven and then I ran

[user@host ~]# env GEM_HOME=/opt/logstash/vendor/bundle/jruby/1.9 /opt/logstash/vendor/jruby/bin/jruby /opt/logstash/vendor/jruby/bin/gem install manticore -v '0.5.2'

after that install completed successfully I was able to restart logstash. Hope this helps!


Syslog Severity and Priority not being parsed by syslog plugin
(Bud B) #4

Hit this same issue. Thanks for the fix! -- Bud


(Mark Walkom) #5

That's kinda sucky to have to do that to upgrade a plugin, lemme see if one of the LS team can comment.


(Suyog Rao) #6

This error is because we updated logstash-output-elasticsearch to explicitly depend on manticore-http library, but the Logstash core 2.1.1 was bundled with a different version of it. The workaround @techcheez mentioned will work (its not ideal to do this) but we are soon releasing (target - next week) Logstash 2.1.2 with full update to all plugins.

Also, is there a reason users prefer to run bin/plugin update instead of updating entire LS binary? Can you please weigh in your thoughts here? https://github.com/elastic/logstash/issues/4415


(Ampodobas) #7

This worked for me:

Issue: Error when starting logstash
β€œThe error reported is: you might need to reinstall the gem which depends on the missing jar or in case there is Jars.lock then resolve the jars with lock_jars command no such file to load -- org/apache/httpcomponents/httpclient/4.5/httpclient-4.5 (LoadError)”

Proximate cause: this plugin
logstash-output-elasticsearch

Solution:
/opt/logstash/bin/plugin uninstall logstash-output-elasticsearch;
/opt/logstash/bin/plugin install --version 2.3.0 logstash-output-elasticsearch;

If that works, great! However, you may see this error: "Plugin version conflict, aborting ERROR: Installation Aborted, message: Bundler could not find compatible versions for gem "manticore": In snapshot (Gemfile.lock): manticore (= 0.5.2) In Gemfile:
logstash-output-elasticsearch (= 2.3.0) java depends on manticore (~> 0.4.2) java"

Then:

vi /opt/logstash/Gemfile.jruby-1.9.lock;

Change manticore from 0.5.2 to 0.4.2 (in all places, it was in two places in my Gemfile.jruby-1.9.lock file) and save + exit, then run:
/opt/logstash/bin/plugin install --version 2.3.0 logstash-output-elasticsearch;

Result:
[root@elk logstash]# service logstash restart
logstash started.


(system) #8