Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v32.0 - Failed to get system UUID: open /etc/machine-id: no such file or directory (Centos 7.6) #2157

Open
BootsSiR opened this issue Jan 29, 2019 · 18 comments

Comments

@BootsSiR
Copy link

OS: CentOS Linux release 7.6.1810
SELinux is active

docker-compose.yml:

cadvisor:
    container_name: cadvisor
    image: google/cadvisor:v0.32.0
    volumes:
      - /:/rootfs:ro
      - /var/run:/var/run:rw
      - /sys:/sys:ro
      - /var/lib/docker/:/var/lib/docker:ro
      - /cgroup:/cgroup:ro 
    ports:
      - '9090:8080'
    privileged: true      
    restart: always

If I use v32.0, I get this output and nothing works

cadvisor | E0129 13:31:43.708149 1 info.go:140] Failed to get system UUID: open /etc/machine-id: no such file or directory

If I use v31.0, I get this output and it appears things work fine (I can access the webui)

cadvisor | I0129 13:33:06.507201 1 storagedriver.go:50] Caching stats in memory for 2m0s
cadvisor | I0129 13:33:06.507728 1 manager.go:155] cAdvisor running in container: "/sys/fs/cgroup/cpu,cpuacct"
cadvisor | I0129 13:33:06.570169 1 fs.go:142] Filesystem UUIDs: map[]
cadvisor | I0129 13:33:06.570199 1 fs.go:143] Filesystem partitions: map[tmpfs:{mountpoint:/dev major:0 minor:44 fsType:tmpfs blockSize:0} /dev/sda:{mountpoint:/var/lib/docker major:8 minor:0 fsType:ext4 blockSize:0} shm:{mountpoint:/rootfs/var/lib/docker/containers/ac8674881bf8a67cb74d2726661194d449924a5cd8de2fb2136044d8991d1fb6/mounts/shm major:0 minor:41 fsType:tmpfs blockSize:0}]
cadvisor | E0129 13:33:06.579683 1 info.go:140] Failed to get system UUID: open /etc/machine-id: no such file or directory
cadvisor | I0129 13:33:06.580167 1 manager.go:229] Machine: {NumCores:4 CpuFrequency:1999998 MemoryCapacity:8201080832 HugePages:[{PageSize:1048576 NumPages:0} {PageSize:2048 NumPages:0}] MachineID:cb018d6767ca4c8983df25647a8794b0 SystemUUID: BootID:1bc629cd-15e6-4cd5-9905-70c78f61b18b Filesystems:[{Device:tmpfs DeviceMajor:0 DeviceMinor:44 Capacity:67108864 Type:vfs Inodes:1001108 HasInodes:true} {Device:/dev/sda DeviceMajor:8 DeviceMinor:0 Capacity:167017951232 Type:vfs Inodes:10112000 HasInodes:true} {Device:shm DeviceMajor:0 DeviceMinor:41 Capacity:67108864 Type:vfs Inodes:1001108 HasInodes:true} {Device:overlay DeviceMajor:0 DeviceMinor:40 Capacity:167017951232 Type:vfs Inodes:10112000 HasInodes:true}] DiskMap:map[8:0:{Name:sda Major:8 Minor:0 Size:169651208192 Scheduler:deadline} 8:16:{Name:sdb Major:8 Minor:16 Size:2147483648 Scheduler:deadline}] NetworkDevices:[{Name:br-01c2cf4aa990 MacAddress:02:42:d2:d3:76:f9 Speed:0 Mtu:1500} {Name:br-0c1136f830e3 MacAddress:02:42:52:7b:50:65 Speed:0 Mtu:1500} {Name:br-20cdb806ba71 MacAddress:02:42:a0:7d:33:79 Speed:0 Mtu:1500} {Name:br-3f49ee7b6836 MacAddress:02:42:4e:26:75:41 Speed:0 Mtu:1500} {Name:br-4e992eafd433 MacAddress:02:42:3e:f1:e9:dc Speed:0 Mtu:1500} {Name:br-593f605af16c MacAddress:02:42:de:06:4f:15 Speed:0 Mtu:1500} {Name:br-5b1c844a65bb MacAddress:02:42:70:96:0e:78 Speed:0 Mtu:1500} {Name:br-5ba64de99d49 MacAddress:02:42:5d:c4:17:38 Speed:0 Mtu:1500} {Name:br-5e907e3b6f6b MacAddress:02:42:14:cc:48:a1 Speed:0 Mtu:1500} {Name:br-80c701a6c840 MacAddress:02:42:b5:aa:48:6a Speed:0 Mtu:1500} {Name:br-b6f4c4e79414 MacAddress:02:42:89:90:14:3e Speed:0 Mtu:1500} {Name:br-c9247e85b5f7 MacAddress:02:42:15:c9:53:4f Speed:0 Mtu:1500} {Name:br-e02938a526b2 MacAddress:02:42:7f:e4:bb:df Speed:0 Mtu:1500} {Name:eth0 MacAddress:f2:3c:91:c5:b2:7b Speed:0 Mtu:1500}] Topology:[{Id:0 Memory:8589393920 Cores:[{Id:0 Threads:[0] Caches:[{Size:65536 Type:Data Level:1} {Size:65536 Type:Instruction Level:1} {Size:524288 Type:Unified Level:2}]}] Caches:[{Size:16777216 Type:Unified Level:3}]} {Id:1 Memory:0 Cores:[{Id:0 Threads:[1] Caches:[{Size:65536 Type:Data Level:1} {Size:65536 Type:Instruction Level:1} {Size:524288 Type:Unified Level:2}]}] Caches:[{Size:16777216 Type:Unified Level:3}]} {Id:2 Memory:0 Cores:[{Id:0 Threads:[2] Caches:[{Size:65536 Type:Data Level:1} {Size:65536 Type:Instruction Level:1} {Size:524288 Type:Unified Level:2}]}] Caches:[{Size:16777216 Type:Unified Level:3}]} {Id:3 Memory:0 Cores:[{Id:0 Threads:[3] Caches:[{Size:65536 Type:Data Level:1} {Size:65536 Type:Instruction Level:1} {Size:524288 Type:Unified Level:2}]}] Caches:[{Size:16777216 Type:Unified Level:3}]}] CloudProvider:Unknown InstanceType:Unknown InstanceID:None}
cadvisor | I0129 13:33:06.582277 1 manager.go:235] Version: {KernelVersion:3.10.0-957.1.3.el7.x86_64 ContainerOsVersion:Alpine Linux v3.7 DockerVersion:18.09.1 DockerAPIVersion:1.39 CadvisorVersion:v0.31.0 CadvisorRevision:fc17731a}
cadvisor | I0129 13:33:06.608589 1 factory.go:356] Registering Docker factory
cadvisor | I0129 13:33:06.611152 1 factory.go:136] Registering containerd factory
cadvisor | I0129 13:33:06.612419 1 factory.go:138] Registering mesos factory
cadvisor | I0129 13:33:06.612444 1 factory.go:54] Registering systemd factory
cadvisor | I0129 13:33:06.613453 1 factory.go:97] Registering Raw factory
cadvisor | I0129 13:33:06.614401 1 manager.go:1222] Started watching for new ooms in manager
cadvisor | I0129 13:33:06.618655 1 manager.go:365] Starting recovery of all containers
cadvisor | I0129 13:33:06.701418 1 manager.go:370] Recovery completed
cadvisor | I0129 13:33:06.792173 1 cadvisor.go:174] Starting cAdvisor version: v0.31.0-fc17731a on port 8080

