Skip to content
New issue

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

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

Already on GitHub? # to your account

Filewatch library complains if HOME or SINCEDB_PATH variables are unset #101

Closed
magnusbaeck opened this issue Feb 14, 2016 · 4 comments
Closed
Assignees
Labels

Comments

@magnusbaeck
Copy link
Contributor

The file input plugin requires that either the HOME or the SINCEDB_PATH environment variable is set or that the sincedb_path configuration option is set. The Filewatch library performs the same check, but even if sincedb_path is used on the Logstash side Filewatch complains:

$ unset HOME SINCEDB_PATH ; /opt/logstash/bin/logstash -e 'input { file { path => "/foo/bar" sincedb_path => "/tmp/sincedb" } }' --verbose
Settings: Default pipeline workers: 2
Registering file input {:path=>["/foo/bar"], :level=>:info}
Starting pipeline {:id=>"base", :pipeline_workers=>2, :batch_size=>125, :batch_delay=>5, :max_inflight=>250, :level=>:info}
Pipeline started {:level=>:info}
Logstash startup completed
A plugin had an unrecoverable error. Will restart this plugin.
  Plugin: <LogStash::Inputs::File path=>["/foo/bar"], sincedb_path=>"/tmp/sincedb", codec=><LogStash::Codecs::Plain charset=>"UTF-8">, stat_interval=>1, discover_interval=>15, sincedb_write_interval=>15, start_position=>"end", delimiter=>"\n", ignore_older=>86400, close_older=>3600>
  Error: No HOME or SINCEDB_PATH set in environment. I need one of these set so I can keep track of the files I am following. {:level=>:error}
^CSIGINT received. Shutting down the pipeline. {:level=>:warn}
Closing inputs {:level=>:info}
Closed inputs {:level=>:info}
Input plugins stopped! Will shutdown filter/output workers. {:level=>:info}
Pipeline shutdown complete. {:level=>:info}
Logstash shutdown completed
$ /opt/logstash/bin/logstash --version
logstash 2.2.0

Note that this error message isn't the similar one from the plugin's file.rb but originates from Filewatch's tail_base.rb. Looking at the code I don't understand how this can happen since Filewatch just like this plugin only cares about the environment variables if no explicit sincedb path has been set. I'm not sure if this is a problem in this plugin or in the Filewatch library.

@guyboertje
Copy link
Contributor

@magnusbaeck - I have confirmed this is a bug

As said in that issue - I will fix this shortly.

@jay-dihenkar
Copy link

Any updates on tentative release date on solving this bug?

@guyboertje
Copy link
Contributor

I will be publishing the fix today.

guyboertje pushed a commit to guyboertje/logstash-input-file that referenced this issue Mar 15, 2016
guyboertje pushed a commit to guyboertje/logstash-input-file that referenced this issue Mar 16, 2016
make explicit exit flushing, not to rely on close() side effects.

fix failing specs NOTE auto_flush takes an argument

closes logstash-plugins#101
closes logstash-plugins#104
guyboertje pushed a commit to guyboertje/logstash-input-file that referenced this issue Mar 16, 2016
make explicit exit flushing, not to rely on close() side effects.

fix failing specs NOTE auto_flush takes an argument

More detail in the changelog

closes logstash-plugins#101
closes logstash-plugins#104
@guyboertje
Copy link
Contributor

This PR, filewatch 78 fixes this issue as raised in the filewatch issue 76.

guyboertje pushed a commit to guyboertje/logstash-input-file that referenced this issue Mar 16, 2016
make explicit exit flushing, not to rely on close() side effects.

fix failing specs NOTE auto_flush takes an argument

More detail in the changelog

change log change and remove rescue nil

closes logstash-plugins#101
closes logstash-plugins#104
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants