nean
May 10, 2019, 5:28pm
2
Update:
i created an issue at github:
opened 05:25PM - 10 May 19 UTC
closed 11:41AM - 10 Mar 22 UTC
Hi,
it appears that the logstash-oss version from the original elastic site c… ontain x-pack stuff under elastic license which to my understanding should not be in the oss code?
Also logstash oss isn't starting at all, so one might be forced to use the regular version.
This can be reproduced con Centos7 following the steps below:
- original oss version from website (sidenote, oss doesn’t seem to be in the repository)
```bash
curl https://artifacts.elastic.co/downloads/logstash/logstash-oss-6.7.0.rpm -o logstash-oss-6.7.0.rpm
```
when starting the oss version following error pops up:
```bash
May 02 11:53:05 host logstash[8117]: [ERROR] 2019-05-02 11:53:05.366 [main] Logstash -
java.lang.IllegalStateException: Logstash stopped processing because of an error: (LoadError)
no such file to load -- x-pack/logstash_registry
```
- ok, just let’s remove logstash x-pack plugin:
```bash
/usr/share/logstash/bin/logstash-plugin remove x-pack
```
-> nope **x-pack not a removable plugin** :thinking:
```bash
WARNING: All illegal access operations will be denied in a future release
wAs of 6.3+ X-Pack is part of the default distribution and cannot be uninstalled;
to remove all X-Pack features, you must install the OSS-only distribution of
Logstash. ERROR: Operation aborted, cannot remove plugin, message:
x-pack not a removable plugin
```
- one way to get it working is to remove the x-pack plugin manually via the ugly way:
```bash
mv -v /usr/share/logstash/x-pack /tmp/
```
- x-pack is handled in the logstash-core and it looks like this isn't properly working:
```bash
/usr/share/logstash/logstash-core/lib/logstash/plugins/registry.rb: require("x-pack/logstash_registry")
```
- something is wrong `LogStash::OSS`
As a workaround one can deactivate/comment `load_xpack unless LogStash::OSS` in the code `/usr/share/logstash/logstash-core/lib/logstash/plugins/registry.rb`
```ruby
def setup!
#load_xpack unless LogStash::OSS
load_available_plugins
execute_universal_plugins
end
```
- `LogStash::OSS` is handled here `/usr/share/logstash/logstash-core/lib/logstash/runner.rb`
🤦♂
```ruby
require 'pathname'
LogStash::ROOT = Pathname.new(File.join(File.expand_path(File.dirname(__FILE__)), "..", "..", "..")).cleanpath.to_s
LogStash::XPACK_PATH = File.join(LogStash::ROOT, "x-pack")
LogStash::OSS = ENV["OSS"] == "true" || !File.exists?(LogStash::XPACK_PATH)
if !LogStash::OSS
xpack_dir = File.join(LogStash::XPACK_PATH, "lib")
unless $LOAD_PATH.include?(xpack_dir)
$LOAD_PATH.unshift(xpack_dir)
end
end
```
Can this please get fixed else it might look like there isn’t the highest interest in creating functional oss packages?
thanks,
nean
also I found another workaround:
one can deactivate/comment load_xpack unless LogStash::OSS
in the code/file /usr/share/logstash/logstash-core/lib/logstash/plugins/registry.rb
like below
def setup!
#load_xpack unless LogStash::OSS
load_available_plugins
execute_universal_plugins
end