The error still exists in v31, it just doesn't seem to be a show stopper. Any suggestions?

@BootsSiR BootsSiR changed the title v32.0 - v32.0 - Failed to get system UUID: open /etc/machine-id: no such file or directory Jan 29, 2019
@BootsSiR BootsSiR changed the title v32.0 - Failed to get system UUID: open /etc/machine-id: no such file or directory v32.0 - Failed to get system UUID: open /etc/machine-id: no such file or directory (Centos 7.6) Jan 29, 2019
@dashpole
Copy link
Collaborator

Can you be more specific when you say "nothing works"? Does the kubelet simply log that and then exit, or does it hang somewhere, or does it just never report any container metrics?

@BootsSiR
Copy link
Author

BootsSiR commented Jan 29, 2019

@dashpole I get that single line of logging and it's DOA until I stop the container. I cannot access the webui at all.

@dashpole
Copy link
Collaborator

dashpole commented Feb 2, 2019

I have looked through the changes between those versions, but can't see anything immediately that would affect this. This must be hanging in the machine.Info( function because we log the result immediately after that is called during initialization.

The only thing that happens between then is reading the machine id (/etc/machine-id) and the boot id (/proc/sys/kernel/random/boot_id), and getting all of the cloud info from the cloud-provider.

@hthiers
Copy link

hthiers commented Apr 22, 2019

Same problem here with Centos 7.6: info.go:140] Failed to get system UUID: open /etc/machine-id: no such file or directory
No web UI.

@pedropinheiro75
Copy link

