{"record":{"id":"c6d388a0a26145b5","repo":"hashicorp/nomad","slug":"failed-to-load-cni-config-list-file-s-v","errorCode":null,"errorMessage":"failed to load CNI config list file %s: %v","messagePattern":"failed to load CNI config list file (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/allocrunner/networking_cni.go","lineNumber":565,"sourceCode":"\n// loadCNIConf looks in confDir for a CNI config with the specified name\nfunc loadCNIConf(confDir, name string) (*cniConfParser, error) {\n\tfiles, err := cnilibrary.ConfFiles(confDir, []string{\".conf\", \".conflist\", \".json\"})\n\tswitch {\n\tcase err != nil:\n\t\treturn nil, fmt.Errorf(\"failed to detect CNI config file: %v\", err)\n\tcase len(files) == 0:\n\t\treturn nil, fmt.Errorf(\"no CNI network config found in %s\", confDir)\n\t}\n\n\t// files contains the network config files associated with cni network.\n\t// Use lexicographical way as a defined order for network config files.\n\tsort.Strings(files)\n\tfor _, confFile := range files {\n\t\tif strings.HasSuffix(confFile, \".conflist\") {\n\t\t\tconfList, err := cnilibrary.ConfListFromFile(confFile)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to load CNI config list file %s: %v\", confFile, err)\n\t\t\t}\n\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}","sourceCodeStart":547,"sourceCodeEnd":583,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/allocrunner/networking_cni.go#L547-L583","documentation":"Returned by loadCNIConf when a .conflist file in the CNI config directory cannot be parsed by cnilibrary.ConfListFromFile. The file is malformed, so its network list cannot be matched to the requested network name.","triggerScenarios":"Thrown at client/allocrunner/networking_cni.go:565 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix JSON/syntax errors in the .conflist file","Validate the conflist against CNI 0.3.x/1.0 schema","Compare against a known-good nomad.conflist example"],"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"}