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

3.1.0.beta4 - Misleading error when SSL key or cert is not readable #116

Closed
ceeeekay opened this issue Aug 12, 2016 · 2 comments
Closed
Assignees
Labels

Comments

@ceeeekay
Copy link

While running tests for elastic/logstash#5756 I noticed that if the SSL key or cert defined in the LS config are present but the logstash user cannot access them, LS throws a misleading error on startup.

An unexpected error occurred! {:error=>#<NoMethodError: undefined method stop' for nil:NilClass>, :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-beats-3.1.0.beta4-java/lib/logstash/inputs/beats.rb:173:in stop'", "/usr/share/logstash/logstash-core/lib/logstash/inputs/base.rb:88:indo_stop'", "org/jruby/RubyArray.java:1613:in each'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:366:inshutdown'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:252:in stop_pipeline'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:261:inshutdown_pipelines'", "org/jruby/RubyHash.java:1342:in each'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:261:inshutdown_pipelines'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:123:in shutdown'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:237:inexecute'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67:in run'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:157:inrun'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132:in run'", "/usr/share/logstash/lib/bootstrap/environment.rb:66:in`(root)'"], :level=>:fatal}

Ideally there should be a message stating "Key/cert cannot be read - check permissions" or similar.

Logstash 5.0.0-alpha5
logstash-input-beats 3.1.0.beta4
Ubuntu 14.04.5

@ph ph added the bug label Aug 12, 2016
@ph
Copy link
Contributor

ph commented Aug 24, 2016

OK, this error need to be solved at the logstash level I will move the issue there.
Logstash doesn't check if he can read the file, we only verify if the file exist.

Logstash will show this error if the file doesn't exist.

Invalid setting for beats input plugin:

  input {
    beats {
      # This setting must be a path
      # File does not exist or cannot be opened /Users/ph/es/certificates/bad_certificates/certificate.wwwwcrt
      ssl_certificate => "/Users/ph/es/certificates/bad_certificates/certificate.wwwwcrt"
      ...
    }
  } {:level=>:error}
fetched an invalid config {:config=>"input {\n  beats {\n    port => 5044\n    ssl => true\n    ssl_certificate => \"/Users/ph/es/certificates/bad_certificates/certificate.wwwwcrt\"\n    ssl_key => \"/Users/ph/es/certificates/bad_certificates/certificate.key\"\n  }\n}\n\noutput {\n  stdout {\n    codec => dots\n  }\n}\n\n", :reason=>"Something is wrong with your configuration.", :level=>:error}
~/e/logstash git:remotes/upstream/2.4 ❯❯❯ bin/logstash -f ls_tools/beats.conf

@ph
Copy link
Contributor

ph commented Aug 24, 2016

moved to elastic/logstash#5820

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

2 participants