elastic / logstash

Logstash - transport and process your logs, events, or other data
https://www.elastic.co/products/logstash
Other
75 stars 3.5k forks source link

bin/plugin update will make plugin functions unusable #3075

Closed suyograo closed 9 years ago

suyograo commented 9 years ago

Tried with 1.5.0-rc3.snapshot6.

  1. un-tar and run bin/plugin list. Things work as expected
  2. update plugins (we know mutate was published to 0.1.7 on RubyGems):
ubuntu@ip-10-0-1-9:~/logstash-1.5.0-rc3.snapshot6$ bin/plugin list --verbose | grep mutate
logstash-filter-mutate (0.1.6)

^^ old version packaged in artifacts

ubuntu@ip-10-0-1-9:~/logstash-1.5.0-rc3.snapshot6$ bin/plugin update
Updating logstash-codec-collectd, logstash-codec-dots, logstash-codec-edn, logstash-codec-line, logstash-codec-edn_lines, logstash-codec-es_bulk, logstash-codec-fluent, logstash-codec-graphite, logstash-codec-json, logstash-codec-json_lines, logstash-codec-msgpack, logstash-patterns-core, logstash-codec-multiline, logstash-codec-netflow, logstash-codec-oldlogstashjson, logstash-codec-plain, logstash-codec-rubydebug, logstash-filter-anonymize, logstash-filter-checksum, logstash-filter-clone, logstash-filter-csv, logstash-input-generator, logstash-output-null, 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-mutate, logstash-filter-multiline, logstash-filter-ruby, logstash-filter-sleep, logstash-filter-split, logstash-filter-syslog_pri, logstash-filter-throttle, logstash-filter-urldecode, logstash-filter-useragent, logstash-filter-uuid, logstash-filter-xml, logstash-input-couchdb_changes, logstash-input-elasticsearch, logstash-input-eventlog, logstash-input-exec, logstash-input-file, logstash-input-ganglia, logstash-input-gelf, logstash-input-tcp, logstash-input-graphite, logstash-input-heartbeat, logstash-input-imap, logstash-input-irc, logstash-input-kafka, logstash-input-log4j, logstash-input-lumberjack, logstash-input-pipe, logstash-input-rabbitmq, logstash-input-redis, logstash-input-s3, logstash-input-snmptrap, logstash-input-sqs, logstash-input-stdin, logstash-input-syslog, logstash-input-twitter, logstash-input-udp, logstash-input-unix, logstash-input-xmpp, logstash-input-zeromq, logstash-output-cloudwatch, logstash-output-file, logstash-output-csv, logstash-output-elasticsearch, logstash-output-elasticsearch_http, logstash-output-email, logstash-output-exec, logstash-output-ganglia, logstash-output-gelf, logstash-output-graphite, logstash-output-hipchat, logstash-output-http, logstash-output-irc, logstash-output-juggernaut, logstash-output-kafka, logstash-output-lumberjack, logstash-output-nagios, logstash-output-nagios_nsca, 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-output-tcp, logstash-output-udp, logstash-output-xmpp, logstash-output-zeromq
No plugin updated

First bug: it says "No plugin updated"

After that sequence, no plugin commands will work

ubuntu@ip-10-0-1-9:~/logstash-1.5.0-rc3.snapshot6$ bin/plugin list
Bundler::GemNotFound: Could not find logstash-filter-mutate-0.1.7 in any of the sources
      materialize at /home/ubuntu/logstash-1.5.0-rc3.snapshot6/vendor/bundle/jruby/1.9/gems/bundler-1.9.4/lib/bundler/spec_set.rb:92
             map! at org/jruby/RubyArray.java:2444
      materialize at /home/ubuntu/logstash-1.5.0-rc3.snapshot6/vendor/bundle/jruby/1.9/gems/bundler-1.9.4/lib/bundler/spec_set.rb:85
            specs at /home/ubuntu/logstash-1.5.0-rc3.snapshot6/vendor/bundle/jruby/1.9/gems/bundler-1.9.4/lib/bundler/definition.rb:132
        specs_for at /home/ubuntu/logstash-1.5.0-rc3.snapshot6/vendor/bundle/jruby/1.9/gems/bundler-1.9.4/lib/bundler/definition.rb:177
  requested_specs at /home/ubuntu/logstash-1.5.0-rc3.snapshot6/vendor/bundle/jruby/1.9/gems/bundler-1.9.4/lib/bundler/definition.rb:166
  requested_specs at /home/ubuntu/logstash-1.5.0-rc3.snapshot6/vendor/bundle/jruby/1.9/gems/bundler-1.9.4/lib/bundler/environment.rb:18
            setup at /home/ubuntu/logstash-1.5.0-rc3.snapshot6/vendor/bundle/jruby/1.9/gems/bundler-1.9.4/lib/bundler/runtime.rb:13
            setup at /home/ubuntu/logstash-1.5.0-rc3.snapshot6/vendor/bundle/jruby/1.9/gems/bundler-1.9.4/lib/bundler.rb:122
           setup! at /home/ubuntu/logstash-1.5.0-rc3.snapshot6/lib/logstash/bundler.rb:51
          execute at /home/ubuntu/logstash-1.5.0-rc3.snapshot6/lib/logstash/pluginmanager/list.rb:20
              run at /home/ubuntu/logstash-1.5.0-rc3.snapshot6/vendor/bundle/jruby/1.9/gems/clamp-0.6.4/lib/clamp/command.rb:67
          execute at /home/ubuntu/logstash-1.5.0-rc3.snapshot6/vendor/bundle/jruby/1.9/gems/clamp-0.6.4/lib/clamp/subcommand/execution.rb:11
              run at /home/ubuntu/logstash-1.5.0-rc3.snapshot6/vendor/bundle/jruby/1.9/gems/clamp-0.6.4/lib/clamp/command.rb:67
              run at /home/ubuntu/logstash-1.5.0-rc3.snapshot6/vendor/bundle/jruby/1.9/gems/clamp-0.6.4/lib/clamp/command.rb:132
           (root) at /home/ubuntu/logstash-1.5.0-rc3.snapshot6/lib/logstash/pluginmanager.rb:12
suyograo commented 9 years ago

so looks like Gemfile.jruby-1.9.lock has been updated with the new version when you run bin/plugin update

logstash-filter-mutate (0.1.7)
      logstash-core (>= 1.4.0, < 2.0.0)
      logstash-filter-grok
      logstash-patterns-core

but not the Gemfile.jruby-1.9.lock.defaults

logstash-filter-mutate (0.1.6)
      logstash-core (>= 1.4.0, < 2.0.0)
      logstash-filter-grok
      logstash-patterns-core
colinsurprenant commented 9 years ago

it's normal that the Gemfile.jruby-1.9.lock.defaults does not get updated, this file is manually copied form the Gemfile.jruby-1.9.lock after installing the default plugins. will take a look shortly at the package content.

jsvd commented 9 years ago

the line that triggers the removal of .gemspecs and some gems is LogStash::Bundler.invoke_bundler!(:clean => true) in the cleanup steps of the update command

ph commented 9 years ago

This is bit weird, because when I've moved stuff around for the local gem installation and did a bit of refactoring of the code I did not change how we were calling bundler or which arguments we were using.