Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1883489

Summary: openshift-apiserver: Logging is broken due to mix of k8s.io/klog v1 and v2
Product: OpenShift Container Platform Reporter: Stefan Schimanski <sttts>
Component: openshift-apiserverAssignee: Stefan Schimanski <sttts>
Status: CLOSED ERRATA QA Contact: Xingxing Xia <xxia>
Severity: high Docs Contact:
Priority: high    
Version: 4.6CC: aos-bugs, jhadvig, jokerman, kewang, mfojtik, yapei
Target Milestone: ---   
Target Release: 4.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1883461 Environment:
Last Closed: 2020-10-27 16:46:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stefan Schimanski 2020-09-29 11:22:20 UTC
+++ This bug was initially created as a clone of Bug #1883461 +++

k8s.io/klog moved to v2 in client-go and frieds. The operator does not use v2 yet and hence, we lose one half of the logging output (v2).

--- Additional comment from Stefan Schimanski on 2020-09-29 13:09:06 CEST ---

I did some tests using openshift-apiserver that uses kube component-base to add klog command line flags:

$ ./openshift-apiserver start --config asfd --v=4
I0929 13:04:18.354425   53628 cmd.go:57] v1 klog
I0929 13:04:18.354506   53628 cmd.go:58] v2 klog
I0929 13:04:18.354512   53628 cmd.go:61] v2 V(2) klog
I0929 13:04:18.354515   53628 cmd.go:64] v2 V(4) klog

So this means that we DO NOT set verbosity for v1 klog, and hence lose all the klogv1.V(2).Infof output.

Comment 3 Ke Wang 2020-10-15 05:07:13 UTC
$ oc get clusterversion
NAME      VERSION      AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.6.0-rc.4   True        False         159m    Cluster version is 4.6.0-rc.4

$ oc rsh -n openshift-apiserver apiserver-7778f8746b-pwzj4
Defaulting container name to openshift-apiserver.
Use 'oc describe pod/apiserver-7778f8746b-pwzj4 -n openshift-apiserver' to see all of the containers in this pod.

sh-4.4# openshift-apiserver start --config asfd --v=4
F1015 03:43:51.700701      23 cmd.go:72] open asfd: no such file or directory
goroutine 1 [running]:
k8s.io/klog/v2.stacks(0xc000132001, 0xc0002ec160, 0x4e, 0xa4)
	k8s.io/klog/v2.0/klog.go:996 +0xb9
k8s.io/klog/v2.(*loggingT).output(0x47c4f20, 0xc000000003, 0x0, 0x0, 0xc000c05f10, 0x46b012f, 0x6, 0x48, 0x1957c00)
	k8s.io/klog/v2.0/klog.go:945 +0x191
k8s.io/klog/v2.(*loggingT).printDepth(0x47c4f20, 0xc000000003, 0x0, 0x0, 0x1, 0xc000f9fb90, 0x1, 0x1)
	k8s.io/klog/v2.0/klog.go:718 +0x165
k8s.io/klog/v2.(*loggingT).print(...)
	k8s.io/klog/v2.0/klog.go:703
k8s.io/klog/v2.Fatal(...)
	k8s.io/klog/v2.0/klog.go:1443
...

klog/v2 is in used in the log,moving bug VERIFIED.

Comment 5 errata-xmlrpc 2020-10-27 16:46:19 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 (OpenShift Container Platform 4.6 GA Images), 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-2020:4196