libnetwork: 错误:未知命令“/var/run/docker/netns/582bd184e561”用于“some_app”

huangapple go评论96阅读模式
英文:

libnetwork: Error: unknown command "/var/run/docker/netns/582bd184e561" for "some_app"

问题

我正在尝试在容器中设置一个网络(使用Docker的libnetworklibcontainer),但是我一直遇到这个问题。据我所知,它正在查找some_app以获取一些沙盒信息?

INFO[3808] 在resolv.conf中没有剩余的非本地DNS名称服务器。使用默认的外部服务器:[nameserver 8.8.8.8 nameserver 8.8.4.4]
INFO[3808] 启用IPv6;添加默认的IPv6外部服务器:[nameserver 2001:4860:4860::8888 nameserver 2001:4860:4860::8844]
Error: 未知命令“/var/run/docker/netns/582bd184e561”用于“some_app”
运行 'some_app --help' 查看用法。
ERRO[3808] 容器6b81802576bd4f16aa117061f81b5c3e的解析器设置/启动失败,“设置尚未完成”
ERRO[3808] 将接口vethef0a693添加到沙盒失败:在prefunc中失败:在链接“vethef0a693”上设置命名空间失败:无效的参数
ERRO[3808] 将接口vethef0a693添加到沙盒失败:在prefunc中失败:在链接“vethef0a693”上设置命名空间失败:无效的参数

我想知道是否有人可以帮助我理解这个问题,并可能防止它发生。这两个错误是分开的吗?

谢谢

这是我正在尝试使用的库

英文:

I am trying to setup a network in the container (using Docker's libnetwork and libcontainer), but I keep running into this issue. As far as I can tell it's looking into some_app to get some sandbox information?

INFO[3808] No non-localhost DNS nameservers are left in resolv.conf. Using default external servers : [nameserver 8.8.8.8 nameserver 8.8.4.4] 
INFO[3808] IPv6 enabled; Adding default IPv6 external servers : [nameserver 2001:4860:4860::8888 nameserver 2001:4860:4860::8844] 
Error: unknown command "/var/run/docker/netns/582bd184e561" for "some_app"
Run 'some_app --help' for usage.
ERRO[3808] Resolver Setup/Start failed for container 6b81802576bd4f16aa117061f81b5c3e, "setup not done yet" 
ERRO[3808] failed to add interface vethef0a693 to sandbox: failed in prefunc: failed to set namespace on link "vethef0a693": invalid argument 
ERRO[3808] failed to add interface vethef0a693 to sandbox: failed in prefunc: failed to set namespace on link "vethef0a693": invalid argument 

I was wondering if anyone could help me make sense of this and perhaps prevent it. Are these two separate errors?

Thank you

Here is the library I am trying to use

答案1

得分: 0

我花了一些时间才弄清楚,但是下面是解释:

就像在Docker中一样,libnetwork创建了一个veth接口对。然后,它将veth对的一端移动到容器的命名空间中。在此过程中,libnetwork尝试在当前二进制文件的实例(在本例中为some_app)上执行在运行时注册的命令。

然而,这些命令在some_app的外部接口上并不存在。它们是使用一个名为reexec的库后来注入的。为了使其工作,需要像这样初始化reexec

if reexec.Init() {
	return
}

还要注意根据此线程libnetwork目前不支持Docker之外的应用程序。

注意:我通过阅读源代码发现了这一点,所以可能有错误,但是在这之后我的问题解决了。

英文:

It took me a while to figure this out, but here goes:

Just like in Docker, libnetwork creates a veth interface pair. It then moves one end of the veth pair into the container namespace. During this process libnetwork tries to execute commands registered at runtime on the current instance of the binary (some_app in this case).

These commands do not exist on the external interface of some_app however. They are injected later using a library called reexec. For this to work, reexec needs to be initialized like this:

if reexec.Init() {
	return
}

Also note that according to this thread libnetwork is currently not supported for applications outside of Docker.

NB: I discovered this by reading the source code, so I might be wrong but my issue went away after this.

1: https://github.com/docker/docker/tree/master/pkg/reexec "reexec"
2: https://github.com/docker/libnetwork/issues/971

huangapple
  • 本文由 发表于 2016年2月26日 01:01:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/35633666.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定