Cadvisor: Selecting Docker Containers returns error "Cannot connect to the Docker daemon..."

Created on 6 Feb 2017  路  10Comments  路  Source: google/cadvisor

Receiving notice on three different systems; "Cannot connect to the Docker daemon. Is the docker daemon running on this host?" after selecting 'Docker Containers' from Cadvisor GUI. Able to locate containers information when selecting /docker under Subcontainers
Found several Warning messages in the Cadvisor container log.
Any help will be appreciated:

screenshot from 2017-02-06 10 58 47

Started cadvisor:
docker run \
--name=cadvisor-hostname -f \
--rm \
--detach=true \
--disable-content-trust \
--userns host \
--cpu-shares=128 \
--cpuset-cpus=0 \
--cpus=0.25 \
--memory=100m \
--publish=8080:8080 \
--volume=/:/rootfs:ro \
--volume=/var/run:/var/run:rw \
--volume=/sys:/sys:ro \
--volume=/var/lib/docker/:/var/lib/docker:ro \
google/cadvisor:latest

OS: Ubuntu 14.04.5 LTS

docker version
Client:
Version: 1.13.0
API version: 1.25
Go version: go1.7.3
Git commit: 49bf474
Built: Tue Jan 17 09:50:17 2017
OS/Arch: linux/amd64

Server:
Version: 1.13.0
API version: 1.25 (minimum version 1.12)
Go version: go1.7.3
Git commit: 49bf474
Built: Tue Jan 17 09:50:17 2017
OS/Arch: linux/amd64
Experimental: false

cat /etc/default/docker
DOCKER_OPTS="\
--graph=/usr/local/docker \
--dns 192.168.1.202 \
--dns 8.8.8.8 \
--dns 8.8.4.4 \
--host=hostname -f:2376 \
--log-level warn \
--log-driver=json-file \
--log-opt max-size=5m \
--log-opt max-file=7 \
--log-opt labels=host,ip,gateway,id \
--tlsverify \
--tlscacert=/etc/docker/certs.d/daemon/ca.pem \
--tlscert=/etc/docker/certs.d/daemon/hostname -f-cert.pem \
--tlskey=/etc/docker/certs.d/daemon/hostname -f-priv-key.pem \
--userns-remap=default \
"

