{"record":{"id":"15625d720b057f1d","repo":"hashicorp/nomad","slug":"failed-to-configure-network-no-interface-with-an","errorCode":null,"errorMessage":"failed to configure network: no interface with an address","messagePattern":"failed to configure network: no interface with an address","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/allocrunner/networking_cni.go","lineNumber":504,"sourceCode":"\t\t}\n\t}\n\n\t// Use the first sandbox interface with an IP address\n\tsetStatus(true)\n\n\t// If no IP address was found, use the first interface with an address\n\t// found as a fallback\n\tif netStatus.Address == \"\" && netStatus.AddressIPv6 == \"\" {\n\t\tsetStatus(false)\n\t\tc.logger.Debug(\"no sandbox interface with an address found CNI result, using first available\",\n\t\t\t\"interface\", netStatus.InterfaceName,\n\t\t\t\"ip\", netStatus.Address,\n\t\t)\n\t}\n\n\t// If no IP address (IPv4 or IPv6) could be found, return an error\n\tif netStatus.Address == \"\" && netStatus.AddressIPv6 == \"\" {\n\t\treturn nil, fmt.Errorf(\"failed to configure network: no interface with an address\")\n\n\t}\n\n\t// Fallback: if no IPv4 address but we have IPv6, copy it to Address field\n\t// for backward compatibility with code that only checks Address field\n\t// (e.g. service registration with address_mode=\"alloc\")\n\tif netStatus.Address == \"\" && netStatus.AddressIPv6 != \"\" {\n\t\tnetStatus.Address = netStatus.AddressIPv6\n\t}\n\n\t// Use the first DNS results, if non-empty\n\tif len(res.DNS) > 0 {\n\t\tcniDNS := res.DNS[0]\n\t\tif len(cniDNS.Nameservers) > 0 {\n\t\t\tnetStatus.DNS = &structs.DNSConfig{\n\t\t\t\tServers:  cniDNS.Nameservers,\n\t\t\t\tSearches: cniDNS.Search,\n\t\t\t\tOptions:  cniDNS.Options,","sourceCodeStart":486,"sourceCodeEnd":522,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/allocrunner/networking_cni.go#L486-L522","documentation":"Returned by cniToAllocNet when the parsed CNI result contains no interface with an IPv4 or IPv6 address (including the fallback to the first addressed interface). Without any address the allocation's network status cannot be populated.","triggerScenarios":"Thrown at client/allocrunner/networking_cni.go:504 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check IPAM subnet capacity - exhaustion yields interfaces without addresses","Inspect CNI plugin logs and the nomad bridge state","Verify IP range config in the CNI conf and that no addresses were leaked","Clean stale bridges/IPAM store and retry"],"exampleFix":null,"handlingStrategy":"fallback","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"}