metrics-server: metrics-server is restarting : failed to extract container metrics: proto: wrong wireType = 0 for field CPU
What happened:
I use AKS with 1.20
What you expected to happen:
metrics-server is restarting in a loop.
unable to fully collect metrics: unable to fully scrape metrics from source kubelet_summary: xxxxxxxxxxxxxxxxx: unable to fetch metrics from Kubelet xxxxxxxxxxxxxxxxx000000 (x.y.z.a): request failed - “500 Internal Server Error”, response: “Internal Error: failed to list pod stats: failed to list all container stats: rpc error: code = Unknown desc = failed to convert to cri containerd stats format: failed to decode container metrics for "d07f5d1038b47236dd6247505db6ba01b61f966a190655751b68746c37c56365": failed to extract container metrics: proto: wrong wireType = 0 for field CPU”
Anything else we need to know?:
I have many clusters (same configuration with terraform) with the same error message and the same issue. metrics server is restarting.
Environment:
- Kubernetes distribution : AKS 1.20.5 (same issue with 1.19)
- Container Network Setup (calico): (same issue with standard azure network)
- Kubernetes version (use
kubectl version
):
Client Version: version.Info{Major:“1”, Minor:“21”, GitVersion:“v1.21.0”, GitCommit:“cb303e613a121a29364f75cc67d3d580833a7479”, GitTreeState:“clean”, BuildDate:“2021-04-08T16:31:21Z”, GoVersion:“go1.16.1”, Compiler:“gc”, Platform:“linux/amd64”} Server Version: version.Info{Major:“1”, Minor:“20”, GitVersion:“v1.20.5”, GitCommit:“54684493f8139456e5d2f963b23cb5003c4d8055”, GitTreeState:“clean”, BuildDate:“2021-03-22T23:02:59Z”, GoVersion:“go1.15.8”, Compiler:“gc”, Platform:“linux/amd64”}
I’m surprising that metrics-server is restarting when it fails to read metrics from a pod.
How to find the ID of this “bugged” pod from this log : failed to decode container metrics for "d07f5d1038b47236dd6247505db6ba01b61f966a190655751b68746c37c56365": failed to extract container metrics: proto: wrong wireType = 0 for field CPU"
regards
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 15 (4 by maintainers)
We are experiencing similar issues. Once the issue starts happening on a node it continues until the metrics-server is restarted and then it is hit and miss as to whether the issue jumps to another node. The consistent but of the error message no matter which node the error happens on is “failed to extract container metrics: proto: wrong wireType = 0 for field CPU”
We are running AKS with kubernetes version 1.19.9 and this happens on both windows and linux nodes.
I got similar case but seems not in restarting loops.
stern -n kube-system --tail=50 metrics
Similar messages above are shown periodically.
Environment