Logstash won't start: permission problem?

I have updated to ELK 5.4.6 now I get the following error when starting Logstash? Is this a permission problem? Any ideas where I have to search?

[2017-11-08T15:44:24,340][FATAL][logstash.runner ] An unexpected error occurred! {:error=>java.nio.file.AccessDeniedException: /var/lib/logstash/.lock, :backtrace=>["sun.nio.fs.UnixException.translateToIOException(sun/nio/fs/UnixException.java:84)", "sun.nio.fs.UnixException.rethrowAsIOException(sun/nio/fs/UnixException.java:102)", "sun.nio.fs.UnixException.rethrowAsIOException(sun/nio/fs/UnixException.java:107)", "sun.nio.fs.UnixFileSystemProvider.newFileChannel(sun/nio/fs/UnixFileSystemProvider.java:177)", "java.nio.channels.FileChannel.open(java/nio/channels/FileChannel.java:287)", "java.nio.channels.FileChannel.open(java/nio/channels/FileChannel.java:335)", "org.logstash.FileLockFactory.obtainLock(org/logstash/FileLockFactory.java:84)", "java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)", "RUBY.execute(/usr/share/logstash/logstash-core/lib/logstash/runner.rb:309)", "RUBY.run(/usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67)", "RUBY.run(/usr/share/logstash/logstash-core/lib/logstash/runner.rb:204)", "RUBY.run(/usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132)", "usr.share.logstash.lib.bootstrap.environment.(root)(/usr/share/logstash/lib/bootstrap/environment.rb:71)", "usr.share.logstash.lib.bootstrap.environment.(root)(usr/share/logstash/lib/bootstrap//usr/share/logstash/lib/bootstrap/environment.rb:71)"]}

Thanks for your help.

Marc

What user is Logstash running as? What permission and ownership does /var/lib/logstash/.lock and /var/lib/logstash have?

1 Like

I set for all of those folder CHMOD 777.
I start logstash as root:
root 3227 0.0 0.0 112644 964 pts/1 R+ 17:33 0:00 grep --color=auto logstash

Now i get the following message:

[2017-11-08T17:40:40,217][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2017-11-08T17:40:43,208][WARN ][logstash.agent ] stopping pipeline {:id=>"main"}
[2017-11-08T17:40:43,219][FATAL][logstash.runner ] An unexpected error occurred! {:error=>#<NoMethodError: undefined method each' for nil:NilClass>, :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-syslog-3.2.2/lib/logstash/inputs/syslog.rb:240:in close_tcp'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-syslog-3.2.2/lib/logstash/inputs/syslog.rb:225:in stop'", "/usr/share/logstash/logstash-core/lib/logstash/inputs/base.rb:89:in do_stop'", "org/jruby/RubyArray.java:1613:in each'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:513:in shutdown'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:436:in stop_pipeline'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:452:in shutdown_pipelines'", "org/jruby/RubyHash.java:1342:in each'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:452:in shutdown_pipelines'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:139:in shutdown'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:328:in execute'", "/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:204:in run'", "/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:71:in (root)'"]}

I set for all of those folder CHMOD 777.

No, don't do that. There's no reason to give anyone but the Logstash user write access

I start logstash as root:
root 3227 0.0 0.0 112644 964 pts/1 R+ 17:33 0:00 grep --color=auto logstash

Maybe you did start Logstash as root, but this line just proves that you ran grep --color=auto logstash as root.

Don't know what's up with the error you get.

What kind of write settings should I set for those folders? I don't know what it was before....
Do you know that?

Maybe it's a filter problem I found out thru google.

What kind of write settings should I set for those folders? I don't know what it was before....

You'll want to run Logstash as the logstash user so just make sure that user has full access to the file and the directory it's in.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.