Bug 1264039
Summary: | logshifter does not parse config properly if there's no newline at the end | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | Evgheni Dereveanchin <ederevea> |
Component: | Logging | Assignee: | Timothy Williams <tiwillia> |
Status: | CLOSED ERRATA | QA Contact: | chunchen <chunchen> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 2.2.0 | CC: | adellape, aos-bugs, gpei, pep, tiwillia, wsun |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | openshift-origin-logshifter-1.10.1.2-1 | Doc Type: | Bug Fix |
Doc Text: |
When reading configuration files, logshifter previously read each line using a newline as the separator. When no newline character or EOL character existed at the end of a configuration file whose last line was not empty, the last line of the configuration would be ignored. This bug fix updates logshifter to catch an EOF and ensure that if the EOF is on a non-empty line, the line is read into the configuration. As a result, all lines in the logshifter configuration file are read, whether they end with a newline or EOL character or not.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2015-09-30 16:38:43 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Evgheni Dereveanchin
2015-09-17 11:32:45 UTC
The fix was shipped in openshift-origin-logshifter-1.9.1.1-1.el6op with openshift enterprise 2.2.6: https://rhn.redhat.com/errata/RHBA-2015-1463.html Even with the aforementioned fix, it is possible for the last line of the configuration file not to be included if the file does not end with a EOL or '\n'. For QA: (In reply to Timothy Williams from comment #3) > Even with the aforementioned fix, it is possible for the last line of the > configuration file not to be included if the file does not end with a EOL or > '\n'. Just to clarify the reproducing steps accordingly: (in reply to Evgheni Dereveanchin from comment #0) > Steps to Reproduce: > 1. open /etc/openshift/logshifter.conf on a node and remove the last empty > line The problem actually happens when the last line in the file is not empty but doesn't end with a newline. The default /etc/openshift/logshifter.conf is set for outputtype=file and its last line specifies the log file dir (filewriterdir), so you should be able to reproduce this on a fresh install with: # perl -i.bak -p0e 's/\s*$//' /etc/openshift/logshifter.conf Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/d51d2e03c2c6fd0e93d9c2e6ffe65bb4af720be9 Bug 1264039: Read all lines even if file does not end in '\n' or EOL https://bugzilla.redhat.com/show_bug.cgi?id=1264039 Ensure that all lines of a configuration file are read even if the file does not end in a newline character or EOL. Verify this bug with openshift-origin-logshifter-1.10.1.2-1.el6op.x86_64. Remove the whitespace character of logshifter.conf by # perl -i.bak -p0e 's/\s*$//' /etc/openshift/logshifter.conf Start logshifter: [root@node2 yum.repos.d]# /usr/bin/logshifter -verbose -tag ruby config: &{queueSize:1000 inputBufferSize:4096 outputType:file syslogBufferSize:4096 fileBufferSize:4096 fileWriterDir:~/app-root/logs outputTypeFromEnviron:false} using max file size 10485760 and max files 10 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2015-1844.html |