Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logstash checks default queue directory for write permissions even when overridden #6378

Closed
jasontedor opened this issue Dec 8, 2016 · 5 comments
Labels

Comments

@jasontedor
Copy link
Member

jasontedor commented Dec 8, 2016

This is on Logstash 5.1.1 and is similar to #6004. My ${LOGSTASH_HOME}/data/queue is not writable and I'm overriding path.data:

logstash -f /tmp/logstash-test-20161208-84600-14ga093/simple.conf --path.data=/tmp/logstash-test-20161208-84600-14ga093/data --path.logs=/tmp/logstash-test-20161208-84600-14ga093/logs --log.level=fatal

yet I see:

[2016-12-08T12:54:47,884][FATAL][logstash.runner          ] An unexpected error occurred! {:error=>#
<ArgumentError: Path \"/usr/local/Cellar/logstash/5.1.1/libexec/data/queue\" must be a writable directory. It is not writable.>,
:backtrace=>[\"/usr/local/Cellar/logstash/5.1.1/libexec/logstash-core/lib/logstash/settings.rb:420:in `validate'\",
\"/usr/local/Cellar/logstash/5.1.1/libexec/logstash-core/lib/logstash/settings.rb:202:in `validate_value'\",
\"/usr/local/Cellar/logstash/5.1.1/libexec/logstash-core/lib/logstash/settings.rb:118:in `validate_all'\", \"org/jruby/RubyHash.java:1342:in `each'\",
\"/usr/local/Cellar/logstash/5.1.1/libexec/logstash-core/lib/logstash/settings.rb:117:in `validate_all'\",
\"/usr/local/Cellar/logstash/5.1.1/libexec/logstash-core/lib/logstash/runner.rb:205:in `execute'\",
\"/usr/local/Cellar/logstash/5.1.1/libexec/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'\",
\"/usr/local/Cellar/logstash/5.1.1/libexec/logstash-core/lib/logstash/runner.rb:178:in `run'\",
\"/usr/local/Cellar/logstash/5.1.1/libexec/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132:in `run'\",
\"/usr/local/Cellar/logstash/5.1.1/libexec/lib/bootstrap/environment.rb:71:in `(root)'\"]}\n".

Steps to reproduce:

$ curl -sS -L -O https://artifacts.elastic.co/downloads/logstash/logstash-5.1.1.tar.gz
$ tar xf logstash-5.1.1
$ cd logstash-5.1.1
$ mkdir -p /tmp/logstash/data
$ mkdir -p /tmp/logstash/logs
$ chmod 000 data
$ ./bin/logstash -e 'input { stdin } output { stdout }' --path.data /tmp/logstash/data --path.logs /tmp/logstash/logs

I don't think I'm missing a configuration option, sorry if I am but it does look like it should be using ${path.data}/queue (and setting --path.queue gives ERROR: unrecognized option '--path.queue').

@jsvd
Copy link
Member

jsvd commented Dec 9, 2016

@jasontedor thanks for reporting this.
indeed logstash computes the default value of path.queue based on the default of path.data.
what is missing is the logic to recalculate path.queue if path.data is changed (and path.queue is not set).

The reason --path.queue fails is that we only allow in the cli a few of the most commonly changed settings, others must be set through the yaml file. looking at issues like this I can see this division wasn't a very wise decision.

Currently the only workaround is editing the yaml file on installation (we do this for rpm/deb installations).

I'll open a new issue to track the recalculation of path.queue on a path.data change.

jasontedor added a commit to jasontedor/homebrew-core that referenced this issue Dec 9, 2016
This commit adds a workaround in the Logstash formula test for a known
issue with Logstash.
@jasontedor
Copy link
Member Author

Currently the only workaround is editing the yaml file on installation (we do this for rpm/deb installations).

Thanks @jsvd! That gives me enough info to workaround this issue in Homebrew/homebrew-core#7683.

looking at issues like this I can see this division wasn't a very wise decision.

In Elasticsearch we allow any node-level setting to be specified via -E key=value.

@jsvd
Copy link
Member

jsvd commented Dec 9, 2016

In Elasticsearch we allow any node-level setting to be specified via -E key=value.

we should do that we well, it is a limitation of the cli args library we use, iirc.

I opened #6387 to track this

dunn pushed a commit to Homebrew/homebrew-core that referenced this issue Dec 10, 2016
- workaround elastic/logstash#6378

Closes #7683.

Signed-off-by: Alex Dunn <dunn.alex@gmail.com>
@suyograo suyograo added the bug label Dec 11, 2016
@polynomial
Copy link

thanks @jasontedor for reporting, made resolving it much easier!

andrewvc added a commit to andrewvc/logstash that referenced this issue Feb 17, 2017
This change was harder than it first appeared! Due to the complicated
interactions between our Setting class and our monkey-patched Clamp
classes this required adding some new hooks into various places to
properly intercept the settings at the right point and set this
dynamically.

Crucially, this only changes path.queue when the user has *not*
overriden it explicitly in the settings.yml file.

Fixes elastic#6378 and elastic#6387
andrewvc added a commit to andrewvc/logstash that referenced this issue Feb 17, 2017
This change was harder than it first appeared! Due to the complicated
interactions between our Setting class and our monkey-patched Clamp
classes this required adding some new hooks into various places to
properly intercept the settings at the right point and set this
dynamically.

Crucially, this only changes path.queue when the user has *not*
overriden it explicitly in the settings.yml file.

Fixes elastic#6378 and elastic#6387
andrewvc added a commit to andrewvc/logstash that referenced this issue Feb 17, 2017
This change was harder than it first appeared! Due to the complicated
interactions between our Setting class and our monkey-patched Clamp
classes this required adding some new hooks into various places to
properly intercept the settings at the right point and set this
dynamically.

Crucially, this only changes path.queue when the user has *not*
overriden it explicitly in the settings.yml file.

Fixes elastic#6378 and elastic#6387
elasticsearch-bot pushed a commit that referenced this issue Feb 17, 2017
This change was harder than it first appeared! Due to the complicated
interactions between our Setting class and our monkey-patched Clamp
classes this required adding some new hooks into various places to
properly intercept the settings at the right point and set this
dynamically.

Crucially, this only changes path.queue when the user has *not*
overriden it explicitly in the settings.yml file.

Fixes #6378 and #6387

Fixes #6731
@bonzofenix
Copy link

When can we expect this to be released?

Thanks!

Infra-Red pushed a commit to cloudfoundry-community/logsearch-boshrelease that referenced this issue Mar 26, 2017
* Bumps logstash to v5
* Bumps elasticsearch to v5
* Removes kopf as it is not supported in elasticsearch v5
* Ingestor uses logstash v5
* Bump Kibana to v5

* Remove relp support
* Refactor parser and ingestor filters for logstash v5
* Upgrade logsearch-config to be compatible with logstash 5.0.0
* Removes all reference to logstash 2.3 from blobs
* Bumps to logstash 5.2.2 to include fix for elastic/logstash#5154
* Fix yaml format for the travis file
* Installs alter and traslate filters
* Workaround for logstash bug: elastic/logstash#6378
* Fix memory locking problem related with the tmp dir used by ES
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants