Unable to get stats from dockerd `proto: wrong wireType = 0 for field Hugetlb`
- [x] This is a bug report
- [ ] This is a feature request
- [x] I searched existing issues before opening this one
Expected behavior
dockerd should correctly report statistics
Actual behavior
dockerd produces an error in the journal file when trying to get stats:
Jul 29 21:24:16 base dockerd[49090]: time="2021-07-29T21:24:16.314136664Z" level=error msg="collecting stats for c59f98b3d75d19b675181c313f19e273c5a0eb2208b29d8ff48134641d16e66f: proto: wrong wireType = 0 for field Hugetlb"
Jul 29 21:24:16 base dockerd[49090]: time="2021-07-29T21:24:16.314881994Z" level=error msg="collecting stats for eada12610f6bd8ad54dfed435f7325bbe3cf880b5281948dc7c42c7bd2606663: proto: wrong wireType = 0 for field Hugetlb"
Jul 29 21:24:17 base dockerd[49090]: time="2021-07-29T21:24:17.316046555Z" level=error msg="collecting stats for 7d70c6bb429fe3d0e4094861bbc935eae7a8d5d9b998d6ad08b113f336bb4d5e: proto: wrong wireType = 0 for field Hugetlb"
Jul 29 21:24:17 base dockerd[49090]: time="2021-07-29T21:24:17.316909492Z" level=error msg="collecting stats for c59f98b3d75d19b675181c313f19e273c5a0eb2208b29d8ff48134641d16e66f: proto: wrong wireType = 0 for field Hugetlb"
Jul 29 21:24:17 base dockerd[49090]: time="2021-07-29T21:24:17.317838258Z" level=error msg="collecting stats for eada12610f6bd8ad54dfed435f7325bbe3cf880b5281948dc7c42c7bd2606663: proto: wrong wireType = 0 for field Hugetlb"
Steps to reproduce the behavior
docker stats --no-stream
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
c59f98b3d75d 94a6eb42-203b-46b7-abd2-29974a87dd5b 0.00% 0B / 0B 0.00% 0B / 0B 0B / 0B 0
eada12610f6b f9bcc583-73ea-4b93-91b1-f7b872c9f1df 0.00% 0B / 0B 0.00% 0B / 0B 0B / 0B 0
7d70c6bb429f 98b0f070-420d-4ae5-bcfa-56419cb51dc9 0.00% 0B / 0B 0.00% 0B / 0B 0B / 0B 0
d0316d408b20 REDACTED 17.94% 3.62GiB / 62.78GiB 5.77% 382kB / 2.22MB 950kB / 15.6MB 460
c1820f9bacfb REDACTED 0.00% 11.67MiB / 62.78GiB 0.02% 3.77MB / 2.62MB 0B / 0B 6
b44f033e5e44 REDACTED 0.45% 202.4MiB / 62.78GiB 0.31% 285kB / 77.7kB 479kB / 27MB 18
Output of docker version:
docker version
Client:
Version: 20.10.2
API version: 1.41
Go version: go1.13.8
Git commit: 20.10.2-0ubuntu1~20.04.3
Built: Fri Jul 23 21:06:26 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server:
Engine:
Version: 20.10.2
API version: 1.41 (minimum version 1.12)
Go version: go1.13.8
Git commit: 20.10.2-0ubuntu1~20.04.3
Built: Fri Jul 23 19:35:35 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.5.2-0ubuntu1~20.04.2
GitCommit:
runc:
Version: 1.0.0~rc95-0ubuntu1~20.04.2
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
Output of docker info:
Client:
Context: default
Debug Mode: false
Server:
Containers: 56
Running: 19
Paused: 0
Stopped: 37
Images: 850
Server Version: 20.10.2
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: docker-init
containerd version:
runc version:
init version:
Security Options:
apparmor
seccomp
Profile: default
cgroupns
Kernel Version: 5.4.0-80-generic
Operating System: Ubuntu 20.04.2 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 62.78GiB
Name: base
ID: REDACTED
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
This is a physical machine
The only difference I can see between continers that have stats, and those that don't is:
Working
"Cgroup": "",
"CgroupnsMode": "",
"CgroupParent": "",
Not working
"Cgroup": "",
"CgroupnsMode": "host",
"CgroupParent": "",
Not working
"Cgroup": "",
"CgroupnsMode": "private",
"CgroupParent": "",
All new, recently created containers have this new "CgroupnsMode": "host/private" entry.
All my older containers without this have stats
From the output of docker info and docker version, I suspect you're running a version of docker that was packaged and built by your distro.
I know some distros build docker with incompatible build-time dependencies (go modules); in this case it may cs that it's built with a version of grpc that's not compatible.
Are you seeing the same problem when installing the official packages? https://docs.docker.com/engine/install/ubuntu/
If you can't install those, I recommend opening a support ticket with your distro to report this issue.
This appears fixed with the latest version of containerd, docker and docker-cli when using runc 1.0.3 thanks to opencontainers/runc#3295
After switching to the official Docker distribution from Ubuntu:
deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu focal stable
I'm no longer seeing this issue, however, I can also no longer confirm if the mentioned PR resolves the issue. It seemed a number of people 👍🏻 'd the this issue, maybe they can confirm?