Bug 1222953 - Logshifter configuration parsing stops at a new line
Summary: Logshifter configuration parsing stops at a new line
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Logging
Version: 2.2.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Timothy Williams
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-19 13:35 UTC by Timothy Williams
Modified: 2018-07-19 07:01 UTC (History)
6 users (show)

Fixed In Version: openshift-origin-logshifter-1.9.1.1-1
Doc Type: Bug Fix
Doc Text:
If a blank line was inserted between options in the logshifter configuration file, any options after the first blank line were not parsed. This bug fix updates logshifter to allow for blank lines when reading configuration, and as a result configuration is parsed when blank lines are present.
Clone Of:
Environment:
Last Closed: 2015-07-21 19:12:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1463 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.2.6 bug fix and enhancement update 2015-07-21 23:11:33 UTC

Description Timothy Williams 2015-05-19 13:35:21 UTC
Description of problem:
If the logshifter configuration file contains any blank lines "\n" between configuration directives, the directives after the first blank line will be skipped.

Version-Release number of selected component (if applicable):
-

How reproducible:
Always

Steps to Reproduce:
1. On an OpenShift node, insert a blank line between the first and second directive in /etc/openshift/logshifter.conf

2. Set the outputType directive to the non-default value 'syslog'
     outputType=syslog

3. Restart all existing gears or create a new one:
     # oo-admin-ctl-gears restartall

Actual results:
Gear logs are sent to files in ~/app-root/logs since outputType is undefined and defaults to 'file'

Expected results:
Gear logs are sent to syslog, as configured.

Additional info:

Comment 1 Timothy Williams 2015-05-19 13:35:57 UTC
https://github.com/openshift/origin-server/pull/6138

Comment 2 Anping Li 2015-05-21 05:19:48 UTC
Verified and pass in ose-2.2 puddle 2015-05-18.1

1) Enable syslog for gears and node during installation
2) add blank lines "\n" between configuration directives.

3) create app and Restart all gears
[root@node1 ~]# oo-admin-ctl-gears restartall
Stopping gear 555d67544add71f05e000006 ... [ OK ]
Starting gear 555d67544add71f05e000006 ... [ OK ]
Stopping gear 555d67544add71f05e000005 ... [ OK ]
Starting gear 555d67544add71f05e000005 ... [ OK ]

3) check the ~/app-root/logs, there isn't log file
[root@broker ~]# rhc ssh sphp "ls ~/app-root/logs"

4) check the /var/log/message, the operation are recorded.
May 21 13:10:13 node1 openshift-platform[23844]: (23844) Stopping gear 555d67544add71f05e000006 ... [ OK ]
May 21 13:10:13 node1 openshift-platform[23844]: (23844) Stopping gear 555d67544add71f05e000006 ... [ OK ]
May 21 13:10:34 node1 openshift-platform[23844]: (23844) Starting gear 555d67544add71f05e000006 ... [ OK ]
May 21 13:10:34 node1 openshift-platform[23844]: (23844) Starting gear  OK ]

Comment 6 Anping Li 2015-05-22 09:50:20 UTC
I can recreated the problem. However during recreate this bug, I found if outputType is not defined, the default values is syslog, which is different with the origin steps.  So I use outputType = multi to verify this bug.

With following step, without the fix, the logs only written to openshift_gears; in puddle-2-2-2015-05-21, The logs are written to both app-root/logs/php.log and /var/lib/openshift_gears. so move this bug to verified.

My steps is as below:
1)  set CONF_SYSLOG="gears" in openshift.sh and install node
2)  create php applications
3)  insert blank line in logshifter.conf
root@node2 ~]# cat /etc/openshift/logshifter.conf  
queuesize = 1000

inputbuffersize = 4096
outputType = multi
syslogbuffersize = 4096
filebuffersize = 4096
outputTypeFromEnviron = true
filewriterdir = ~/app-root/logs
4). restart ruby193-mcollective and gears.
5). tailf /var/log/openshift_gears, and tailf /var/livb

Comment 8 errata-xmlrpc 2015-07-21 19:12:46 UTC
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/RHBA-2015-1463.html


Note You need to log in before you can comment on or make changes to this bug.