docker logs cadvisor
I0206 16:50:01.794656 1 storagedriver.go:50] Caching stats in memory for 2m0s
I0206 16:50:01.795029 1 manager.go:140] cAdvisor running in container: "/docker/7f9f871bba8915573bceafab43b661607eebb2369aa3b64e0b212c864da38e1d"
W0206 16:50:01.795350 1 manager.go:144] Unable to connect to Docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?
W0206 16:50:01.795939 1 manager.go:148] unable to connect to Rkt api service: rkt: cannot tcp Dial rkt api service: dial tcp [::1]:15441: getsockopt: connection refused
I0206 16:50:01.802098 1 fs.go:116] Filesystem partitions: map[/dev/sda1:{mountpoint:/rootfs/boot major:8 minor:1 fsType:ext2 blockSize:0} /dev/dm-0:{mountpoint:/var/lib/docker major:252 minor:0 fsType:ext4 blockSize:0}]
I0206 16:50:01.804402 1 info.go:47] Couldn't collect info from any of the files in "/rootfs/etc/machine-id,/var/lib/dbus/machine-id"
I0206 16:50:01.804450 1 manager.go:195] Machine: {NumCores:2 CpuFrequency:2327599 MemoryCapacity:3999186944 MachineID: SystemUUID:44454C4C-4B00-1042-8042-C4C04F444631 BootID:84a85a90-8452-40a3-8932-0f40e429adff Filesystems:[{Device:/dev/dm-0 Capacity:74395713536 Type:vfs Inodes:4628480 HasInodes:true} {Device:/dev/sda1 Capacity:246755328 Type:vfs Inodes:62248 HasInodes:true} {Device:none Capacity:74395713536 Type:vfs Inodes:4628480 HasInodes:true}] DiskMap:map[252:0:{Name:dm-0 Major:252 Minor:0 Size:75719770112 Scheduler:none} 252:1:{Name:dm-1 Major:252 Minor:1 Size:4143972352 Scheduler:none} 8:0:{Name:sda Major:8 Minor:0 Size:160000000000 Scheduler:deadline} 8:16:{Name:sdb Major:8 Minor:16 Size:0 Scheduler:deadline} 8:32:{Name:sdc Major:8 Minor:32 Size:0 Scheduler:deadline} 8:48:{Name:sdd Major:8 Minor:48 Size:0 Scheduler:deadline} 8:64:{Name:sde Major:8 Minor:64 Size:0 Scheduler:deadline}] NetworkDevices:[{Name:br-6142dbbf1872 MacAddress:02:42:93:07:76:d3 Speed:0 Mtu:1500} {Name:br-76df45feaa5e MacAddress:02:42:d4:32:11:ce Speed:0 Mtu:1500} {Name:eth0 MacAddress:00:1a:a0:87:6f:19 Speed:1000 Mtu:1500}] Topology:[{Id:0 Memory:3999186944 Cores:[{Id:0 Threads:[0] Caches:[{Size:32768 Type:Data Level:1} {Size:32768 Type:Instruction Level:1}]} {Id:1 Threads:[1] Caches:[{Size:32768 Type:Data Level:1} {Size:32768 Type:Instruction Level:1}]}] Caches:[]}] CloudProvider:Unknown InstanceType:Unknown InstanceID:None}
I0206 16:50:01.804780 1 manager.go:201] Version: {KernelVersion:3.19.0-25-generic ContainerOsVersion:Alpine Linux v3.4 DockerVersion:Unknown CadvisorVersion:v0.24.1 CadvisorRevision:ae6934c}
W0206 16:50:01.805584 1 manager.go:239] Docker container factory registration failed: failed to validate Docker info: failed to detect Docker info: Cannot connect to the Docker daemon. Is the docker daemon running on this host?.
W0206 16:50:01.805600 1 manager.go:244] 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
I0206 16:50:01.805608 1 factory.go:54] Registering systemd factory
I0206 16:50:01.806836 1 factory.go:86] Registering Raw factory
I0206 16:50:01.807970 1 manager.go:1082] Started watching for new ooms in manager
W0206 16:50:01.808173 1 manager.go:272] 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]
I0206 16:50:01.819458 1 manager.go:285] Starting recovery of all containers
I0206 16:50:01.828801 1 manager.go:290] Recovery completed
I0206 16:50:01.839361 1 cadvisor.go:157] Starting cAdvisor version: v0.24.1-ae6934c on port 8080

help wanted kinbug runtimdocker

Most helpful comment

I'm having exactly the same problem. This blocks us from using cAdvisor in Swarm mode.

All 10 comments

I'm having exactly the same problem. This blocks us from using cAdvisor in Swarm mode.

Same problem, downgrading to docker 1.12.5 solves the issue for me...

I dont think we have done any validation on docker 1.13. If anyone wants to help validate and debug docker 1.13, that would be appreciated.

I also have this issue in 1.12.6

Same on AWS ECS instances which also runs on 1.12.6.

I have no problem in 1.12.6 version but not in later versions(1.13 and later). Anyone knows the exact root cause?

Please notice that https://github.com/google/cadvisor/blob/master/docs/running.md
RHEL and CentOS need --privileged=true and --volume=/cgroup:/cgroup:ro \

I am using Ubuntu 14.04.5 LTS

This seems to be fixed now:

Driver Status
Docker Version 17.09.0-ce
Kernel Version 3.13.0-132-generic
OS Version Ubuntu 14.04.5 LTS

Was this page helpful?
0 / 5 - 0 ratings