Closed micoq closed 5 years ago
This issue still exists in LS 7.0.1 (on Debian 9)
In the logs you will see many: org.jruby.exceptions.SystemCallError: (EACCES) Permission denied
Once saw how messed up the file/dir permissions were, I guessed that octal was not being processed properly and manually made the conversion to decimal:
file {
path => "..../file.log.gz"
dir_mode => 488
file_mode => 424
gzip => true
codec => json_lines { }
}
The bug is more egregious due to the documentation using octal values in the given examples and there being no explicit mention of decimal or octal: https://www.elastic.co/guide/en/logstash/current/plugins-outputs-file.html
It is far more usual/common to give unix permission in octal rather than decimal.
At the very minimum the documentation needs correcting, if not the plugin/config parser.
-T
I wonder if this occurred when we switched to using the Java config parsing from the Ruby based parsing?
I looked into this.
I tested LS 5.6.10 and 7.0.0, it seems as if the Java execution when parsing the config fails to take the leading 0
into account.
In 5.6.10, 0640 is parsed as as the decimal number 416 but in 7.0.0 it is parsed as 640 in decimal - clearly wrong.
I will create a bug report on the main Logstash repo as this is not related to the file output plugin and the bug report was missed by the LS core folks.
Closing. LS bug report created. https://github.com/elastic/logstash/issues/10826
The values of
dir_mode
or thefile_mode
are always interpreted as decimal number regardless of the leading zero in the configuration.For, example, with this configuration:
Logstash will create directories with permissions set to
chmod 1356
and files with permissions set tochmod 1200
Logstash version: 6.4.2 OS: RHEL7