Bug 1782112

Summary: `crictl stats` doesn't show anything
Product: OpenShift Container Platform Reporter: Shivkumar Ople <sople>
Component: NodeAssignee: Ryan Phillips <rphillips>
Status: CLOSED NOTABUG QA Contact: Sunil Choudhary <schoudha>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.1.zCC: aos-bugs, dwalsh, jokerman, mpatel, nagrawal, pehunt, tsweeney, vincent.lours
Target Milestone: ---   
Target Release: 4.4.0   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1782999 1784067 (view as bug list) Environment:
Last Closed: 2019-12-16 15:56:12 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:
Bug Depends On:    
Bug Blocks: 1782999, 1784067    

Description Shivkumar Ople 2019-12-11 08:02:48 UTC
Description of problem:

Update to Openshift 4.1.23, the command 'crictl stats' does not return any result.
Before the update (from version 4.1.11) the command was working fine and allow us to check stats on our containers


SSH'd to a node.  Ran `crictl stats`. Expected to see a list of container stats for the running containers. Got an empty list.  Passed `--pod ID`. Got nothing.


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

OpenShift 4.1.23

=========== List of installed package and versions ===========
# rpm -qa | grep -E "cri-o|runc"
runc-1.0.0-61.rc8.rhaos4.1.git3cbe540.el8.x86_64
cri-o-1.13.11-0.14.dev.rhaos4.1.git3338d4d.el8.x86_64
# crictl version
Version:  0.1.0
RuntimeName:  cri-o
RuntimeVersion:  1.13.11-0.14.dev.rhaos4.1.git3338d4d.el8-dev
RuntimeApiVersion:  v1alpha1

How reproducible:

Always

=========== worker-1 as core  - Missing Container stats ===========
[core@worker-1 ~]$ sudo crictl ps | grep oxidized
c0ade5a9f056f       registry/oxidized/oxidized@sha256:192525b02cd34c94f6c25a461b205c14c14668072edf7a255bafcdacff6772dc             7 hours ago         Running             cron-oxidized           0                   f527981ff3bfc
[core@worker-1 ~]$ sudo crictl stats --id c0ade5a9f056f
CONTAINER           CPU %               MEM                 DISK                INODES
[core@worker-1 ~]$ sudo crictl -D stats --id c0ade5a9f056f
DEBU[0000] ListContainerStatsRequest: &ListContainerStatsRequest{Filter:&ContainerStatsFilter{Id:c0ade5a9f056f,PodSandboxId:,LabelSelector:map[string]string{},},}
DEBU[0000] ListContainerResponse: &ListContainerStatsResponse{Stats:[],}
DEBU[0001] ListContainerStatsRequest: &ListContainerStatsRequest{Filter:&ContainerStatsFilter{Id:c0ade5a9f056f,PodSandboxId:,LabelSelector:map[string]string{},},}
DEBU[0001] ListContainerResponse: &ListContainerStatsResponse{Stats:[],}
CONTAINER           CPU %               MEM                 DISK                INODES

=========== master-0 as core  - Missing containers stats ===========
[core@master-0 ~]$ sudo crictl stats -a
CONTAINER           CPU %               MEM                 DISK                INODES
[core@master-0 ~]$ sudo crictl -D stats -a
DEBU[0000] ListContainerStatsRequest: &ListContainerStatsRequest{Filter:&ContainerStatsFilter{Id:,PodSandboxId:,LabelSelector:map[string]string{},},}
DEBU[0000] ListContainerResponse: &ListContainerStatsResponse{Stats:[],}
DEBU[0001] ListContainerStatsRequest: &ListContainerStatsRequest{Filter:&ContainerStatsFilter{Id:,PodSandboxId:,LabelSelector:map[string]string{},},}
DEBU[0001] ListContainerResponse: &ListContainerStatsResponse{Stats:[],}
CONTAINER           CPU %               MEM                 DISK                INODES



Actual results:
Stats are empty

Expected results:
Stats should get printed

Additional info:

Similar Bugzilla closed but not working in the above case.: https://bugzilla.redhat.com/show_bug.cgi?id=1666358