elastic / logstash

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

Offline pack cannot force and update to a dependencies #8170

Open ph opened 7 years ago

ph commented 7 years ago

Installing a pack to upgrade existing plugins or a pack that come with an already installed dependency will fails.

Scenario

Debug message

The bundle currently has stud locked at 0.0.22.
Try running `bundle update stud`

Solution

The problem is when we add the new dependencies to the Bundler's gem definition we never mark the gem as unlockable.

ph commented 7 years ago

I've fixed the installation issue by marking the installed dependencies as unlockable, I have an integration suite ready but it fails because of #8207. The logstash-plugin list command that I used to verify if the plugin is correctly installed refuses to run. The main Logstash command works.

ph commented 7 years ago

Workaround:

Remove stud in the dependencies folder and recreate the zip.

damianpfister commented 6 years ago

I tested this recently on the latest release of Logstash at the time - version 5.6.3 and hit the same issues.

Vanilla install of Logstash shows the logstash-input-tcp plugin at version 4.2.4:

./logstash-plugin list --installed --verbose | grep logstash-input-tcp
logstash-input-tcp (4.2.4)

Downloading the gem file for the latest release (5.0.2) and attempting to install it locally as a ZIP file fails:

wget https://rubygems.org/downloads/logstash-input-tcp-5.0.2-java.gem
zip damian.zip *.gem
./logstash-plugin install file:////Users/damianpfister/ElasticTest/logstash/logstash-5.6.3/bin/damian.zip

Installing file: //Users/damianpfister/ElasticTest/logstash/logstash-5.6.3/bin/damian.zip

ERROR: An error occured when installing the: file:////Users/damianpfister/ElasticTest/logstash/logstash-5.6.3/bin/damian.zip, to have more information about the error add a DEBUG=1 before running the command., message: You have requested:
  logstash-input-tcp = 5.0.2

The bundle currently has logstash-input-tcp locked at 4.2.4.
Try running `bundle update logstash-input-tcp`

No updates available:

./logstash-plugin update logstash-input-tcp
Updating logstash-input-tcp
No plugin updated

Attempts to remove the plugin failed due to dependancies:

./logstash-plugin remove logstash-input-tcp
Failed to remove "logstash-input-tcp" because the following plugins or libraries depend on it:

* logstash-input-graphite

Removing the dependancy and plugin before another manual local file update worked:

./logstash-plugin remove logstash-input-graphite
Successfully removed logstash-input-graphite

/logstash-plugin remove logstash-input-tcp
Successfully removed logstash-input-tcp

/logstash-plugin install file:////Users/damianpfister/ElasticTest/logstash/logstash-5.6.3/bin/damian.zip
Installing file: //Users/damianpfister/ElasticTest/logstash/logstash-5.6.3/bin/damian.zip
Install successful

./logstash-plugin list --installed --verbose | grep logstash-input-tcp
logstash-input-tcp (5.0.2)

For offline installations this appears to be a somewhat cumbersome approach though. Are there any alternatives?