Skip to content

kubelet fails to start due to cgroups CPU stat parsing failed in k8s 1.34 #46

@vimiix

Description

@vimiix

Description:

After upgrading to Kubernetes 1.34, kubelet fails to start on certain operating systems.

The following errors appear in the kubelet log:

"Failed to start ContainerManager" err="failed to get rootfs info: unable to find data in memory cache"
...
Failed to update stats for container "/": unable to parse /sys/fs/cgroup/cpu,cpuacct/cpuacct.usage_all: strconv.ParseUint: parsing "455873998 0 0": invalid syntax, continuing to push stats

By code analysis, I found the problem is in the getPercpuUsageInModes function when parsing cpuacct.usage_all data.

Problem:

The CPU stat parsing logic was changed in commit cf1a33a, where the new implementation expects only 3 fields per line, but some operating systems provide 5 fields in the format, such as:

Image

@kolyshkin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions