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

Exception messages are lost in Logstash 2.4 #5969

Closed
magnusbaeck opened this issue Sep 26, 2016 · 2 comments
Closed

Exception messages are lost in Logstash 2.4 #5969

magnusbaeck opened this issue Sep 26, 2016 · 2 comments

Comments

@magnusbaeck
Copy link
Contributor

Starting in Logstash 2.4 the exception messages are lost, so you're only getting a stacktrace and have to resort to reading the source code to figure out what Logstash is complaining about. Given this invalid configuration:

input { file { path => "foo/bar" } }
output { stdout { } }

Logstash 2.3.2 says this:

$ /opt/logstash/bin/logstash -f test.config
Settings: Default pipeline workers: 8
Pipeline aborted due to error {:exception=>#<ArgumentError: File paths must be absolute, relative path specified: foo/bar>, :backtrace=>["/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-file-2.2.5/lib/logstash/inputs/file.rb:187:in `register'", "org/jruby/RubyArray.java:1613:in `each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-file-2.2.5/lib/logstash/inputs/file.rb:185:in `register'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.2-java/lib/logstash/pipeline.rb:330:in `start_inputs'", "org/jruby/RubyArray.java:1613:in `each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.2-java/lib/logstash/pipeline.rb:329:in `start_inputs'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.2-java/lib/logstash/pipeline.rb:180:in `start_workers'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.2-java/lib/logstash/pipeline.rb:136:in `run'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.2-java/lib/logstash/agent.rb:465:in `start_pipeline'"], :level=>:error}
stopping pipeline {:id=>"main"}

This is a really bad error message to show to an end user who made a trivial configuration mistake, but it gets even worse in 2.4.0:

$ /opt/logstash/bin/logstash -f test.config
Settings: Default pipeline workers: 8
Pipeline aborted due to error {:exception=>"ArgumentError", :backtrace=>["/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-file-2.2.5/lib/logstash/inputs/file.rb:187:in `register'", "org/jruby/RubyArray.java:1613:in `each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-file-2.2.5/lib/logstash/inputs/file.rb:185:in `register'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:330:in `start_inputs'", "org/jruby/RubyArray.java:1613:in `each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:329:in `start_inputs'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:180:in `start_workers'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:136:in `run'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/agent.rb:491:in `start_pipeline'"], :level=>:error}
stopping pipeline {:id=>"main"}
@jsvd
Copy link
Member

jsvd commented Sep 26, 2016

This change was introduced in 4e1f8258.
The message was showing since we logged the actual exception instance, which we lost when changing to e.class.name. Adding a :message => e.message will mimic the previous behaviour.

@jsvd
Copy link
Member

jsvd commented Oct 12, 2016

closed by #6011

@jsvd jsvd closed this as completed Oct 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants