{"record":{"id":"e555e6987971eca1","repo":"hashicorp/nomad","slug":"failed-to-configure-network-v","errorCode":null,"errorMessage":"failed to configure network: %v","messagePattern":"failed to configure network: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/allocrunner/networking_cni.go","lineNumber":226,"sourceCode":"\n\t// Depending on the version of bridge cni plugin used, a known race could occure\n\t// where two alloc attempt to create the nomad bridge at the same time, resulting\n\t// in one of them to fail. This rety attempts to overcome those erroneous failures.\n\tconst retry = 3\n\tvar firstError error\n\tvar res *cni.Result\n\tfor attempt := 1; ; attempt++ {\n\t\tvar err error\n\t\tif res, err = c.cni.Setup(ctx, alloc.ID, spec.Path,\n\t\t\tc.nsOpts.withCapabilityPortMap(portMaps.ports),\n\t\t\tc.nsOpts.withArgs(cniArgs),\n\t\t); err != nil {\n\t\t\tc.logger.Warn(\"failed to configure network\", \"error\", err, \"attempt\", attempt)\n\t\t\tswitch attempt {\n\t\t\tcase 1:\n\t\t\t\tfirstError = err\n\t\t\tcase retry:\n\t\t\t\treturn nil, fmt.Errorf(\"failed to configure network: %v\", firstError)\n\t\t\t}\n\n\t\t\t// Sleep for 1 second + jitter\n\t\t\ttime.Sleep(time.Second + (time.Duration(c.rand.Int63n(1000)) * time.Millisecond))\n\t\t\tcontinue\n\t\t}\n\t\tbreak\n\t}\n\n\tif c.logger.IsDebug() {\n\t\tresultJSON, _ := json.Marshal(res)\n\t\tc.logger.Debug(\"received result from CNI\", \"result\", string(resultJSON))\n\t}\n\n\tallocNet, err := c.cniToAllocNet(res)\n\tif err != nil {\n\t\treturn nil, err\n\t}","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/allocrunner/networking_cni.go#L208-L244","documentation":"CNI plugin invocation (c.cni.Setup) failed while creating the allocation's network namespace/bridge (IPAM failure, missing plugin binary, or transient race creating the nomad bridge). Setup retries up to 3 times; this wrapped error is returned after final failure, leaving the alloc without networking.","triggerScenarios":"Thrown at client/allocrunner/networking_cni.go:226 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the wrapped CNI error and client logs for the per-attempt warnings","Verify CNI plugin binaries (bridge, loopback, iptables) are installed in the CNI path","Check IPAM subnet exhaustion and leftover bridges/iptables state","Clean stale iptables rules/nomad bridges and retry the allocation"],"exampleFix":null,"handlingStrategy":"retry","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"}