Same problem using the compiled binary directly on a Amazon Linux AMI 2018.03:

4.14.123-86.109.amzn1.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux

info.go:140] Failed to get system UUID: open /etc/machine-id: no such file or directory

@XSHui
Copy link

XSHui commented Sep 6, 2019

v0.33.0 Same problem.

@wc-matteo
Copy link

same on ubuntu 18.04

@mikzuit
Copy link

mikzuit commented Sep 29, 2020

v0.34,0 and v0.36.0 same problem. I've tried v0.34.0 and v0.36.0 under Alpine 3.10 in docker container under Windows 10 with same info.go:140] Failed to get system UUID: open /etc/machine-id: no such file or directory and info.go:102] Failed to get system UUID: open /etc/machine-id: no such file or directory respectively , info message is every 5 minutes.

@calbot
Copy link

calbot commented Oct 17, 2020

I'm getting this too. It just started out of the blue...

E1017 04:30:30.421766       1 info.go:140] Failed to get system UUID: open /etc/machine-id: no such file or directory
W1017 04:30:30.492874       1 manager.go:256] Could not configure a source for OOM detection, disabling OOM events: open /dev/kmsg: no such file or directory

@Constantin07
Copy link

Constantin07 commented Jan 14, 2021

same issue with v0.37.0:

 16693 info.go:53] Couldn't collect info from any of the files in "/etc/machine-id,/var/lib/dbus/machine-id"

adding 2 more volumes removes the messages:

....
      - /etc/machine-id:/etc/machine-id:ro
      - /var/lib/dbus/machine-id:/var/lib/dbus/machine-id:ro

@philcz16
Copy link

Same issue too
E0518 17:16:47.007833 1 info.go:140] Failed to get system UUID: open /etc/machine-id: no such file or directory

@dbrennand
Copy link

Got this error: Failed to get system UUID: open /etc/machine-id: no such file or directory

Fixed by adding the following to my docker-compose file:

  cadvisor:
    ...
    volumes:
        ...
        - /etc/machine-id:/etc/machine-id:ro

As suggested by @Constantin07 😃

@taw123
Copy link

taw123 commented Feb 22, 2023

To help others....

QNAP in QTS does not STORE it's UUID in /etc/machine-id so it of course CAN'T be read (producing the same open issue described).

I you can decode the machine system info which INCLUDES the UUID using:
sudo dmidecode -t system

And then manually write the extracted UUID to the expected file /etc/machine-id

Now on to my next issue.... seems to fail for lack of an Anti-Virius group on the host
Failed to start container manager: inotify_add_watch /sys/fs/cgroup/cgroups_antivirus: no such file or directory

My QTS 5.x based QNAP only has the following directories (please excuse the slight forking of the original issue as perhaps related to my attempted workaround of the UUID issue, though HIGHLY doubtful)....

[/] # ls -la /sys/fs/cgroup/
total 0
drwxrwxrwt 11 admin administrators 220 2023-02-10 02:12 ./
drwxr-xr-x  8 admin administrators   0 2023-02-10 02:04 ../
dr-xr-xr-x  3 admin administrators   0 2023-02-10 02:12 blkio/
dr-xr-xr-x  4 admin administrators   0 2023-02-10 02:06 cpu/
dr-xr-xr-x  3 admin administrators   0 2023-02-10 02:12 cpuacct/
dr-xr-xr-x  3 admin administrators   0 2023-02-10 02:12 cpuset/
dr-xr-xr-x  3 admin administrators   0 2023-02-10 02:12 devices/
dr-xr-xr-x  3 admin administrators   0 2023-02-10 02:12 freezer/
dr-xr-xr-x  5 admin administrators   0 2023-02-10 02:04 memory/
dr-xr-xr-x  3 admin administrators   0 2023-02-10 02:12 pids/
dr-xr-xr-x  3 admin administrators   0 2023-02-10 02:12 systemd/

Any ideas other than regress version of cAdvise too one before issues started?
Thanks got any help!

@taw123
Copy link

taw123 commented Feb 23, 2023

Apologies for the bad form rreplieing to my own post but thought again this might be helpful for others...

After MUCH trial & error combined with a good deal of research I stumbled upon a workaround for my final remaining issue above. Seem if you pass all the /sys data it is looking for as individual volumes you can work around the issue I had... per issue 574760369. Ugly as stated but it did work (and I made it a bit less ugly by revising to pass the whole /sys/fs/cgroup/ rather then the individual directories I and the author of the fix had earlier used.

I suppose I should cross post in that thread but honestly don't understand the reported error well enough to be sure where to post the issue so perhaps I should just leave the issue here as is. The issue I mentioned is ALSO still open and the documentation on cAdvisor seems to be lacking in a number of areas regarding the Docker implementation and configuration of monitoring.

Hope this helps someone out there save some time (and hair) ;)

