hashicorp/nomad · error

failed to load CNI config list file %s: %v

Error message

failed to load CNI config list file %s: %v

What it means

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.

Source

Thrown at client/allocrunner/networking_cni.go:565

// 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)
			if err != nil {
				return nil, fmt.Errorf("failed to load CNI config file %s: %v", confFile, err)
			}
			if conf.Network.Name == name {
				return &cniConfParser{
					confBytes: conf.Bytes,
				}, nil
			}
		}
	}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Fix JSON/syntax errors in the .conflist file
  2. Validate the conflist against CNI 0.3.x/1.0 schema
  3. Compare against a known-good nomad.conflist example
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at client/allocrunner/networking_cni.go:565 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/c6d388a0a26145b5. Report an issue: GitHub.