{"record":{"id":"fad13650c5233b00","repo":"containerd/containerd","slug":"cni-config-not-initialized","errorCode":null,"errorMessage":"cni config not initialized","messagePattern":"cni config not initialized","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"internal/cri/server/sandbox_run.go","lineNumber":485,"sourceCode":"\n\tvar (\n\t\tid        = sandbox.ID\n\t\tconfig    = sandbox.Config\n\t\tpath      = sandbox.NetNSPath\n\t\tnetPlugin = c.getNetworkPlugin(sandbox.RuntimeHandler)\n\t\terr       error\n\t\tresult    *cni.Result\n\t)\n\n\t// Add tracing attributes\n\tspan.SetAttributes(\n\t\ttracing.Attribute(\"sandbox.id\", id),\n\t\ttracing.Attribute(\"netns.path\", path),\n\t\ttracing.Attribute(\"runtime.handler\", sandbox.RuntimeHandler),\n\t)\n\n\tif netPlugin == nil {\n\t\treturn errors.New(\"cni config not initialized\")\n\t}\n\tif c.config.UseInternalLoopback {\n\t\terr := c.bringUpLoopback(path)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unable to set lo to up: %w\", err)\n\t\t}\n\t}\n\topts, err := cniNamespaceOpts(id, config)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get cni namespace options: %w\", err)\n\t}\n\tlog.G(ctx).WithField(\"podsandboxid\", id).Debugf(\"begin cni setup\")\n\tnetStart := time.Now()\n\n\tspan.AddEvent(\"cni.setup.start\")\n\tif c.config.CniConfig.NetworkPluginSetupSerially {\n\t\tresult, err = netPlugin.SetupSerially(ctx, id, path, opts...)\n\t} else {","sourceCodeStart":467,"sourceCodeEnd":503,"githubUrl":"https://github.com/containerd/containerd/blob/4246446a2bf7d03837b0244118d858799393bd80/internal/cri/server/sandbox_run.go#L467-L503","documentation":"setupPodNetwork resolves the CNI network plugin for the sandbox's RuntimeHandler via getNetworkPlugin. If no plugin is configured (netPlugin == nil), the pod network cannot be set up and this error is returned. This indicates the CNI configuration was never initialized (no cni config dir/conf files) or the runtime handler has no matching plugin entry.","triggerScenarios":"RunPodSandbox reaching network setup (internal/cri/server/sandbox_run.go:485) with a containerd config lacking a [plugins.cri.cni] section, an empty conf_dir, or a runtime handler mapped to a netns pool/plugin that doesn't exist.","commonSituations":"containerd started without any /etc/cni/net.d/*.conf/list files installed (CNI plugins not deployed); Kubernetes node where the CNI daemonset failed to install; custom runtime_handler configured in containerd.toml without a corresponding network plugin; standalone containerd usage without CNI.","solutions":["Install/deploy the CNI plugin configuration (e.g., ensure /etc/cni/net.d contains valid *.conflist files).","Check containerd's config.toml: the [plugins.\"io.containerd.grpc.v1.cri\".cni] section and conf_dir/bin_dir paths exist.","If using custom runtime handlers, verify each has a valid network plugin mapping or disable pod network setup for it.","Ensure the CNI binaries exist in bin_dir (e.g., bridge, loopback, portmap)."],"exampleFix":"// containerd config.toml\n// before\n[plugins.\"io.containerd.grpc.v1.cri\"]\n  # no cni section\n// after\n[plugins.\"io.containerd.grpc.v1.cri\".cni]\n  bin_dir = \"/opt/cni/bin\"\n  conf_dir = \"/etc/cni/net.d\"","handlingStrategy":"validation","validationCode":"if _, err := os.Stat(\"/etc/cni/net.d\"); err != nil || len(cniConfFiles(\"/etc/cni/net.d\")) == 0 {\n  return errors.New(\"no CNI configuration installed; pods requiring networking will fail\")\n}","typeGuard":null,"tryCatchPattern":"if err := runPodSandbox(...); err != nil {\n  if strings.Contains(err.Error(), \"cni config not initialized\") {\n    return fmt.Errorf(\"node CNI misconfiguration: install CNI plugin configs in /etc/cni/net.d\")\n  }\n  return err\n}","preventionTips":["Verify the CNI daemonset is healthy and /etc/cni/net.d has *.conflist before scheduling pods","Keep containerd config.toml's cni conf_dir/bin_dir paths correct and populated","Map custom runtime handlers to valid network plugins or exempt them from pod network","Smoke-test pod networking after node bootstrap"],"tags":["cni","network","configuration","sandbox"],"backgroundTag":"cni-not-initialized","analyzedSha":"4246446a2bf7d03837b0244118d858799393bd80","analyzedAt":"2026-09-02T00:14:43.053Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}