'weave ps' fails with "Cannot find weave bridge: Link not found" #2388
... even if the weave bridge exists:
This happened when running a local instance of the scope service (kubernetes anywhere).
Output when running the docker command above with WEAVE_DEBUG=1: https://gist.github.com/2opremio/cfe5c7fa236854e9963dda0f8afc5754
Some details about my system:
The text was updated successfully, but these errors were encountered:
@2opremio Are you able to reproduce the issue? Maybe you have an output of
From inspecting the netlink library, I can see that
As I've already mentioned on Slack, the root cause is the WithNetNS function.
During execution of
In the Linux kernel, each netdev is associated only with exactly one network namespace. Therefore, the "weave" bridge cannot be seen from a container which network namespace != host network namespace.
The error you get is due to https://github.com/weaveworks/weave/blob/v1.6.0/common/utils.go#L108 being executed on a thread which entered container network namespace which is not associated with the "weave" bridge netdev.
As an evidence, please check the following strace output (full log):
The 3365 process does the
I found this via https://www.weave.works/blog/linux-namespaces-and-go-don-t-mix.
runtime.LockOSThread() defer runtime.UnlockOSThread() hostNetNs, _ := netns.Get() netns.Set(ns) links, _ := netlink.LinkList() fmt.Println(filterAttachedLinks(links, indexes)) // Return to the host network namespace netns.Set(hostNetNs)
is a perfect illustration of erroneous usage of