解决Error validating CNI config file:[plugin bridge does not support config version “1.0.0“]
之前在使用podman容器时都一切正常,可以在Windows下使用Goland的Docker工具直接部署容器到远程Linux运行。 有一段时间没有使用容器编排部署了,昨天再次使用的时候发现Goland报错:
1Error response from daemon: error configuring network namespace for container b73c72cc5fbf3123fdc24a70d086fd4991e85635e1707b6a796fd41ae9e371e0: CNI network "network" not found
然后Linux监听容器的进程报错:
1$ podman system service --time=0 tcp:0.0.0.0:2345
2WARN[0184] Error validating CNI config file /home/witton/.config/cni/net.d/network.conflist: [plugin bridge does not support config version "1.0.0" plugin portmap does not support config version "1.0.0" plugin firewall does not support config version "1.0.0" plugin tuning does not support config version "1.0.0"]
3ERRO[0184] Error tearing down partially created network namespace for container b73c72cc5fbf3123fdc24a70d086fd4991e85635e1707b6a796fd41ae9e371e0: CNI network "network" not found
网上查了很多资料,没有对症的。
其实从Linux的报错信息来看,是由于network.conflist
文件中配置的bridge
、portmap
、firewall
、tuning
插件不支持"1.0.0"版本。打开network.conflist
文件,可以看到里面配置的"cniVersion"版本为 “1.0.0”:
1"cniVersion": "1.0.0",
由于服务器不定期有更新,想必是容器相关组件更新了。 podman的版本:
1$ podman -v
2podman version 3.4.4
containerd版本:
1$ containerd -v
2containerd github.com/containerd/containerd 1.7.2
对比了一下另一台机器的podman版本一致,containerd版本不一样:
1$ containerd -v
2containerd github.com/containerd/containerd 1.6.12-0ubuntu1~22.04.3
果然是升级导致的问题,但是很奇怪ubuntu1为啥没同时更新podman,目前最新版本已经是4.6.2了。看了一下cni 1.0.0的
文档,实际是支持bridge
、portmap
、firewall
、tuning
插件的,应该是podman的版本不适应新的containerd 1.7.2。由于服务器上还有很多容器在运行,为了稳定,不能贸然手动更新podman或者降级containerd到1.6.12。从cni的
文档可以看出1.0.0之前的版本是0.4.0,手动把network.conflist
配置的"cniVersion"版本为 “0.4.0"即可。
这是目前稳妥的方法,只是很麻烦,每次部署都需要手动去修改!后面系统升级了podman可能就会解决此问题。
- 原文作者:Witton
- 原文链接:https://wittonbell.github.io/posts/2023/2023-09-14-解决Error-validating-CNI-config-fileplugin-bridge-does-not-support-config-version-1.0.0/
- 版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议. 进行许可,非商业转载请注明出处(作者,原文链接),商业转载请联系作者获得授权。