Permission Denied - permission settings?

I get these errors when trying to start Logstash. I tried changing permissions. What do your permission settings look like on Ubuntu?

logstash --path.settings /etc/logstash
`ERROR Unable to create file /var/log/logstash/logstash-plain.log java.io.IOException: Permission denied

ERROR Could not create plugin of type class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.IllegalStateException: ManagerFactory

ERROR Unable to invoke factory method in class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender

ERROR Unable to create file /var/log/logstash/logstash-plain.log java.io.IOException: Permission denied

main ERROR Null object returned for RollingFile in Appenders.
main ERROR Null object returned for RollingFile in Appenders.
main ERROR Unable to locate appender "plain_rolling" for logger config "root"
`

These are my permission settings:
drwxrwxr-x 10 logstash logstash 4096 Mar 9 17:33 /usr/share/logstash
drwxrwxr-x 3 root root 4096 Mar 9 17:38 /etc/logstash
drwxrwxr-x 2 logstash logstash 4096 Feb 16 15:54 logstash

From the error, it is attempting to create the file /var/log/logstash/logstash-plain.log; what are your permissions for /var/log/logstash/, and what user is Logstash running as?

They are:
drwxrwxr-x 2 root root 4096 Feb 16 15:54 logstash

You don't have permission to write to that directory.

It is owned by root and assigned to group root; the permissions, with spaces and headers added for clarity, are:

type | user | group | other
d    | rwx  | rwx   | r-x
  • Since the owner is root, the fact that the owner has read, write, and execute doesn't help the logstash user
  • since the assigned group is root, and the logstash user isn't in the root group, the group being assigned read, write, and execute doesn't help either.
  • this means the logstash user fits into the "other" category, which only has read and execute permissions.

Most likely, you will want to change ownership of this directory to logstash with chown:

chown --recursive logstash /var/log/logstash

The above command may require sudo, since your user is also not likely in the root group (and shouldn't be).

O I C. Thank you.

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