hashicorp/nomad · error

no CNI network config found in %s

Error message

no CNI network config found in %s

What it means

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.

Source

Thrown at client/allocrunner/networking_cni.go:555

func (c *cniConfParser) getOpt() (cni.Opt, error) {
	if len(c.listBytes) > 0 {
		return cni.WithConfListBytes(c.listBytes), nil
	}
	if len(c.confBytes) > 0 {
		return cni.WithConf(c.confBytes), nil
	}
	// theoretically should never be reached
	return nil, errors.New("no CNI network config found")
}

// loadCNIConf looks in confDir for a CNI config with the specified name
func loadCNIConf(confDir, name string) (*cniConfParser, error) {
	files, err := cnilibrary.ConfFiles(confDir, []string{".conf", ".conflist", ".json"})
	switch {
	case err != nil:
		return nil, fmt.Errorf("failed to detect CNI config file: %v", err)
	case len(files) == 0:
		return nil, fmt.Errorf("no CNI network config found in %s", confDir)
	}

	// files contains the network config files associated with cni network.
	// Use lexicographical way as a defined order for network config files.
	sort.Strings(files)
	for _, confFile := range files {
		if strings.HasSuffix(confFile, ".conflist") {
			confList, err := cnilibrary.ConfListFromFile(confFile)
			if err != nil {
				return nil, fmt.Errorf("failed to load CNI config list file %s: %v", confFile, err)
			}
			if confList.Name == name {
				return &cniConfParser{
					listBytes: confList.Bytes,
				}, nil
			}
		} else {
			conf, err := cnilibrary.ConfFromFile(confFile)

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Place the CNI network config file (e.g. nomad.conflist) in the CNI conf dir
  2. Verify the configured CNI conf dir matches where configs were installed
  3. Check file extensions are .conf/.conflist/.json
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at client/allocrunner/networking_cni.go:555 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/28338a4dd5ce3f0d. Report an issue: GitHub.