{"record":{"id":"96153786f6db60b5","repo":"hashicorp/nomad","slug":"cni-network-config-not-found-for-name-q","errorCode":null,"errorMessage":"CNI network config not found for name %q","messagePattern":"CNI network config not found for name %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/allocrunner/networking_cni.go","lineNumber":585,"sourceCode":"\t\t\tif confList.Name == name {\n\t\t\t\treturn &cniConfParser{\n\t\t\t\t\tlistBytes: confList.Bytes,\n\t\t\t\t}, nil\n\t\t\t}\n\t\t} else {\n\t\t\tconf, err := cnilibrary.ConfFromFile(confFile)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to load CNI config file %s: %v\", confFile, err)\n\t\t\t}\n\t\t\tif conf.Network.Name == name {\n\t\t\t\treturn &cniConfParser{\n\t\t\t\t\tconfBytes: conf.Bytes,\n\t\t\t\t}, nil\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"CNI network config not found for name %q\", name)\n}\n\n// Teardown calls the CNI plugins with the delete action\nfunc (c *cniNetworkConfigurator) Teardown(ctx context.Context, alloc *structs.Allocation, spec *drivers.NetworkIsolationSpec) error {\n\tif err := c.ensureCNIInitialized(); err != nil {\n\t\treturn err\n\t}\n\n\tportMap := getPortMapping(alloc, c.ignorePortMappingHostIP)\n\n\tif err := c.cni.Remove(ctx, alloc.ID, spec.Path, cni.WithCapabilityPortMap(portMap.ports)); err != nil {\n\t\tc.logger.Warn(\"error from cni.Remove; attempting manual iptables cleanup\", \"err\", err)\n\n\t\t// best effort cleanup ipv6\n\t\tipt, iptErr := c.newIPTables(structs.NodeNetworkAF_IPv6)\n\t\tif iptErr != nil {\n\t\t\tc.logger.Debug(\"failed to detect ip6tables\", \"error\", iptErr)\n\t\t} else {","sourceCodeStart":567,"sourceCodeEnd":603,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/allocrunner/networking_cni.go#L567-L603","documentation":"Returned by loadCNIConf after scanning all config files when none declares a network whose Name matches the requested CNI network name. The plugin dir is readable but lacks the expected network definition.","triggerScenarios":"Thrown at client/allocrunner/networking_cni.go:585 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the CNI config file's name field matches the network name configured on the client","Check spelling/case of the interface network name","Install the missing CNI network config"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}