{"record":{"id":"28338a4dd5ce3f0d","repo":"hashicorp/nomad","slug":"no-cni-network-config-found-in-s","errorCode":null,"errorMessage":"no CNI network config found in %s","messagePattern":"no CNI network config found in (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/allocrunner/networking_cni.go","lineNumber":555,"sourceCode":"func (c *cniConfParser) getOpt() (cni.Opt, error) {\n\tif len(c.listBytes) > 0 {\n\t\treturn cni.WithConfListBytes(c.listBytes), nil\n\t}\n\tif len(c.confBytes) > 0 {\n\t\treturn cni.WithConf(c.confBytes), nil\n\t}\n\t// theoretically should never be reached\n\treturn nil, errors.New(\"no CNI network config found\")\n}\n\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)","sourceCodeStart":537,"sourceCodeEnd":573,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/allocrunner/networking_cni.go#L537-L573","documentation":"Returned by loadCNIConf when the CNI confDir contains no files matching .conf/.conflist/.json. Bridged networking requires a CNI network config to load, so an empty directory aborts configurator setup.","triggerScenarios":"Thrown at client/allocrunner/networking_cni.go:555 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Place the CNI network config file (e.g. nomad.conflist) in the CNI conf dir","Verify the configured CNI conf dir matches where configs were installed","Check file extensions are .conf/.conflist/.json"],"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"}