skydive icon indicating copy to clipboard operation
skydive copied to clipboard

Docker topology probe fails if /proc directory doesn't contain a pid for each container

Open esnible opened this issue 6 years ago • 2 comments

When skydive is run from within a container, the docker topology problem does not create the containers.

I ran skydive allinone from within a Docker container on Mac with --volume /var/run/docker.sock:/var/run/docker.sock so that the Mac's Docker environment could be seen.

Although the Docker topology probe starts it silently fails because topology/probes/docker.go calls netns.GetFromPid(info.State.Pid) which returns an error if /proc//ns/net doesn't exist (and it won't; containers' view of /proc does not include everything the host sees.)

The first problem is the return without logging if GetFromPid() fails. If we just log and continue if GetFromPid() fails, and also continue instead of returning when syscall.Stat() in topology/probes/netns.go:Register() fails, then the Docker problem works when skydive is run within a container.

esnible avatar Jan 10 '18 16:01 esnible

I attempted to work around this. My attempt is was good because it doesn’t create the bridge or any of the usual stuff. It might be better to just have the system log the problem instead of silently failing.

esnible avatar Jan 10 '18 16:01 esnible

The described bug also happens on Ubuntu WSL connecting to the windows docker desktop.

Sparika avatar Sep 19 '19 12:09 Sparika