Bug 1733412

Summary: Can't view rsyslog pod logs by `oc exec -c rsyslog $rsyslog-pod -- logs` when set `LOGGING_FILE_PATH` to file
Product: OpenShift Container Platform Reporter: Qiaoling Tang <qitang>
Component: LoggingAssignee: Noriko Hosoi <nhosoi>
Status: CLOSED ERRATA QA Contact: Qiaoling Tang <qitang>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.2.0CC: aos-bugs, rmeggins
Target Milestone: ---Keywords: Regression
Target Release: 4.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-16 06:33:49 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 Qiaoling Tang 2019-07-26 03:34:48 UTC
Description of problem:
Deploy logging, set log collector to rsyslog, then wait until rsyslog pod start, check pod logs by `oc exec $rsyslog-pod -- logs`, no logs show, but check the log file in rsyslog pod, there has some lines in it.

$ oc exec rsyslog-cpznd env |grep LOGGING_FILE_PATH
Defaulting container name to rsyslog.
Use 'oc describe pod/rsyslog-cpznd -n openshift-logging' to see all of the containers in this pod.
$ oc exec rsyslog-cpznd -- logs
Defaulting container name to rsyslog.
Use 'oc describe pod/rsyslog-cpznd -n openshift-logging' to see all of the containers in this pod.
$ oc exec rsyslog-cpznd -- ls /var/log/rsyslog/ -l
Defaulting container name to rsyslog.
Use 'oc describe pod/rsyslog-cpznd -n openshift-logging' to see all of the containers in this pod.
total 8
-rw-r--r--. 1 root root 5544 Jul 26 02:53 rsyslog.log

same phenomenon when set LOGGING_FILE_PATH=/another/dir

Version-Release number of selected component (if applicable):
ose-logging-rsyslog-v4.2.0-201907251819


How reproducible:
Always

Steps to Reproduce:
1. Deploy logging using rsyslog as log collector
2. check rsyslog pod logs by `oc exec $rsyslog-pod -- logs`
3.

Actual results:
can't view rsyslog pod logs by executing `oc exec $rsyslog -- logs` when set `LOGGING_FILE_PATH` to file

Expected results:
should be able to view rsyslog pod logs by executing `oc exec $rsyslog -- logs` when set `LOGGING_FILE_PATH` to file


Additional info:
When use `oc exec $rsyslog-pod -- logs -f`, I'm able to view the rsyslog pod logs.

$ oc exec rsyslog-cpznd -- logs -f
Defaulting container name to rsyslog.
Use 'oc describe pod/rsyslog-cpznd -n openshift-logging' to see all of the containers in this pod.
{"@timestamp":"2019-07-26T02:14:51.174860+00:00", "host":"rsyslog-4c5pp", "level":"warning", "facility":"syslog", "syslog-tag":"rsyslogd-2007:", "source":"rsyslogd-2007", "procid":"-", "msgid":"-", "message":"omelasticsearch: checkConn failed after 1 attempts. [v8.37.0-9.el7 try http:\/\/www.rsyslog.com\/e\/2007 ]"}
{"@timestamp":"2019-07-26T02:15:21.247592+00:00", "host":"rsyslog-4c5pp", "level":"info", "facility":"syslog", "syslog-tag":"rsyslogd-2359:", "source":"rsyslogd-2359", "procid":"-", "msgid":"-", "message":"action 'elasticsearch' resumed (module 'omelasticsearch') [v8.37.0-9.el7 try http:\/\/www.rsyslog.com\/e\/2359 ]"}
{"@timestamp":"2019-07-26T02:24:42.595751+00:00", "host":"rsyslog-4c5pp", "level":"info", "facility":"syslog", "syslog-tag":"rsyslogd:", "source":"rsyslogd", "procid":"-", "msgid":"-", "message":" [origin software=\"rsyslogd\" swVersion=\"8.37.0-9.el7\" x-pid=\"13\" x-info=\"http:\/\/www.rsyslog.com\"] exiting on signal 15."}
INFO: Disabling Prometheus endpoint
{"@timestamp":"2019-07-26T02:36:03.403188+00:00", "host":"rsyslog-cjwbv", "level":"warning", "facility":"syslog", "syslog-tag":"rsyslogd-2442:", "source":"rsyslogd-2442", "procid":"-", "msgid":"-", "message":"environment variable TZ is not set, auto correcting this to TZ=\/etc\/localtime  [v8.37.0-9.el7 try http:\/\/www.rsyslog.com\/e\/2442 ]"}
{"@timestamp":"2019-07-26T02:36:03.415159+00:00", "host":"rsyslog-cjwbv", "level":"info", "facility":"syslog", "syslog-tag":"rsyslogd:", "source":"rsyslogd", "procid":"-", "msgid":"-", "message":" [origin software=\"rsyslogd\" swVersion=\"8.37.0-9.el7\" x-pid=\"12\" x-info=\"http:\/\/www.rsyslog.com\"] start"}
{"@timestamp":"2019-07-26T02:53:50.072728+00:00", "host":"rsyslog-cjwbv", "level":"info", "facility":"syslog", "syslog-tag":"rsyslogd:", "source":"rsyslogd", "procid":"-", "msgid":"-", "message":" [origin software=\"rsyslogd\" swVersion=\"8.37.0-9.el7\" x-pid=\"12\" x-info=\"http:\/\/www.rsyslog.com\"] exiting on signal 15."}
INFO: Disabling Prometheus endpoint
{"@timestamp":"2019-07-26T02:53:55.068168+00:00", "host":"rsyslog-cpznd", "level":"warning", "facility":"syslog", "syslog-tag":"rsyslogd-2442:", "source":"rsyslogd-2442", "procid":"-", "msgid":"-", "message":"environment variable TZ is not set, auto correcting this to TZ=\/etc\/localtime  [v8.37.0-9.el7 try http:\/\/www.rsyslog.com\/e\/2442 ]"}
{"@timestamp":"2019-07-26T02:53:55.080558+00:00", "host":"rsyslog-cpznd", "level":"info", "facility":"syslog", "syslog-tag":"rsyslogd:", "source":"rsyslogd", "procid":"-", "msgid":"-", "message":" [origin software=\"rsyslogd\" swVersion=\"8.37.0-9.el7\" x-pid=\"14\" x-info=\"http:\/\/www.rsyslog.com\"] start"}


Thought this may be a regression of https://bugzilla.redhat.com/show_bug.cgi?id=1733011

Comment 1 Noriko Hosoi 2019-07-31 18:02:26 UTC
> Thought this may be a regression of https://bugzilla.redhat.com/show_bug.cgi?id=1733011

At this moment, this PR [1] has not been merged yet.  Once it's merged, it fixes some issues described in #c0, but not all.  For instance, if you set LOGGING_FILE_PATH=/tmp/my_rsyslog.log (please note that LOGGING_FILE_PATH is a full path including the file name.), then it does not work even with [1] merged.  I'm going to fix that part in this bug.


[1] - https://github.com/openshift/origin-aggregated-logging/pull/1710

Comment 3 Qiaoling Tang 2019-08-02 06:55:26 UTC
Verified with ose-logging-rsyslog-v4.2.0-201908011419

Comment 4 errata-xmlrpc 2019-10-16 06:33:49 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://access.redhat.com/errata/RHBA-2019:2922