Changes introduced in #1489 (or, more specifically, this line) causes the cAdvisor Docker image to trip up because Alpine/BusyBox find does not implement -printf:
find: unrecognized: -printf
BusyBox v1.24.2 (2016-08-12 14:38:34 GMT) multi-call binary.
Possible fixes include installing GNU findutils (adding about 558k to the base Alpine image), or counting based on lines (supposedly slower).
Closed via #1558. Anyone experiencing this problem can update to v0.25.0
Hmm, what am I missing? I am seeing a similar error on CentOS 7.3 with Docker 1.11.2 using CAdvisor v0.25.0 still.
sudo docker run --privileged=true --volume=/cgroup:/cgroup:ro --volume=/:/rootfs:ro --volume=/var/run:/var/run:rw --volume=/sys:/sys:ro --volume=/var/lib/docker/:/var/lib/docker:ro --publish=8725:8080 --detach=true --name=cadvisor google/cadvisor:v0.25.0 -storage_driver_db=influxdb -storage_driver_host=$INFLUX_HOST_NAME:8086
Docker log for CAdvisor shows:
I0331 21:28:20.635127 1 storagedriver.go:50] Caching stats in memory for 2m0s
I0331 21:28:20.635248 1 manager.go:143] cAdvisor running in container: "/docker/62aa88c1fba84452bc9fa677910b9d167e9fc2987014db6f6a50c1682defd161"
W0331 21:28:20.639549 1 manager.go:151] unable to connect to Rkt api service: rkt: cannot tcp Dial rkt api service: dial tcp [::1]:15441: getsockopt: connection refused
I0331 21:28:20.645359 1 fs.go:117] Filesystem partitions: map[/dev/xvda1:{mountpoint:/var/lib/docker major:202 minor:1 fsType:xfs blockSize:0}]
I0331 21:28:20.648092 1 manager.go:198] Machine: {NumCores:8 CpuFrequency:2299950 MemoryCapacity:33299312640 MachineID:f32e0af35637b5dfcbedcb0a1de8dca1 SystemUUID:EC219D7B-858E-9D29-B49E-5B3626BCC467 BootID:3bd0d947-256a-470c-83b6-62ce13a66093 Filesystems:[{Device:/dev/xvda1 Capacity:536852488192 Type:vfs Inodes:524280240 HasInodes:true} {Device:overlay Capacity:536852488192 Type:vfs Inodes:524280240 HasInodes:true}] DiskMap:map[202:0:{Name:xvda Major:202 Minor:0 Size:536870912000 Scheduler:deadline}] NetworkDevices:[{Name:eth0 MacAddress:0a:15:73:57:9f:c2 Speed:0 Mtu:9001}] Topology:[{Id:0 Memory:34359332864 Cores:[{Id:0 Threads:[0 4] Caches:[{Size:32768 Type:Data Level:1} {Size:32768 Type:Instruction Level:1} {Size:262144 Type:Unified Level:2}]} {Id:1 Threads:[1 5] Caches:[{Size:32768 Type:Data Level:1} {Size:32768 Type:Instruction Level:1} {Size:262144 Type:Unified Level:2}]} {Id:2 Threads:[2 6] Caches:[{Size:32768 Type:Data Level:1} {Size:32768 Type:Instruction Level:1} {Size:262144 Type:Unified Level:2}]} {Id:3 Threads:[3 7] Caches:[{Size:32768 Type:Data Level:1} {Size:32768 Type:Instruction Level:1} {Size:262144 Type:Unified Level:2}]}] Caches:[{Size:47185920 Type:Unified Level:3}]}] CloudProvider:AWS InstanceType:m4.2xlarge InstanceID:i-0bab1058339a31fd7}
I0331 21:28:20.648470 1 manager.go:204] Version: {KernelVersion:3.10.0-514.10.2.el7.x86_64 ContainerOsVersion:Alpine Linux v3.4 DockerVersion:1.11.2 CadvisorVersion:v0.25.0 CadvisorRevision:17543be}
I0331 21:28:20.652067 1 factory.go:309] Registering Docker factory
W0331 21:28:20.652088 1 manager.go:247] Registration of the rkt container factory failed: unable to communicate with Rkt api service: rkt: cannot tcp Dial rkt api service: dial tcp [::1]:15441: getsockopt: connection refused
I0331 21:28:20.652094 1 factory.go:54] Registering systemd factory
I0331 21:28:20.652771 1 factory.go:86] Registering Raw factory
I0331 21:28:20.653430 1 manager.go:1106] Started watching for new ooms in manager
W0331 21:28:20.653541 1 manager.go:275] Could not configure a source for OOM detection, disabling OOM events: unable to find any kernel log file available from our set: [/var/log/kern.log /var/log/messages /var/log/syslog]
I0331 21:28:20.654947 1 manager.go:288] Starting recovery of all containers
I0331 21:28:20.723176 1 manager.go:293] Recovery completed
I0331 21:28:20.802634 1 cadvisor.go:157] Starting cAdvisor version: v0.25.0-17543be on port 8080
E0331 21:29:20.798291 1 fsHandler.go:121] failed to collect filesystem stats - rootDiskErr: du command failed on /rootfs/var/lib/docker/overlay/51e6d23bd552aaa84596811a5498da34464777d8d7f601338bae032c1bf83b21 with output stdout: 57120 /rootfs/var/lib/docker/overlay/51e6d23bd552aaa84596811a5498da34464777d8d7f601338bae032c1bf83b21
, stderr: du: /rootfs/var/lib/docker/overlay/51e6d23bd552aaa84596811a5498da34464777d8d7f601338bae032c1bf83b21/merged/proc/35/task/35/fdinfo/10: No such file or directory
- exit status 1, rootInodeErr: cmd [find /rootfs/var/lib/docker/overlay/51e6d23bd552aaa84596811a5498da34464777d8d7f601338bae032c1bf83b21 -xdev -printf .] failed. stderr: find: unrecognized: -printf
BusyBox v1.24.2 (2017-01-18 14:13:46 GMT) multi-call binary.
Usage: find [-HL] [PATH]... [OPTIONS] [ACTIONS]
Search for files and perform actions on them.
First failed action stops processing of current file.
Defaults: PATH is current directory, action is '-print'
Also tried, with google/cadvisor:latest. Same error, with no data error arriving in InfluxDB. Any tips would be most appreciated!
My bad, it looks like this issue was separate from the one solved in #1558.
@timstclair should we add GNUfind utils as a dependency?
I think that's a reasonable fix until we get https://github.com/google/cadvisor/pull/1576 in
I'm experiencing the same problem with 0.25.0
I'm having the same problem with v0.25.0-17543be
I have the same problem, It seems th problem is in the find version ( not gnu find) in the busybox , there is plans to fix the current official cAdvisor docker image?
cadvisor_1 | ; err: exit status 1, extraDiskErr: <nil>
cadvisor_1 | I0419 21:18:27.544592 1 fs.go:487] killing cmd [find /rootfs/var/lib/docker/aufs/diff/75ace77bc15b09760d644a587c414e4272fce7759381001781e905c63d59eefb -xdev -printf .] due to timeout(2m0s)
cadvisor_1 | E0419 21:25:58.730259 1 fsHandler.go:121] failed to collect filesystem stats - rootDiskErr: <nil>, rootInodeErr: cmd [find /rootfs/var/lib/docker/aufs/diff/e1d23eaf8fca369eef932902fc8c53b28a3de9a9d6d764fd785433a248e6f0c1 -xdev -printf .] failed. stderr: find: unrecognized: -printf
Thank you very much
Use: apk -U add findutils in you container and commit it to your image
any news on this topic?
we are experiencing the same problem - hopefully there will be a patch for this shortly...
I confirm that using apk -U add findutils solves the issue. I've made a docker automated build with that fix:
https://hub.docker.com/r/blep/cadvisor_bugfix1556/
On a side note, google/cadvisor:latest still target v0.25.0 instead of v0.26.1.
Thanks @blep. @google-admin please add this fix in official image.
has this been fixed in official image?
This was fixed in https://github.com/google/cadvisor/pull/1698
Most helpful comment
Use: apk -U add findutils in you container and commit it to your image