@mooglestiltzkin
Copy link

nub question. how do u go about doing that?

"Seem if you pass all the /sys data it is looking for as individual volumes you can work around the issue"

Apologies for the bad form rreplieing to my own post but thought again this might be helpful for others...

After MUCH trial & error combined with a good deal of research I stumbled upon a workaround for my final remaining issue above. Seem if you pass all the /sys data it is looking for as individual volumes you can work around the issue I had... per issue 574760369. Ugly as stated but it did work (and I made it a bit less ugly by revising to pass the whole /sys/fs/cgroup/ rather then the individual directories I and the author of the fix had earlier used.

I suppose I should cross post in that thread but honestly don't understand the reported error well enough to be sure where to post the issue so perhaps I should just leave the issue here as is. The issue I mentioned is ALSO still open and the documentation on cAdvisor seems to be lacking in a number of areas regarding the Docker implementation and configuration of monitoring.

Hope this helps someone out there save some time (and hair) ;)

@taw123
Copy link

taw123 commented Jan 17, 2024

nub question. how do u go about doing that?

As was mention in the url I quoted (and you included in your reply)....

Once caveat though... Given I am now on ZFS I can say that my CAdmin config while it works throw up a ton of out of memory msg in the console and will actually block snapshot management/deletion... Just don't have the time to dig into this right now so I have had to write off CAdvise (resource overhead combined with file system blockage)

@mooglestiltzkin
Copy link

nub question. how do u go about doing that?

As was mention in the url I quoted (and you included in your reply)....

Once caveat though... Given I am now on ZFS I can say that my CAdmin config while it works throw up a ton of out of memory msg in the console and will actually block snapshot management/deletion... Just don't have the time to dig into this right now so I have had to write off CAdvise (resource overhead combined with file system blockage)

thx for the reply.

well i use glances now, seems low resource. i also see a friend use netdata which also is low on resource consumption. so that is the direction i probably will head for.

@Joulenergy
Copy link

Could not configure a source for OOM detection, disabling OOM events: open /dev/kmsg: no such file or directory
@calbot

I solved this by adding a bind mount and device to my docker-compose file:
volumes: - /:/rootfs:ro - /var/run:/var/run:rw - /sys:/sys:ro - /var/lib/docker/:/var/lib/docker:ro - /dev/disk:/dev/disk:ro - /etc/machine-id:/etc/machine-id:ro devices: - /dev/kmsg

i also added the /etc/machine-id:/etc/machine-id:to which solved the other error message of no /etc/machine-id

High5Apps added a commit to High5Apps/organize-backend that referenced this issue Oct 23, 2024
- Used the following Dockerfile as the main example
  - https://github.com/oijkn/Docker-Raspberry-PI-Monitoring/blob/760528af93b2d5ce3a2025a6c7beb90f3dd3c27c/docker-compose.yml#L22-L44
  - Note that it differs from the docker command mentioned in the cAdvisor README quick-start due to the fixes mentioned further below
    - https://github.com/google/cadvisor?tab=readme-ov-file#quick-start-running-cadvisor-in-a-docker-container
- Fixed "Failed to get system UUID" error by adding `/etc/machine-id` volume mount
  - google/cadvisor#2157 (comment)
- Fixed container names not included on mac by adding `/var/run/docker.sock` volume mount
  - google/cadvisor#1565 (comment)
  - Note that `ro` was sufficient and `rw` wasn't needed as mentioned in google/cadvisor#1565 (comment)
- Fix cAdvisor high memory usage with oijkn/Docker-Raspberry-PI-Monitoring#34
- Note that every 5 minutes, two error messages are logged. This is a known issue with cAdvisor:v0.49.1 that will hopefully be fixed in a future release
  - google/cadvisor#3493
- Add cAdvisor metrics to the prometheus.yml file
  - I initially tried to use port 8081 in this file, but it didn't work. The following answer led me to realize that it needed to be port 8080, since 8081 is only used on the host machine's network, not within the docker routing network itself
  - https://stackoverflow.com/q/54397463
- Explanation of `privileged: true`
  - https://thelinuxcode.com/privileged-in-docker-compose-with-code-examples/
- cAdvisor docs on prometheus
  - https://github.com/google/cadvisor/blob/master/docs/storage/prometheus.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests