{"record":{"id":"2af363610a4cb0be","repo":"hashicorp/nomad","slug":"failed-to-initialize-network-configurator-v","errorCode":null,"errorMessage":"failed to initialize network configurator: %v","messagePattern":"failed to initialize network configurator: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"client/allocrunner/alloc_runner_hooks.go","lineNumber":104,"sourceCode":"func (ar *allocRunner) initRunnerHooks(config *clientconfig.Config) error {\n\thookLogger := ar.logger.Named(\"runner_hook\")\n\n\t// create health setting shim\n\ths := &allocHealthSetter{ar}\n\n\t// create network isolation setting shim\n\tns := &allocNetworkIsolationSetter{ar: ar}\n\n\t// build the network manager\n\tnm, err := newNetworkManager(ar.Alloc(), ar.driverManager)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to configure network manager: %v\", err)\n\t}\n\n\t// create network configurator\n\tnc, err := newNetworkConfigurator(hookLogger, ar.Alloc(), config)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to initialize network configurator: %v\", err)\n\t}\n\n\t// Create the alloc directory hook. This is run first to ensure the\n\t// directory path exists for other hooks.\n\talloc := ar.Alloc()\n\n\tar.runnerHooks = []interfaces.RunnerHook{\n\t\tnewIdentityHook(hookLogger, ar.widmgr),\n\t\tnewAllocDirHook(hookLogger, ar.allocDir),\n\t\tnewMaxRunDurationHook(hookLogger, alloc, ar.clientBaseLabels, ar.EnforceMaxRunDurationTimeout),\n\t\tnewConsulHook(consulHookConfig{\n\t\t\talloc:                   ar.alloc,\n\t\t\tallocdir:                ar.allocDir,\n\t\t\twidmgr:                  ar.widmgr,\n\t\t\tconsulConfigs:           ar.clientConfig.GetConsulConfigs(hookLogger),\n\t\t\tconsulClientConstructor: consul.NewConsulClientFactory(config),\n\t\t\thookResources:           ar.hookResources,\n\t\t\tlogger:                  hookLogger,","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/allocrunner/alloc_runner_hooks.go#L86-L122","documentation":"During initRunnerHooks, newNetworkConfigurator failed to construct the component that assigns/tears down the alloc's network (host or CNI-based). The alloc cannot proceed with hook setup. The underlying cause (misconfigured client network settings, CNI errors) is embedded via %v.","triggerScenarios":"newNetworkConfigurator errors when client config for host networks is invalid (host_networks referencing unknown interfaces), or CNI config is malformed/missing for bridge mode allocs.","commonSituations":"client.host_networks naming a network that doesn't exist on the host; missing or invalid /opt/cni/bin plugins or CNI conflist; mismatch between nomad client config cni_path and actual CNI install; bridge_network_name pointing at a nonexistent bridge.","solutions":["Inspect the wrapped cause for the concrete misconfiguration (unknown host network, CNI load failure)","Fix client.hcl network settings: ensure referenced host networks/interfaces exist","Verify cni_path points to a directory containing the required CNI binaries and valid network confs","Restart the Nomad client after fixing network configuration so fingerprinting reruns"],"exampleFix":"// before (client.hcl)\nhost_networks = [\"wrong-name\"]\n// after\nhost_network \"public\" {\n  interface = \"eth0\"\n  cidr      = \"10.0.0.0/24\"\n}","handlingStrategy":"validation","validationCode":"// preflight client network config\nfor _, hn := range cfg.Client.HostNetworks {\n  if !interfaceExists(hn.Interface) { return fmt.Errorf(\"host network %q missing\", hn.Name) }\n}\nif _, err := os.Stat(filepath.Join(cfg.Client.CNIBinDir, \"bridge\")); err != nil {\n  return fmt.Errorf(\"CNI plugins missing in %s\", cfg.Client.CNIBinDir)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep cni_path/cni_bin_dir pointing at a populated CNI install","Ensure host_networks entries reference existing interfaces/CIDRs","Validate client.hcl network sections before restarting agents"],"tags":["nomad","client","network","cni","configuration"],"backgroundTag":"network-configurator-init-failed","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"}