google / cadvisor

Analyzes resource usage and performance characteristics of running containers.
Other
17k stars 2.31k forks source link

Error building docker arm image #2854

Open hferreira23 opened 3 years ago

hferreira23 commented 3 years ago

Not a bug per se as cadvisor doesn't have official ARM support but any help would be appreciated.

I'm trying to create a docker image for arm and arm64 devices using the Dockerfile available in this repo.

The good news is that the docker build finishes without errors. the bad news is that when starting the container I get panic errors and exists.

Log output:

W0427 19:13:20.228095       1 manager.go:160] Cannot detect current cgroup on cgroup v2
W0427 19:13:25.250025       1 sysinfo.go:203] Nodes topology is not available, providing CPU topology
E0427 19:13:25.255488       1 info.go:114] Failed to get system UUID: open /etc/machine-id: no such file or directory
W0427 19:13:25.282612       1 info.go:53] Couldn't collect info from any of the files in "/etc/machine-id,/var/lib/dbus/machine-id"
W0427 19:13:25.294056       1 manager.go:289] Could not configure a source for OOM detection, disabling OOM events: open /dev/kmsg: no such file or directory
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x4 pc=0x130a4]

goroutine 77 [running]:
github.com/google/cadvisor/manager.(*containerData).updateStats(0x2ac2180, 0x51e02e47, 0xc01a3675)
    /go/src/github.com/google/cadvisor/manager/container.go:675 +0x7c
github.com/google/cadvisor/manager.(*containerData).housekeepingTick(0x2ac2180, 0x28b8100, 0x5f5e100, 0x0, 0x289e500)
    /go/src/github.com/google/cadvisor/manager/container.go:586 +0xe8
github.com/google/cadvisor/manager.(*containerData).housekeeping(0x2ac2180)
    /go/src/github.com/google/cadvisor/manager/container.go:534 +0x1f4
created by github.com/google/cadvisor/manager.(*containerData).Start
    /go/src/github.com/google/cadvisor/manager/container.go:122 +0x2c

Any tips would be appreciated.

iwankgb commented 3 years ago

What hardware and distro/kernel are you running cAdvisor on? It seems that cAdvisor assumes that OOM information is always available.

hferreira23 commented 3 years ago

Devices: RPi 3 and RPi 4 Distro: Raspbian testing 32bits fully updated Kernel: 5.10.17-v7l+

iwankgb commented 3 years ago

I think that we have never tested cAdvisor on 32 bit ARM. I use 64 bit Ubuntu on RPi 4. This is why it's broken, I guess. Regarding fixing the problem: I will see what I can do to get hold of 32 bit system.

KesleyDavid commented 2 years ago

@iwankgb Good morning, how did you make it work on ubuntu arm64? I'm having trouble getting it to work running on a swarm cluster